cancel
Showing results for 
Search instead for 
Did you mean: 

Save Data from STM32 Nucleo F334R8 when powered by battery for later serial tranfering

IDADI.1
Associate

Hello ,

I am using Nucleo F334R8 on a mobile battery-powered robot and I want to save data from my Analog input in order to be able check these data offline (connect to PC via USB after every experiment).

My data are floating points from AnalogIn class with max. sampling frequency 100 (or less) Hz and my experiments will last maximum 30 seconds.

I tried connecting to PC after the experiment without removing battery source but even then when the platform connects with USB it resets .

What are the possible solutions from my problem?

I have read about EEPROM memory in Arduino platforms but in STM32 there is not .

All solutions are welcome but I am first searching for the one without an external card if possible.

Giannis

2 REPLIES 2
berendi
Principal

Read chapter 3 of the reference manual. There is a flash with 2 kByte pages supporting in-application programming. This is shared with the running firmware, so you have to find out first how to decrease the amount of flash available to the firmware in your toolchain.

> My data are floating points from AnalogIn class with max. sampling frequency 100 (or less) Hz and my experiments will last maximum 30 seconds.

So there are up to 3000 values. I have no idea what an AnalogIn class is, assuming 4 byte floats it would make 12000 bytes. Reserve 6*2048 bytes in your linker script or whatever your toolchain calls it.

Then you can store the values sequentially in flash as described in chapter 3 of the reference manual. You have to erase the pages first.

Check the Flash memory characteristics table in the datasheet for the duration of erase and write operations. No code will be executed from flash while an erase or write is in progress, not even interrupt handlers.

Thanks for the immediate response. I see what you say.

Can you attach the reference manual you are refering to?

Best regards.