cancel
Showing results for 
Search instead for 
Did you mean: 

Bootloader inconsistant

MCocke.1
Associate

Hi Everybody,

I am trying to test out the boot-loader of the stm32l412 as a part of development for a product my company is making. For reasons unknown to me, the STM32cubeprogrammer (v2.10.0) can only sometimes program my MCU . I made a batch script that looks something like the following, and I run it in power-shell.

~~~~~~~~~~~~~~~ script start

echo off

if NOT .%1 == . goto ok
echo Error: specify Debug or Release
goto done

if NOT .%2 == . goto ok
echo Error: need com port as argument
goto done

:ok

C:\Users\mcocke\Desktop\WorkFiles\ProjectFiles\SomeFolder\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe -c port=%2 dtr=low rts=low br=115200 P=EVEN db=8 sb=1 -w C:\Users\mcocke\Desktop\WorkFiles\GithubRepos\OtherFolder\STM32L412CBU6\%1\STM32L412CBU6.elf 0x800000000 -V

:done

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ script end

My issue is that sometimes (I think 50% of the time on a good day) the programming works, and the other times I receive "Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again..." from the programmer CLI application. I am not power cycling anything, changing my script, or modifying anything, and yet I am not getting consistent results.

Any help would be appreciated!

Best,

Matthew Cocke

2 REPLIES 2

0x800000000 ??

I'm not sure you're going to get much ST side analysis using old versions of software, rather than fight issues that might have been fixed, move to the most current version, and test that.

The serial loader isn't very tolerant, it's mainly a once-and-done thing when the STM32 resets, if it fails expect to reset and try a second time. It will recognize other signal inputs as described in AN2606, so if other UART devices chirp at start up these may be selected based on the timing of the bit patterns. The 0x7F used for auto-bauding is measured by a TIM, it's not used as an actual input character.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Peter BENSCH
ST Employee

…and please upgrade to the most recent version of CubeProg.

By the way, you can install several versions of the CubeProg next to each other in corresponding folders (in Windows, for example, in C:\Program Files\STMicroelectronics\STM32Cubeprog2140) and start them independently. Only the CubeIDE currently insists on a fixed directory in which it expects the CubeProg. However, you can copy the most recent CubeProg directory to STM32Cubeprog in admin mode (or vice versa, use this to install and simply copy to a new one with the version number appended) and everything works in parallel.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.