StorageDev not functioning with codeplex porting solution for Cerb-Family


We’ve just built FEZCerberus stock solution of Porting Kit (4.2 QFE2) and we’re doing some tests with StorageDev class of OSHW GHI library.

We’re using a FEZ-Cerbuino Bee with a SandIsk 1Gb SD, formatted as FAT with default cluster size. Inside SD root folder there are a text file and a folder with another text file within.

Our test method is:

private static void testSD()
            var volumes=VolumeInfo.GetVolumes();
            var fs = VolumeInfo.GetFileSystems();
            if (volumes.Length == 0) return;
            var volume = volumes[0];
            var dir = volume.RootDirectory;
            foreach (var file in Directory.GetFiles(dir))
                using(var sr=new StreamReader(File.OpenRead(file)))

We get a IOException with HRESULT CLR_E_DIRECTORY_NOT_FOUND while calling “Directory.GetFiles(dir)”.

Actually “var dir = volume.RootDirectory;” returns “\SD” (of course watch shows double back slash, i.e. \SD), but enumerating files there fails while calling.

What could be wrong?


As the next step I will take a look at the Mountaneer port on codeplex.

What is wrong with the other thread?

Mountaneer port doesn’t support file-system, as far as I know: am I wrong?

I switched to this forum just because maybe it is a porting related issue…


“Native programming” was meant for RLP not porting :wink:

I say both :slight_smile:

Is codeplex up to date?

Should be but we will double check when we get to it.

Hi Gus, any news about that? I see latest checkin was done in aug 23th.


Sorry about the oversight, Codeplex has been updated for the version of the firmware. GPIO interrupts were restored to pre-Oberon QFE2 updates.

Thanks a lot. I’m going to test it once more.

Just a curiosoty concerning GPIO interrupts: would QFE2 updates break your porting somewhere?

Ok, now it works as expected.

Thank you very much!

Indeed, overwriting porting kit with Oberon latest sources breaks FS support.

Looking simply at C:\MicroFrameworkPK_v4_2\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_GPIO\STM32F4_GPIO_functions.cpp doesn’t seem to explain why, since it seems just a little refactored with respect to pre-QFE2 version, but probably I’d have to analyze it better…


Actually it depends ot following difference on

 void STM32F4_GPIO_Pin_Config( GPIO_PIN pin, UINT32 mode, GPIO_RESISTOR resistor, UINT32 alternate )


With this line FS doesn’t work:

//UINT32 speed = (alternate >> 8) << shift; 

Replacing with previous code FS works:

UINT32 speed = 0x3 << shift; // Force all ports to 100 MHz High speed on 30 pF (80 MHz Output max speed on 15 pF)

Hope it helps…

Good catch!