cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Auto mode with STM32CubeProgrammer v2.7.0

JABRA.1
Associate II

I have just started using STM32CubeProgrammer v2.7.0 and I liked the simple and great looking UI over the other programmers. Now I would like to use Automatic mode and expect the following:

Erase the Read Out Protection (RDP) in OB or set it to "AA"

Full chip erase

Download the file

Verify

Set the Read Out Protection (RDP) in OB to "BB"

Can I do that? If yes how?

Also could you please help me understand the OB command to set the Read Out Protection (RDP) in OB to "BB"?

9 REPLIES 9
JABRA.1
Associate II

Please forgive me, I forgot to mention that I could automate the flashing when the devices were not set to RDP=BB. What can I do with the automatic mode if the devices have already set to "BB"?

In other words, like other programmers can STM32CubeProgrammer first erase the RDP, erase full chip, download and set the RDP=BB in automatic mode?

TDK
Guru

Not sure if it's possible or not. One alternative would be to use the command-line interface using a few different command, the first being to switch RDP=AA. Could be placed in a batch file.

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

Hi @JABRA.1​ ,

Thanks for this interesting feedback !

Actually, it is not possible to do a whole scenario with successive program /modifying Ob operations as the Option bytes will be applied after the program done.

CubeProgrammer always program data first the modify OB.

But your scenario is very interesting ,I share it with CubeProgrammer development team and the confirm it is important amelioration to implement in the future.

For the moment I can propose :

  • To write a script with all steps using the CLI as mentioned by @TDK​ 
  • You can also do it using automatic mode but in two steps :

1.First step Erase the Read Out Protection (RDP) in OB or set it to "AA"

2.Second step : Full chip erase ==>Download the file ==>Verify==> Set the Read Out Protection (RDP) in OB to "BB" .

Hope this helps you.

If your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Houda

Houda GHABRI
ST Employee

Hi @JABRA.1​ ,

For the second question the correct command to set OB is : -ob RDP = 0xAA .

Houda

JABRA.1
Associate II

Many thanks Houda for the detailed replies. I have already tried the script and it works. However the command line could not successfully run the application with the command --start, -s, --go or -g.

I have been using J-Link for years and it has the same facility. When you automate, it first erases the OB, erase, write, verify and finally set the OB. This helps a lot when you flash the chips on production basis. Not always the chips are fresh so erasing OB at the first place helps.

Also as I mentioned the UI is very friendly and good looking, hence I would prefer UI over the script provided it first erases the OB.

Regards,

John.

Houda GHABRI
ST Employee

Hi @JABRA.1​ 

Can you specify the MCU reference please? and if possible can you share the command line used for test?

Houda

JABRA.1
Associate II

Houda, I am pleased with the prompt support. The commands are as follows:

::put to level 0

STM32_Programmer_CLI -c port=swd mode=UR -ob RDP=0xAA

::erase full

STM32_Programmer_CLI -c port=swd mode=UR -e all

:: download file with verification.

STM32_Programmer_CLI -c port=swd -w %1 0x08008000 -v

:: --start 0x08000000 This will start the application. Didn't work

STM32_Programmer_CLI -c port=swd --start 0x08000000

Tried all four options but it didn't work. The chip is STM32L053C8T6.

Regards,

John.

Houda GHABRI
ST Employee

Hi,

You can start the application in the same command of download :

STM32_Programmer_CLI -c port=swd -w %1 0x08008000 -v -s

Houda

JABRA.1
Associate II

Wow! Many thanks. Will try and let you know in case there is a difficulty.

Regards,

John.