cancel
Showing results for 
Search instead for 
Did you mean: 

STM8 microcontroller flash block write problems

IgorLazorenko
Associate

I am using the STM8L151C8T6 microcontroller (high density with 64k flash) and the StandardPeripheralLibrary v1.6.1, as well as the IAR Embedded Workbench for STM8 v3.11.1. I need to write and erase blocks of flash memory with high speed. For this I want to use a block writing. In the peripheral library there are functions FLASH_ProgramBlock (...) and FLASH_EraseBlock (...) for this. According to the documentation, these functions should be run from RAM. I have uncommented #define RAM_EXECUTION (1) in stm8l15x.h file.

The problem is I am getting a compiler warnings:

0693W00000FCfD5QAL.png0693W00000FCfEDQA1.png0693W00000FCfEmQAL.png 

Also, I get the program hangs in the FLASH_EraseBlock() function on line 858.

I assume that the freezes and warnings are due to the fact that the instructions add32_l0_l0_l1 and sll32_l0_l0_a are in flash memory.

0693W00000FCfMCQA1.png 

But what can I do? How do I get rid of the warnings and get block write and erase to work correctly?

Thanks. Best regards, Igor lazorenko

0 REPLIES 0