Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 7 months ago.
Using flash memory on FRDM boards?
Hi,
it seems that the local file system abstraction/API is not working on the FRDM boards - but here is a post about allocating FLASH for user programs to use: https://community.freescale.com/thread/301573
How would the equivalent be done in mbed code? (I am using gcc-arm)
br Lars
1 Answer
10 years, 7 months ago.
It can be done this way: http://mbed.org/users/okano/notebook/iap-in-application-programming-internal-flash-eras/?page=1#comment-271. I actually believe it requires something extra to make the Flash/RAM usage calculators understand where it is, but the actual linker does understand it, so that doesn't really affect it. And I don't know if gcc-arm understands it.
But it is also purely to make sure in compile time you get an error when it goes wrong, it isn't actually required. I just checked in the online compiler, and there I get indeed an error message if I try to reserve flash memory like that in the space where the linker wants to place my program. But in principle flash is just used from 0 up till what is needed, so if you know you won't be using the last sector you can safely program there, even without anything reserved. (Of course it is nice to reserve it, just to be sure).
Hi Erik,
thanks for your input (I didn't see the mail notification before now ;)).
Considering how useful and cheap the FRDM boards are, it would make good sense to have a solid lib or code snippet in the mbed sources somewhere to handle this if possible.
I wonder if it would be possible to define a const entry after all the code and use the resulting pointer it has been given as a starting point? (maybe I am completely clueless on this topic)
posted by 07 May 2014