No index returned when writing user key to P-NUCLEO-WB55
I am trying to write a user key to CKS on a P-NUCLEO-WB55 using either STM32CubeProgrammer or STM32_Programmer_CLI and the SWD interface. I am able to start the FUS no problem, as shown here:
C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe -c port=swd -startfus
-------------------------------------------------------------------
STM32CubeProgrammer v2.10.0
-------------------------------------------------------------------
ST-LINK SN : 0661FF3837334D4E43124615
ST-LINK FW : V2J40M27
Board : P-NUCLEO-WB55
Voltage : 3.27V
SWD freq : 4000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x495
Revision ID : Rev Y
Device name : STM32WB5x
Flash size : 1 MBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : 0xd5
Debug in Low Power mode enabled
Warning: Option Byte: nSWboot0, value: 0x0, was not modified.
Warning: Option Byte: nboot0, value: 0x1, was not modified.
Warning: Option Byte: nboot1, value: 0x1, was not modified.
Warning: Option Bytes are unchanged, Data won't be downloaded
Time elapsed during option Bytes configuration: 00:00:00.003
Succeeded to set nSWboot0=0 nboot1=1 nboot0=1
Memory Programming ...
Opening and parsing file: 0x495_FUS_Operator.bin
File : 0x495_FUS_Operator.bin
Size : 8.00 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
Download in Progress:
██████████████████████████████████████████████████ 100%
File download complete
Time elapsed during download operation: 00:00:00.302
Application is running, Please Hold on...
Reconnecting...
Reconnected !
Reconnecting...
Reconnected !
StartFus activated successfully
FUS_STATE_IDLE
startfus command execution finishedAnd I can verify the FUS version:
C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe -c port=swd mode=UR -r32 0x20010010 1
-------------------------------------------------------------------
STM32CubeProgrammer v2.10.0
-------------------------------------------------------------------
ST-LINK SN : 0661FF3837334D4E43124615
ST-LINK FW : V2J40M27
Board : P-NUCLEO-WB55
Voltage : 3.26V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x495
Revision ID : Rev Y
Device name : STM32WB5x
Flash size : 1 MBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : 0xd5
Debug in Low Power mode enabled
Reading 32-bit memory content
Size : 4 Bytes
Address: : 0x20010010
0x20010010 : 01020000However, when I try to program a user key, the software is not returning a key index as expected:
C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe -c port=swd -wusrkey \Users\Michael\Desktop\OEM_KEY_COMPANY1_key_AES_CBC.bin keytype=1
-------------------------------------------------------------------
STM32CubeProgrammer v2.10.0
-------------------------------------------------------------------
ST-LINK SN : 0661FF3837334D4E43124615
ST-LINK FW : V2J40M27
Board : P-NUCLEO-WB55
Voltage : 3.27V
SWD freq : 4000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x495
Revision ID : Rev Y
Device name : STM32WB5x
Flash size : 1 MBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : 0xd5
Debug in Low Power mode enabled
Key File path : \users\michael\desktop\oem_key_company1_key_aes_cbc.bin
Write user key in memory process started ...
Warning: Option Byte: nSWboot0, value: 0x0, was not modified.
Warning: Option Byte: nboot0, value: 0x1, was not modified.
Warning: Option Byte: nboot1, value: 0x1, was not modified.
Warning: Option Bytes are unchanged, Data won't be downloaded
Time elapsed during option Bytes configuration: 00:00:00.003
Succeeded to set nSWboot0=0 nboot1=1 nboot0=1
Memory Programming ...
Opening and parsing file: 0x495_FUS_Operator.bin
File : 0x495_FUS_Operator.bin
Size : 8.00 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
Download in Progress:
██████████████████████████████████████████████████ 100%
File download complete
Time elapsed during download operation: 00:00:00.301
Application is running, Please Hold on...
Reconnecting...
Reconnected !
wUsrkey command execution finishedI was expecting output more like this (pulled from another post:(
Write user key in memory process started ...
FUS state is FUS_IDLE
FUS status is FUS_NO_ERROR
Writing key in memory ...
write user key in memory returned the following key index 0x3
write key in memory process finished
Write user key in memory command execution finishedAt this point, I'm unsure if the command completed successfully at all, or if it's just that the new version of the interface doesn't return the key index. If the latter is the case, how can I determine the key index for use in my software?
Thank you!
Michael
