How To use EEPROM emulation in STM32F0xx (AN4061) with STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 4:05 AM
Hello!
I downloaded the code and documentation to AN4061 but I can't compile it in STM32CubeIDE. The Project uses an STM32F051, CubeMX and HAL. The definitions and functions used in the code are not available in HAL and the HAL_FLASH or HAL_FLASHEx Drivers don't seem to support the functionality of AN4061. Meaning there are no functions to delete or write a Page, just the Option Bytes. What am I missing? Is there a possibility to add another flash driver to the project? There doesn't seem to be anything in the available software packages.
Many Greetings!
Remo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 4:51 AM
Check what stm32f0xx​_hal_conf.h is pulling in.
​
Consider just managing the Flash and structures you want to save more directly.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 5:38 AM
HAL_FLASH_MODULE_ENABLED is defined. But also the HAL Documentation for STM32F0 MCUs doesn't mention any of the functions used in AN4061.
With your second statement you mean digging into the reference manual and try a more low level approach? Yeah, maybe, when there is no driver available anymore this would probably be the only remaining solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 5:57 AM
Not sure.
I'm using L0 parts over F0 ones​.
I'd have to imagine ST has the EE EMU​ stuff for the F0, or Cube can autogen something.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 6:05 AM
AN4061 is specifically for F0.
CubeMX does not have any settings for FLASH. Or at least I didn't find anything. That is actually my question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 12:39 PM
This is correct. CubeMX does not deal with writing or erasing functionality. You add all that manually. Please see examples in the STM32Cube package (installed by CubeMX or CubeIDE) and other numerous projects on github and so on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 12:51 PM
Ok, thanks! I just thing it's a bit curious that an older StdPeriph_Driver included in AN4061 would contain functions to erase and write flash data and the newer HAL doesn't.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 1:11 PM
I did not say that HAL library does not contain flash write & erase functions. Of course it does.
But CubeMX won't auto-generate code for that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 2:26 PM
Hmm... I didn't find any HAL function to delete or write pages. Just Option Bytes. I couldn't even find any in HAL Documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-26 7:45 PM
> I couldn't even find any in HAL Documentation
​
​
JW
