You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am following the document below to build and flash the tfm_integration/tfm_ipc sample on the STM32L562E-DK Discovery board:
[STM32L562E-DK Discovery].
However, I encountered an error when running west flash, which uses the STM32CubeProgrammer runner for flashing the code.
Error Output:
(.venv) kurodash@ubuntu:~/zephyrproject/zephyr$ west flash
-- west flash: rebuilding
[0/15] Performing build step for'tfm'
ninja: no work to do.
[2/3] Performing install step for'tfm'
-- Install configuration: "MinSizeRel"
----- Installing platform NS -----
[3/3] Completed 'tfm'
-- west flash: using runner stm32cubeprogrammer
-------------------------------------------------------------------
STM32CubeProgrammer v2.18.0
-------------------------------------------------------------------
ST-LINK SN : 00380025313751XXXXXXXXXX
ST-LINK FW : V3J15M7
Board : STM32L562E-DK
Voltage : 3.28V
SWD freq : 8000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x472
Revision ID : Rev Z
Device name : STM32L5xx
Flash size : 512 KBytes (default)
Device type: MCU
Device CPU : Cortex-M33
BL Version : --
Opening and parsing file: tfm_merged.hex
Memory Programming ...
File : tfm_merged.hex
Size : 177.99 KB
Address : 0x0C000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 22]
Erasing memory corresponding to segment 1:
Erasing internal memory sector 31
Erasing memory corresponding to segment 2:
Erasing internal memory sectors [50 107]
Erasing memory corresponding to segment 3:
Erasing internal memory sectors [169 179]
Download in Progress:
Error: flash loader cannot be loaded.
Error: failed to download Segment[0]
Error: failed to download the File
FATAL ERROR: command exited with status 1: /home/kurodash/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI --connect 'port=swd reset=HWrst' --download /home/kurodash/zephyrproject/zephyr/build/zephyr/tfm_merged.hex --start
Commands Used:
west build -b stm32l562e_dk/stm32l562xx/ns samples/tfm_integration/tfm_ipc/
./build/tfm/api_ns/regression.sh
west flash
Running the following command manually works fine, but west flash fails:
STM32_Programmer_CLI --connect port=swd reset=HWrst --erase all
The board is correctly connected, and STM32_Programmer_CLI detects it without issues.
The samples/hello_world sample can be successfully flashed and executed.
west build completes successfully without errors.
west -vvv flash produces the following output:
=== Traceback (enabled by -vvv):
Traceback (most recent call last):
File "/home/kurodash/zephyrproject/.venv/lib/python3.12/site-packages/west/app/main.py", line 561, in run_command
self.run_extension(args.command, argv)
File "/home/kurodash/zephyrproject/.venv/lib/python3.12/site-packages/west/app/main.py", line 716, in run_extension
self.cmd.run(args, unknown, self.topdir, manifest=self.manifest,
File "/home/kurodash/zephyrproject/.venv/lib/python3.12/site-packages/west/commands.py", line 194, in run
self.do_run(args, unknown)
File "/home/kurodash/zephyrproject/zephyr/scripts/west_commands/flash.py", line 33, in do_run
do_run_common(self, my_args, runner_args, domain_file=domains_file)
File "/home/kurodash/zephyrproject/zephyr/scripts/west_commands/run_common.py", line 331, in do_run_common
prev_runner = do_run_common_image(command, user_args, user_runner_args, used_cmds,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kurodash/zephyrproject/zephyr/scripts/west_commands/run_common.py", line 506, in do_run_common_image
runner.run(command_name)
File "/home/kurodash/zephyrproject/zephyr/scripts/west_commands/runners/core.py", line 720, in run
self.do_run(command, **kwargs)
File "/home/kurodash/zephyrproject/zephyr/scripts/west_commands/runners/stm32cubeprogrammer.py", line 247, in do_run
self.flash(**kwargs)
File "/home/kurodash/zephyrproject/zephyr/scripts/west_commands/runners/stm32cubeprogrammer.py", line 301, in flash
self.check_call(cmd + flash_and_run_args)
File "/home/kurodash/zephyrproject/zephyr/scripts/west_commands/runners/core.py", line 864, in check_call
subprocess.check_call(cmd, **kwargs)
File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/kurodash/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI', '--connect', 'port=swd reset=HWrst', '--download', '/home/kurodash/zephyrproject/zephyr/build/zephyr/tfm_merged.hex', '--start']' returned non-zero exit status 1.
The regression.sh script appears to execute without errors.
(.venv) kurodash@ubuntu:~/zephyrproject/zephyr$ ./build/tfm/api_ns/regression.sh
regression script started
Regression to RDP 0 and tzen=1
-------------------------------------------------------------------
STM32CubeProgrammer v2.18.0
-------------------------------------------------------------------
ST-LINK SN : 00380025313751XXXXXXXXXX
ST-LINK FW : V3J15M7
Board : STM32L562E-DK
Voltage : 3.28V
SWD freq : 8000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x472
Revision ID : Rev Z
Device name : STM32L5xx
Flash size : 512 KBytes (default)
Device type: MCU
Device CPU : Cortex-M33
BL Version : --
UPLOADING OPTION BYTES DATA ...
Bank : 0x00
Address : 0x50022040
Size : 40 Bytes
[==================================================] 100%
Bank : 0x01
Address : 0x50022060
Size : 16 Bytes
[==================================================] 100%
PROGRAMMING OPTION BYTES AREA ...
Warning: Option Byte: rdp, value: 0xAA, was not modified.
Warning: Option Byte: tzen, value: 0x1, was not modified.
Warning: Option Bytes are unchanged, Data won't be downloadedTime elapsed during option Bytes configuration: 00:00:00.003Remove bank1 protection and erase all ------------------------------------------------------------------- STM32CubeProgrammer v2.18.0 -------------------------------------------------------------------ST-LINK SN : 00380025313751XXXXXXXXXXST-LINK FW : V3J15M7Board : STM32L562E-DKVoltage : 3.28VSWD freq : 8000 KHzConnect mode: Under ResetReset mode : Hardware resetDevice ID : 0x472Revision ID : Rev ZDevice name : STM32L5xxFlash size : 512 KBytes (default)Device type : MCUDevice CPU : Cortex-M33BL Version : --UPLOADING OPTION BYTES DATA ... Bank : 0x00 Address : 0x50022040 Size : 40 Bytes[==================================================] 100% Bank : 0x01 Address : 0x50022060 Size : 16 Bytes[==================================================] 100% PROGRAMMING OPTION BYTES AREA ...Warning: Option Byte: wrp1a_pend, value: 0x0, was not modified.Warning: Option Byte: wrp1a_pstrt, value: 0x7F, was not modified.Warning: Option Byte: wrp1b_pend, value: 0x0, was not modified.Warning: Option Byte: wrp1b_pstrt, value: 0x7F, was not modified. Bank : 0x00 Address : 0x50022040 Size : 40 BytesReconnecting...Reconnected !UPLOADING OPTION BYTES DATA ... Bank : 0x00 Address : 0x50022040 Size : 40 Bytes[==================================================] 100% Bank : 0x01 Address : 0x50022060 Size : 16 Bytes[==================================================] 100% OPTION BYTE PROGRAMMING VERIFICATION:Option Bytes successfully programmedTime elapsed during option Bytes configuration: 00:00:02.153Mass erase ... Mass erase successfully achievedRemove bank2 protection and erase all ------------------------------------------------------------------- STM32CubeProgrammer v2.18.0 -------------------------------------------------------------------ST-LINK SN : 00380025313751XXXXXXXXXXST-LINK FW : V3J15M7Board : STM32L562E-DKVoltage : 3.28VSWD freq : 8000 KHzConnect mode: Under ResetReset mode : Hardware resetDevice ID : 0x472Revision ID : Rev ZDevice name : STM32L5xxFlash size : 512 KBytes (default)Device type : MCUDevice CPU : Cortex-M33BL Version : --UPLOADING OPTION BYTES DATA ... Bank : 0x00 Address : 0x50022040 Size : 40 Bytes[==================================================] 100% Bank : 0x01 Address : 0x50022060 Size : 16 Bytes[==================================================] 100% PROGRAMMING OPTION BYTES AREA ...Warning: Option Byte: wrp2a_pend, value: 0x0, was not modified.Warning: Option Byte: wrp2a_pstrt, value: 0x7F, was not modified.Warning: Option Byte: wrp2b_pend, value: 0x0, was not modified.Warning: Option Byte: wrp2b_pstrt, value: 0x7F, was not modified. Bank : 0x01 Address : 0x50022060 Size : 16 BytesReconnecting...Reconnected !UPLOADING OPTION BYTES DATA ... Bank : 0x00 Address : 0x50022040 Size : 40 Bytes[==================================================] 100% Bank : 0x01 Address : 0x50022060 Size : 16 Bytes[==================================================] 100% OPTION BYTE PROGRAMMING VERIFICATION:Option Bytes successfully programmedTime elapsed during option Bytes configuration: 00:00:02.154Mass erase ... Mass erase successfully achievedRemove hdp protection ------------------------------------------------------------------- STM32CubeProgrammer v2.18.0 -------------------------------------------------------------------ST-LINK SN : 00380025313751XXXXXXXXXXST-LINK FW : V3J15M7Board : STM32L562E-DKVoltage : 3.28VSWD freq : 8000 KHzConnect mode: Hot PlugReset mode : Software resetDevice ID : 0x472Revision ID : Rev ZDevice name : STM32L5xxFlash size : 512 KBytes (default)Device type : MCUDevice CPU : Cortex-M33BL Version : --UPLOADING OPTION BYTES DATA ... Bank : 0x00 Address : 0x50022040 Size : 40 Bytes[==================================================] 100% Bank : 0x01 Address : 0x50022060 Size : 16 Bytes[==================================================] 100% PROGRAMMING OPTION BYTES AREA ...Warning: Option Byte: hdp1_pend, value: 0x0, was not modified.Warning: Option Byte: hdp1en, value: 0x0, was not modified.Warning: Option Byte: hdp2_pend, value: 0x0, was not modified.Warning: Option Byte: hdp2en, value: 0x0, was not modified.Warning: Option Bytes are unchanged, Data won't be downloaded
Time elapsed during option Bytes configuration: 00:00:00.003
Set default OB 1 (dual bank, swap bank, sram2 reset, secure entry point, bank 1 full secure)
-------------------------------------------------------------------
STM32CubeProgrammer v2.18.0
-------------------------------------------------------------------
ST-LINK SN : 00380025313751XXXXXXXXXX
ST-LINK FW : V3J15M7
Board : STM32L562E-DK
Voltage : 3.28V
SWD freq : 8000 KHz
Connect mode: Hot Plug
Reset mode : Software reset
Device ID : 0x472
Revision ID : Rev Z
Device name : STM32L5xx
Flash size : 512 KBytes (default)
Device type: MCU
Device CPU : Cortex-M33
BL Version : --
UPLOADING OPTION BYTES DATA ...
Bank : 0x00
Address : 0x50022040
Size : 40 Bytes
[==================================================] 100%
Bank : 0x01
Address : 0x50022060
Size : 16 Bytes
[==================================================] 100%
PROGRAMMING OPTION BYTES AREA ...
Warning: Option Byte: dbank, value: 0x1, was not modified.
Warning: Option Byte: secbootadd0, value: 0x180030, was not modified.
Warning: Option Byte: sram2_rst, value: 0x0, was not modified.
Warning: Option Byte: swap_bank, value: 0x0, was not modified.
Bank : 0x00
Address : 0x50022040
Size : 40 Bytes
Reconnecting...
Reconnected !
UPLOADING OPTION BYTES DATA ...
Bank : 0x00
Address : 0x50022040
Size : 40 Bytes
[==================================================] 100%
Bank : 0x01
Address : 0x50022060
Size : 16 Bytes
[==================================================] 100%
OPTION BYTE PROGRAMMING VERIFICATION:
Option Bytes successfully programmed
Time elapsed during option Bytes configuration: 00:00:02.153
Set default OB 2 (bank 2 full secure)
-------------------------------------------------------------------
STM32CubeProgrammer v2.18.0
-------------------------------------------------------------------
ST-LINK SN : 00380025313751XXXXXXXXXX
ST-LINK FW : V3J15M7
Board : STM32L562E-DK
Voltage : 3.28V
SWD freq : 8000 KHz
Connect mode: Hot Plug
Reset mode : Software reset
Device ID : 0x472
Revision ID : Rev Z
Device name : STM32L5xx
Flash size : 512 KBytes (default)
Device type: MCU
Device CPU : Cortex-M33
BL Version : --
UPLOADING OPTION BYTES DATA ...
Bank : 0x00
Address : 0x50022040
Size : 40 Bytes
[==================================================] 100%
Bank : 0x01
Address : 0x50022060
Size : 16 Bytes
[==================================================] 100%
PROGRAMMING OPTION BYTES AREA ...
Bank : 0x01
Address : 0x50022060
Size : 16 Bytes
Reconnecting...
Reconnected !
UPLOADING OPTION BYTES DATA ...
Bank : 0x00
Address : 0x50022040
Size : 40 Bytes
[==================================================] 100%
Bank : 0x01
Address : 0x50022060
Size : 16 Bytes
[==================================================] 100%
OPTION BYTE PROGRAMMING VERIFICATION:
Option Bytes successfully programmed
Time elapsed during option Bytes configuration: 00:00:02.154
regression script Done
Any insights on resolving this issue would be appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am following the document below to build and flash the
tfm_integration/tfm_ipc
sample on the STM32L562E-DK Discovery board:[STM32L562E-DK Discovery].
However, I encountered an error when running
west flash
, which uses the STM32CubeProgrammer runner for flashing the code.Error Output:
Commands Used:
Running the following command manually works fine, but
west flash
fails:Environment Details:
Additional Notes:
STM32_Programmer_CLI
detects it without issues.samples/hello_world
sample can be successfully flashed and executed.west build
completes successfully without errors.west -vvv flash
produces the following output:regression.sh
script appears to execute without errors.Any insights on resolving this issue would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions