cancel
Showing results for 
Search instead for 
Did you mean: 

Non volatile memory on 32F429I discovery board

mats23
Associate II
Posted on August 05, 2014 at 15:54

I have a 32F429I discovery board and I have some parameters, e.g. touch screen calibration information, that I would like to store in a non volatile memory. 

As far as I understand it I have the options of:

1 - storing the data on a USB memory connected to the second USB port on the board.

2 - use the RTC backup registers which will keep their data as long as there are power on the Vbat.

I have tried with 1, but I have troubles getting the USB memory to work in a stable way.

I have also tried 2, but as I understand it the Vdd is powered from the same pin as the Vbat (on the disco board) and thus the board will not power off if the RTC backup registers are to keep their data. This would in principle be OK if the screen could be turned off from SW, but I understand that is not possible.

Would it be possible to store data into the flash memory of the controller, or are there any other suggested way of doing this?

Many thanks for suggestions.

/Mats

5 REPLIES 5
Posted on August 05, 2014 at 16:59

There should be 4K of NVRAM at 0x40024000, but this needs the battery.

There's JP3, not sure if that is separate from the current drawn from the display, and seem to think you could physically separate the back-light circuit if you wanted too.

Normally one would use one of the smaller flash blocks (16K) to store calibration/serialization type data, and have the first block be a boot loader. ST has a rather lame EEPROM emulation library, and if your data is small and fixed, you might consider the OTP memory.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mats23
Associate II
Posted on August 06, 2014 at 09:54

clive1, many thanks for your reply!

>There should be 4K of NVRAM at 0x40024000, but this needs the battery.

 

I guess this is what they call the Backup SRAM?

>There's JP3, not sure if that is separate from the current drawn from the display, and seem to think you could physically separate the back-light circuit if you wanted too.

 

Do you mean that if I remove the JP3 when removing the 5V and at the same time having a battery connected to the 3V, the board would enter Vbat mode? I am not good enough on reading schematics to understand how the JP3 could be utilized...

>Normally one would use one of the smaller flash blocks (16K) to store calibration/serialization type data, and have the first block be a boot loader. ST has a rather lame EEPROM emulation library, and if your data is small and fixed, you might consider the OTP memory.

If I were to use one of the 16K flash blocks, should I then proceed like in the example ''FLASH_EraseProgram'' provided by ST in the STM32Cube? I guess that I then will have to modify my linker script file to prevent the linker from placing program code in the same memory area?

Using the OTP memory would mean storing the data directly into the source code of my program and compiling it into the binary file, correct? Would that suffice for the touchscreen calibration data, i.e. is the screen stable over time and would not require a re-calibration after a while?

Best regards, Mats

Posted on August 06, 2014 at 16:34

JP3 separates the 3V and VDD rails, the STM32 runs from the VDD, the LCD from the 3V.

You could remove R52 and power the VBAT with it's own supply. You could also add a 32.768 KHz crystal and associated components to make the LSE functional.

The OTP would be suitable for parameters that don't change. ie serial numbers, encryption keys, hard calibration constants. If your parameters age or vary, then perhaps not so useful. You don't have to put the constants in the source, the code running on the CPU can write to OTP, you'd perhaps use a test/configuration option to run that code and set parameters.

R47..R50 connect the supply to the LCD back light. These could be replaced by alternate circuitry. You should probably become sufficiently capable of reading the intent from a schematic, even if you don't understand all of the electrical/electronic issues.

You might want to review IAP and firmware_upgrade examples to see how the erase/write flash from within an application.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mats23
Associate II
Posted on August 07, 2014 at 08:11

Many thanks clive1!

/Mats

mats23
Associate II
Posted on August 08, 2014 at 14:56

I today tried to remove R52 and supply Vbat with 3V. It then looks like the RTC registers keep their data when Vdd is removed, as expected.