STM32MP257F-EV1 The program of the new project of STM32CubeIDE CM33 is not working properly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-06-09 10:38 PM
I am programming the coprocessor (CM33) of STM32MP257F-EV1.
I prepared this with reference to Develop on Arm® Cortex®-M33 .
I built the sample program with MP32CubeIDE, transferred it to the target board (STM32MP257F-EV1), and it worked.
Next, create a new project in STM32CubeIDE for your target board.
[File -> New -> STM32 Project]
Select STM32MP257F-EV1 in the Board Selector of Target Selection.
I built the completed project and converted the resulting .elf to a binary file in OP-TEE? format using a python script.
[properties -> Setting -> Build Step]
arm-none-eabi-objcopy -S ${BuildArtifactFileBaseName}.elf ${BuildArtifactFileBaseName}_stripped.elf; python ../../../../Utilities/optee_os/scripts/sign_rproc_fw.py --in ${BuildArtifactFileBaseName}_stripped.elf --out ${BuildArtifactFileBaseName}_sign.bin --key ../../../../Utilities/optee_os/keys/default.pem --plat-tlv BOOTADDR 0x80100000
Copy the .bin to /lib/firmware on the target board and execute it.
Then, OpenSTLinux on the target board will HALT.
... # cat /sys/class/remoteproc/remoteproc0/firmware
rproc-m33-fw
... # echo hoge_oka_CM33_NonSecure_sign.bin > /sys/class/remoteproc/remoteproc0/firmware
... # cat /sys/class/remoteproc/remoteproc0/firmware
hoge_oka_CM33_NonSecure_sign.bin
... # cat /sys/class/remoteproc/remoteproc0/state
offline
... # echo start > /sys/class/remoteproc/remoteproc0/state
[ 166.422954] remoteproc remoteproc0: powering up m33
[ 166.434271] remoteproc remoteproc0: Booting fw image hoge_oka_CM33_NonSecure_sign.bin, size 24852
[ 166.4E/TC:1 stm32_iac_itr:192 IAC exceptions [159:128]: 0x10000000
*E/TC:0 stm32_serc_handle_ilac:133 SERC exceptions [63:32]: 0x8000000
*E/TC:1 stm32_iac_itr:197 IAC exception ID: 156
*E/TC:0 stm32_serc_handle_ilac:139 SERC exception ID: 59
*E/TC:1 Panic at /usr/src/debug/optee-os-stm32mp/4.0.0-stm32mp-r1/core/drivers/firewall/stm32_iac.c:212 <stm32_iac_itr>
E/TC:1 TEE load address @ 0x82000000
E/TC:1 Call stack:
E/TC:1 0x82007ed8
E/TC:1 0x82041b44
E/TC:1 0x8202c2c0
E/TC:1 0x8203f678
E/TC:1 0x82013cf4
I/TC: Halting CPU 0
I get the same result if I create and start a debug session in STM32CubeIDE
Please let me know if there are any tips or tricks for running a newly created project program in STM32CubeIDE.
By the way, if you remove some of the initialization code in main.c, OpenSTLinux on the target board seems to run without halting.
== main.c ==================================
/* Initialize all configured peripherals */
// MX_GPIO_Init();
// MX_ADC3_Init();
// MX_I2C1_Init();
MX_ICACHE_Init();
MX_RTC_Init();
// MX_UART5_Init();
// MX_USART6_UART_Init();
MX_UCPD1_Init();
/* USER CODE BEGIN 2 */
Host OS : Windows 11 Pro 24H2
Target Board STM32MP257F-EV1
STM32CubeIDE Version: 1.18.1
STM32CubeMP2 package V1.1.1 (STM32CubeMP2-main)
OpenSTLinux:
... # cat /etc/version
20241204105645
... # cat /etc/build
-----------------------
Build Configuration: |
-----------------------
BB_VERSION = 2.8.0
BUILD_SYS = x86_64-linux
NATIVELSBSTRING = universal
TARGET_SYS = aarch64-ostl-linux
MACHINE = stm32mp2
DISTRO = openstlinux-weston
DISTRO_VERSION = 5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.12.05
TUNE_FEATURES = aarch64 crc cortexa35
TARGET_FPU =
MANIFESTVERSION = ostl-v6.0-5-g97ef328d50dfc240c92d5fd62f9281a982494bf3
DISTRO_CODENAME = scarthgap
ACCEPT_EULA_stm32mp2 = 1
GCCVERSION = 13.%
PREFERRED_PROVIDER_virtual/kernel = linux-stm32mp
-----------------------
Layer Revisions: |
-----------------------
meta-python = v6.0.xml:1235dd4ed4a57e67683c045ad76b6a0f9e896b45
meta-oe = v6.0.xml:1235dd4ed4a57e67683c045ad76b6a0f9e896b45
meta-gnome = v6.0.xml:1235dd4ed4a57e67683c045ad76b6a0f9e896b45
meta-multimedia = v6.0.xml:1235dd4ed4a57e67683c045ad76b6a0f9e896b45
meta-networking = v6.0.xml:1235dd4ed4a57e67683c045ad76b6a0f9e896b45
meta-webserver = v6.0.xml:1235dd4ed4a57e67683c045ad76b6a0f9e896b45
meta-st-stm32mp = v6.0.xml:aa388978a9264ae59d3481e043ddf542f3562981
meta-st-openstlinux = v6.0.xml:fd3ef2feb59ad51694464eaa058b5c8fb1e24111
meta = v6.0.xml:236ac1b43308df722a78d3aa20aef065dfae5b2b
... #
Best regards.
okuno
- Labels:
-
STM32CubeIDE
-
STM32CubeMX
-
STM32MP25 Lines
