Main Site Documentation

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


#1

Hi there,

I’m trying to write to internal flash and have followed this article:
https://www.ghielectronics.com/community/forum/topic?id=21993

In doing so, I’m using this code: https://www.ghielectronics.com/community/codeshare/entry/885
and to get that compiling had to find this: https://github.com/jaydcarlson/netmf-community-ports/tree/master/DeviceCode/ThirdParty/GHI/Libraries/GHI.OSHW.Hardware

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?
Thanks


#2

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


#3

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
:slight_smile:


#4

Love it when a plan comes together.