cancel
Showing results for 
Search instead for 
Did you mean: 

How to write flash for CPU2 in STM32WB55CE using ST-Link?

SLee.20
Associate II

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

3 REPLIES 3
Remi QUINTIN
ST Employee

CLI.exe -c port=swd -r32 0x20030030 1 does not work for SWD port as the device information table is not located at this address when the SWD port is used for programming.

I assume a few lines have been uncommented, especially the last one with all the commands sent at once, which is absolutely useless if the previous commands were used.

Moreover the FUs should be loaded only once with the same version otherwise you may face some errors.

So please use the latest CubeWB FWacakge v1.9.

Then could you download the option byte to understand what is the current status of your chip.

mkrug
Associate III

Hi SLee,

did you finally manage to program your board? It looks like I'm facing the same issue but couldn't fix it yet.

Best Regards

Markus

No, I didn't.

I don't know what is problem.