How to write flash for CPU2 in STM32WB55CE using ST-Link?
- 3 replies
- 1452 views
Hello?
Likes title, I want to ask for writing method using ST-Link(SWD, 4000 kHz).
Problem is error at erasing stage. "Error : FUS_STATE_ERR_UNKNOWN"
(Version of STM32CubeProgrammer is 2.5.0, result of this UI also same.)
And, result of reading address '0x20030030' is 00000000.
Source is modified from Remi QUINTIN's(ST Employee) batch file in below link.
https://community.st.com/s/profile/0050X000007vjlkQAA
I'm using STM32WB5xxE(512K), address of FUS_fw is 0x0807A000(ver 1.0.2) and address of Stack_fw is 0x08057000(ver 1.3.1).
Apart from the above, CPU1(application code) seems to have no problem in operation.
Please review command sources.
Thank you.
S. Y. Lee
--------------------------------------------------------------------------------------------------
@echo off
SET PROG="C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe"
SET BIN_PATH=C:\Users\PC\STM32Cube\Repository\STM32Cube_FW_WB_V1.3.0\Projects\STM32WB_Copro_Wireless_Binaries\
SET APPLI_PATH=C:\Atollic\TEST_BLE1\Debug\
set comport=SWD
echo Connected with %comport%
REM Command list
SET S0=%PROG% -c port=%comport% -rdu
SET DOWNLOAD=%PROG%
REM FW list
SET RF_STACK_BIN=%BIN_PATH%stm32wb5x_BLE_Stack_fw.bin
SET FUS_BIN=%BIN_PATH%stm32wb5x_FUS_fw.bin
REM SET APPLI=%APPLI_PATH%TEST_BLE1.hex
REM list the port com
%PROG% -l
echo REMOVE read Out protection
REM This command removes the memory Read protection by changing the RDP level from level 1 to 0
%PROG% -c port=swd -rdu
echo read Out protection removed
echo current FUS version
%PROG% -c port=swd -r32 0x20030030 1
echo mode HOTPLUG
%PROG% -c port=swd mode=HOTPLUG -r32 0x20030030 1
REM Delete the RF stack located in the secure area.
REM The goal is to let more space for the donwload of the new FUS
echo delete RF stack
%PROG% -c port=SWD -fwdelete
REM FUS/Stack upgrade via Debug (STLINK) Interface :
echo FUS Upgrade :
%PROG% -c port=swd mode=UR -ob nSWboot0=0 nboot1=1 nboot0=1 -fwupgrade %FUS_BIN% 0x0807a000 firstinstall=1
timeout 5
echo new FUS version
%PROG% -c port=swd -r32 0x20030030 1
Stack install :
echo RF stack installation
%PROG% -c port=swd mode=UR -ob nSWboot0=0 nboot1=1 nboot0=1 -fwupgrade %RF_STACK_BIN% 0x08057000
timeout 3
REM User application install :
echo application programming
%PROG% -c port=swd mode=UR -d %APPLI% 0x08000000 -v
REM All these operations can be combined in one command :
%PROG% -c port=swd mode=UR -ob nSWboot0=0 nboot1=1 nboot0=1 -fwupgrade %FUS_BIN% 0x0807a000 firstinstall=1 -c port=swd mode=UR -fwupgrade %RF_STACK_BIN% 0x08057000 -c port=swd mode=UR -d %APPLI% 0x08000000 -v
echo RESET Board/button
pause
