2021-06-11 10:29 PM
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"?
2021-06-11 11:29 PM
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?
2021-06-12 05:51 AM
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.
2021-06-14 02:53 AM
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 :
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
2021-06-14 03:18 AM
Hi @JABRA.1 ,
For the second question the correct command to set OB is : -ob RDP = 0xAA .
Houda
2021-06-14 03:50 AM
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.
2021-06-14 04:07 AM
Hi @JABRA.1
Can you specify the MCU reference please? and if possible can you share the command line used for test?
Houda
2021-06-14 04:18 AM
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.
2021-06-14 04:39 AM
Hi,
You can start the application in the same command of download :
STM32_Programmer_CLI -c port=swd -w %1 0x08008000 -v -s
Houda
2021-06-14 05:07 AM
Wow! Many thanks. Will try and let you know in case there is a difficulty.
Regards,
John.