STM32F3 Flash page capacity and reading from Flash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-04 4:24 AM
Hello,
Lately I've been trying to save some data on flash in my STM32F3 discovery board. Saving data was succesful but I have a little problem in reading from this memory. Function I'm using to check my data is: uint32_t dana=0x00A98AC7; . . . __IO uint32_t data32; uint32_t AddressCheck = PageTable[PageNumber]; while (AddressCheck < PageTable[PageNumber+1]) { data32 = *(__IO uint32_t*)AddressCheck; if (data32 != dana) { HAL_GPIO_WritePin(GPIOE, GPIO_PIN_13, GPIO_PIN_SET); } Address = Address + 4; } dana is a value I'm writing to flash. When I'm checking flash registers (in debug window) it is saved there correctly. When I use the above function all the flash memo registers are reported to have multiple errors. I guess the problem is in here: data32 = *(__IO uint32_t*)AddressCheck; Can anyone please tell me why? Oh and the post question: each of my flash pages has 2kb memory (0x800) how many uint32_t variables can I store in one page? is it 512? I'm asking because when I look on flash memory registers I can easly count exactly 240 variables on one page. Regards Dominik O.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-04 6:23 AM
Address = Address + 4; // AddressCheck ??
A 2K page would hold 512 32-bit variables, for a 1K page 256Is it failing to write, is there an error related to that. Each word can be written once, and then would need to be erased.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
‎2015-08-05 7:24 AM
That's wright, I'm able to fill one 2kb flash page with 512 variables uint23_t.
Program is now working fine. I can read data from flash which is the same as a data written to it. I can do it just by refering exactly to the flash register: uint32_t data32 = *(uint32_t*)register; I guess the main problem lies just in displaying those variables in a debug window. I'm talking about an optimization level. Sorry about that mistake in naming a variable (AddressCheck). I found it a while after sending my post. Is it the optimization level that result in such a message like below in the 'expression value' window? Error: Multiple errors reported.\ Failed to execute MI command: -var-create - * tim_trigger Error message from debugger back end: -var-create: unable to create variable object\ Unable to create variable object- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-08-05 9:58 AM
I'm not familiar with the tools you are using.
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
‎2015-08-06 6:32 AM
It is System Workbench for STM32, a debug window looks exactly the same as in CodeWarrior 10.6 for Freescale microcontrollers. I guess You know it but I probably didn't describe it correctly.
