cancel
Showing results for 
Search instead for 
Did you mean: 

clock cycles needed for eeprom write

prudhvichitturi
Associate II

Hello , 

i am looking to know for STM32L051 how long will it take a byte to be written in to eeprom.

while writing eeprom does it have any limitations like UART intteruptions?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Use a TIM counting off micro-seconds to measure the time across the functions. Or toggle a GPIO and scope it

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

6 REPLIES 6
TDK
Guru

If it's the same as the STM32L1 family (which it probably is), it will not stall the bus unless you read/write to the same bank before the first operation is done.

Datasheet says programming time is 3.94 ms max.

If you feel a post has answered your question, please click "Accept as Solution".

Ironically that time is about 10 to 100 times worse than for a software EEPROM emulation or a proper storage system in FLASH memory.

prudhvichitturi
Associate II

The below is the function i use , 

 

 flash_unlock( );
memcpy( &data_w, data_ptr, sizeof( data_w ) );
status = HAL_FLASHEx_DATAEEPROM_Program( TYPEPROGRAMDATA_WORD, Address_Src, INVERTED_DATA( data_w ) );
flash_lock( );

from the above , does it take longer than 3.94?

 

 

Use a TIM counting off micro-seconds to measure the time across the functions. Or toggle a GPIO and scope it

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

It shouldn't. Measure it, shouldn't stall at all. Not sure if you can lock the flash when a write is in progress.

If you feel a post has answered your question, please click "Accept as Solution".