I know this topic must have come up, but I don't find anything obvious in the forum. Im using an stm32f407 - the cheapie board. I would like to write events to NVRAM.
- Does chibios have support for writing to flash/nvram that is native to this board?
Just point me to the appropriate thread that I know must exist...
Thanks,
Larry
data logger/nvram
Moderator: RoccoMarco
Re: data logger/nvram
So, Ive ordered an SD Card xface, and will use that when it arrives. Im still curious about the onboard Flash though...
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: data logger/nvram
Hi,
There is an option to enable the NVRAM but handling is up to the application.
Giovanni
There is an option to enable the NVRAM but handling is up to the application.
Giovanni
Re: data logger/nvram
If you talk about the 4kB backup RAM it is quite easy to access, you don't need ChibiOS for that.
It's all in the Reference Manual (RM0090). You should have a copy if you want to do any serious work on the MCU.
The range of this memory is 0x4002 4000 - 0x4002 4FFF and you can access it using pointers, por instance.
To be able to acess to this memory you need to activate the access to it using as is described in the section 4 of the reference manual.
● Access to the backup SRAM
1. Enable the power interface clock by setting the PWREN bits in the RCC APB1
peripheral clock enable register (RCC_APB1ENR)
2. Set the DBP bit in the PWR power control register (PWR_CR) to enable access to the
backup domain
3. Enable the backup SRAM clock by setting BKPSRAMEN bit in the RCC APB1
peripheral clock enable register (RCC_APB1ENR)
After that you just need to directly write to the backup RAM region.
The logs can also be written to the last sectors of the flash memory.
Unfortunatelly the last sectors are quite big (128kB each) so, al least, you would need to reserve
128kB to logging.
The procedures to access the flash are also in the reference manual.
Best regards
Vicente
It's all in the Reference Manual (RM0090). You should have a copy if you want to do any serious work on the MCU.
The range of this memory is 0x4002 4000 - 0x4002 4FFF and you can access it using pointers, por instance.
To be able to acess to this memory you need to activate the access to it using as is described in the section 4 of the reference manual.
● Access to the backup SRAM
1. Enable the power interface clock by setting the PWREN bits in the RCC APB1
peripheral clock enable register (RCC_APB1ENR)
2. Set the DBP bit in the PWR power control register (PWR_CR) to enable access to the
backup domain
3. Enable the backup SRAM clock by setting BKPSRAMEN bit in the RCC APB1
peripheral clock enable register (RCC_APB1ENR)
After that you just need to directly write to the backup RAM region.
The logs can also be written to the last sectors of the flash memory.
Unfortunatelly the last sectors are quite big (128kB each) so, al least, you would need to reserve
128kB to logging.
The procedures to access the flash are also in the reference manual.
Best regards
Vicente