cancel
Showing results for 
Search instead for 
Did you mean: 

STLUX Library: Flash functions

Maksim Salau
Associate II
Posted on May 25, 2017 at 10:29

Hi,

STM8 has a great Peripheral Library, which can hide complexity of register configuration. STLUX also has a library but it is not as rich as the STM8 one. I used stm8s_i2c.{c,h} for STLUX with success and want to do the same for stm8s_flash.{s,h} since stlux_flash.{c,h} is very limited compared to the stm8 version: stlux_flash can operate only EEPROM, while stm8_flash can operate any memory region (flash, eeprom, option bytes).

So here is the question: Is this possible?

My understanding is that STLUX has a FLASH peripheral and is able to do IAP. I just need to setup memory map correctly for the chosen part (int stm8s_flash.h) and verify that correct bits are set and monitored during operation (there are few options in the stm8s_flash.c).

My MCU of choice is STLUX385A. What STM8S MCU is the closest counterpart?

Thanks,

Maksim.

#stlux #iap #flash
2 REPLIES 2
Maksim Salau
Associate II
Posted on May 30, 2017 at 11:19

My assumption was correct (at least for programming of option bytes). So the rest should be good too, since same registers are present in STLUX devices.

Maksim

Posted on May 30, 2017 at 15:28

Hi Maksim,

yes, you're right, you can use stm8s_flash command to have access to STLux E2PROM, flash and option bytes.

Stefano