cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a workaround to handle data incoming from the serial link while writing data into internal EEPROM?

CCANO
Associate II

MCU: STM32L083

UART: 9600 bp 8N1

MCU freq: 32 MHz

I have an issue about the internal EEPROM erase/write timing in STM32L0 MCU.

I have an UART serial link configured to 9600 bauds, handled by interrupt routine in my code.

Sometimes, I have to write data in internal EEPROM. I have split the write operation in 2 phases: erase then write data which takes 3 ms each operation. During this time access to code execution is not allowed in the same bank, so the execution of my program is frozen.

Therefore, when erasing or writing data in internal EEPROM, I can receive up to 3 bytes over UART link.

5 REPLIES 5

You can place your UART RX interrupt code (and all the functions which are being called from there) into SRAM (or into another flash bank, if there is one).

AvaTar
Lead

Use the software handshake (XON/XOFF protocol), or hardware handshake (RTS/CTS) for the serial connection.

CCANO
Associate II

Unfortunately, the serial protocol cannot be changed (customer protocol) and do not use this mechanism.

AvaTar
Lead

If you neither can/want to stop the sender via handshake nor move the reception handling to RAM, you could stop the sender at a higher protocol level, or postpone the EEPROM storage until save.

I see no other options.

CCANO
Associate II

I'll try to put every UART interrupt functions into RAM. Thanks.