Trying to write to Internal Flash. Getting 'Not supported' errors in runtime

Hi there,

I’m trying to write to internal flash and have followed this article:

In doing so, I’m using this code:
and to get that compiling had to find this: netmf-community-ports/DeviceCode/ThirdParty/GHI/Libraries/GHI.OSHW.Hardware at master · jaydcarlson/netmf-community-ports · GitHub

to get the GHI.OSHW.Hardware dll…
So far so good :slight_smile:

I’m running micro .net version 4.3 on a cerb40-ii running on VS2015 (Other apps work fine)

But when I try and run a hello world example, with just this one line:
STM32F4.IO.InternalStorage flashStorage = new STM32F4.IO.InternalStorage(11);

I get 2 ‘not supported’ exceptions.

1st in rtc.cs (I assume not really relevant) Line 550:
static Register RCC_APB1ENR = new Register(RCC_BASE + 0x40);

but then I get ‘not supporterd’ in the code for the internal flash:
ACR = new Register(Flash_ACR);

where Flash_ACR = 0x40023C00;

at that point execution halts.
Any one know what I’m doing wrong?

I noticed when I was building GHI.OSHW.Hardware.dll the solution file only references the Managed folder.
Yet there is a folder called ‘Native’ which appears to have C++ classes like Register.cpp which external class I get the linker error on.
Could this be the issue? Not sure how to compile it!
Thanks again

Ok, resolved. please ignore the above…

I was attempting to use the dll : GHI.OSHW.Hardware

When I should have used GHI.Hardware.
Then refactored the code to use Value instead of Read and Write

1 Like

Love it when a plan comes together.

1 Like