cancel
Showing results for 
Search instead for 
Did you mean: 

Flashing STM32L412CB without using STM32CubeProgrammer.

AKhal.2
Associate

Dear STMicroelectronics

I am an employee of the TaiPit company, we are engaged in the production of electricity meters. In modems for electricity meters, we use STM32L412CB microcontrollers and additionally some modules.

At the moment, the task is to write a program for flashing the modem via UART. For flashing STM32L412CB over UART, I found two programs STMFlashLoader.exe and STM32CubeProgrammer.

STM32CubeProgrammer flashes the microcontroller without any problems and has a command line option, but since my software should run without installing the program and integrate into the general software of the company, I should avoid installing a java machine, which is impossible when using the STM32CubeProgrammer program.

STMFlashLoader has a sample program code, dll description and can be launched from the command line, this is what we need, but this program cannot reflash the STM32L412CB controller and crashes with an error.

After looking through the program code, we realized that the program exits on the BYTE STBL_GET (LPBYTE Version, LPCommands pCmds) command, error code 19 (DEC) or 13 (HEX)

Questions:

1) Are there any other programs besides STMFlashLoader and STM32CubeProgrammer that allow you to reflash the STM32L412CB controller and have execution from the command line?

2) What can cause an error when executing the BYTE STBL_GET (LPBYTE Version, LPCommands pCmds) command?

3) Is there some other dll with a description and example code so that I could write a program for flashing the STM32L412CB controller myself?

1 REPLY 1
TDK
Guru

> 3) Is there some other dll with a description and example code so that I could write a program for flashing the STM32L412CB controller myself?

If you want to use the UART bootloader, you could make your own:

https://www.st.com/resource/en/application_note/cd00264342-usart-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

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