Skip to main content
CCANO
Associate
December 3, 2018
Question

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

  • December 3, 2018
  • 5 replies
  • 1010 views

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.

This topic has been closed for replies.

5 replies

After Forever
Senior III
December 3, 2018

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
Senior III
December 3, 2018

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

CCANO
CCANOAuthor
Associate
December 3, 2018

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

AvaTar
Senior III
December 4, 2018

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
CCANOAuthor
Associate
December 4, 2018

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