2025-05-14 2:33 AM - last edited on 2025-05-20 3:30 AM by Amel NASRI
Hi everyone,
I'm working on a project where I need to use a Nucleo-N657X0-Q board to run an AI model.
I generated the project using STM32CubeMX, setting up LPUART1 for communication and configuring it to have only the FSBL and a secure application. X-Cube-AI was selected to be part of the application.
I generated the project, compiled it, and set up the run configuration in STM32CubeIDE as follows:
The first file in the latter figure is a signed .bin file obtained according to the guide here: https://community.st.com/t5/stm32-mcus/how-to-debug-stm32n6-using-stm32cubeide/ta-p/800547
I set to download it at the origin address of the RAM (0x34000400).
For debugging, I added code in the FSBL to turn on the LEDs and print a message, and I noticed that the FSBL runs, but the application does not start (like if it hangs on the while loop auto-generated in the fsbl code:
/* Initialize USER push-button, will be used to trigger an interrupt each time it's pressed.*/
BSP_PB_Init(BUTTON_USER, BUTTON_MODE_EXTI);
/* Initialize COM1 port (115200, 8 bits (7-bit data + 1 stop bit), no parity */
BspCOMInit.BaudRate = 115200;
BspCOMInit.WordLength = COM_WORDLENGTH_8B;
BspCOMInit.StopBits = COM_STOPBITS_1;
BspCOMInit.Parity = COM_PARITY_NONE;
BspCOMInit.HwFlowCtl = COM_HWCONTROL_NONE;
if (BSP_COM_Init(COM1, &BspCOMInit) != BSP_ERROR_NONE)
{
Error_Handler();
}
/* Infinite loop */
/* USER CODE BEGIN WHILE */
BSP_LED_On(LED_BLUE);
BSP_LED_On(LED_RED);
//BSP_LED_On(LED_GREEN);
printf("FSBL running...\n\r");
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
Do you know what I might be doing wrong ?
Thanks in advance!
2025-05-20 8:17 AM
UPDATE:
I still can't manage to run the application in RAM using Execution in Place (XIP).
I'm testing with a simple program that turns LEDs on and off. The .ioc project and the resulting code are in the zip file attached.
I can see the blue LED blinking as defined in the FSBL and executed before the jump, but it seems that the jump to the application in memory doesn't occur. The green LED, which is supposed to blink as part of that application, never does.
I've double-checked the code, the linker script, and the parameters in the .ioc file multiple times, but I can't figure out what's wrong.
I attach also the OTP table in case you can see some sort of problem...
The outputs from the signing tool for the FSBL and the applictation, respectively, are the followings:
Header version 2.3 preparation...
Extracting Entry point value from the input file...
Entry point value : 0x701012bd
The headred image file generated successfully: Appli-trusted.bin
Header description:
Magic: 0x53544d32
Signature: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Checksum: 0x4ab76c
Header version: 0x20300
Size: 0xa540
Load address: 0xffffffff
Entry point: 0x701012bd
Image version: 0x0
Extension: 0x80000000
Pad header detected:
Type: 0x5354ffff
Size: 0x1a0
Padding values: 3b 59 cc 08 d4 6f 6e 71 74 47 49 0e 33 95 77 8b 7e 8e ad 16 0c 35 eb 60 26 31 38 d0 18 ad 8c
0c a1 d6 ea 3f 5d 50 b1 d9 71 95 e2 e3 c3 ab 3f 01 e2 6c d5 71 b7 21 93 72 c0 bd 14 51 37 4e
cb a0 10 33 eb 9d 4b 53 62 3d b1 25 4a 90 22 76 4f f4 a8 0e 29 1b 79 52 f3 40 89 b5 8e 82 2e
1f 32 aa 1a a4 74 12 f3 d0 18 d4 df 75 94 4f ab af d7 e9 6b 68 f9 15 6d eb 7a cb b9 60 73 cd
ba 94 57 c0 c4 99 7a 0c 46 e2 1a 57 4a 14 f1 b1 43 25 0e e6 5b f8 24 ba 98 c9 10 b3 b3 d9 08
fd 75 93 7f f7 17 e2 51 80 32 de d7 48 c2 ad 91 89 0f 11 89 a5 8d b4 8b 9d 1e 09 08 14 86 c1
a1 de 58 31 4c 6d 3f 6b 09 e4 61 e5 cc 5f 2c 98 81 b5 03 fa 76 db a8 2f 7e 01 96 f4 4a ba 0b
36 e5 5e 92 62 6c 92 03 2d b5 a9 7e 47 e5 30 e5 4b 66 dd ad 71 05 bf 94 55 a0 cb 5b a2 4e 79
74 42 36 f5 5a 9e 53 45 ab 61 78 6e 3f 32 23 47 d3 24 dc 83 23 32 5f 3c cf c1 31 ff ac 83 30
42 ea 7d ad 1a 5c 64 3c 8a 60 77 77 5f 9d e9 48 88 c4 3a 1b be 92 76 80 a9 69 13 3c a4 f1 e7
da 34 06 92 b7 cc 10 16 02 5c f7 2e 7a fb 52 de cc 79 2c 3d b5 e4 fa 02 10 4d 78 51 6d a1 1c
0a ce 7e 12 8c a8 24 56 a5 45 4b f6 c9 79 50 ee 0c 0b e3 65 49 8f 8c 5e 34 26 6e 8a db 60 cc
eb 66 54 62 c7 5c 0a 89 00 00 02 00 77 78 95 79 0b 0c 00 00 50 bd f4 04 18 01 00 00 f0 81 f4
04 18 01 00 00
Post header 2.3 information :
Binary type: 0x10
Non authenticated payload length: 0x0
Non authenticated payload hash: 0x0
Header version 2.3 preparation...
Extracting Entry point value from the input file...
Entry point value : 0x34181231
The headred image file generated successfully: FSBL-trusted.bin
Header description:
Magic: 0x53544d32
Signature: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Checksum: 0x683b81
Header version: 0x20300
Size: 0xed20
Load address: 0xffffffff
Entry point: 0x34181231
Image version: 0x0
Extension: 0x80000000
Pad header detected:
Type: 0x5354ffff
Size: 0x1a0
Padding values: 0d b8 7a ed 9e 5d aa 1f 55 74 fb b8 5c 52 a1 52 ee b0 7f 7d 6c 21 21 2a 50 e6 bf 1d b6 40 c2
64 44 bb 23 24 af 4a 1c 8b 9e a3 c7 72 6f da 6c 1e 09 83 51 10 61 19 19 e4 9a 6b 50 5e 62 34
b1 ac be fa 08 7f 01 06 65 6c 3b 1b ed 45 7e f4 0a 40 7a e0 73 4f 72 ae 2e bc b1 73 c1 e0 a5
71 af cc e1 6a e8 50 88 a3 88 c9 5b 8e 6c 9a 5d 43 ec 77 e6 f8 33 40 a4 81 e7 ed 0c 3c d6 0a
cd 7b fe b2 fb 83 41 ef 77 b9 32 a0 70 d9 e3 32 09 54 48 aa ab 4e a2 60 a9 2a 00 7c 04 e3 30
d8 12 07 13 30 f8 37 90 1a fe 88 de 08 31 6d b3 d3 b8 c9 cd 52 8e 8e cc 54 22 f6 59 ea 17 40
36 35 c0 92 bd a7 a7 cf f8 e7 a7 8a f2 ab e2 ae 2b 97 fd 5f ec a4 c8 a8 2c da 0a b5 33 8a a9
9a be 7d aa f8 56 8d ef 21 19 4c cc 77 0c 86 a5 d7 9f 03 12 5e be 35 7e 21 bf 92 89 c4 fa b6
62 1c 51 c9 cd cf 7e 5a e4 96 1e ff 65 c6 fb b5 94 50 1a 5e 8c 9d 92 59 13 17 c3 6a 08 f6 10
4e 18 53 7a 46 08 8e 71 59 f5 ec a5 66 b9 25 89 97 f3 24 5b d9 ff 2a c7 15 f0 95 98 67 8b a3
fa 01 d9 02 4b 15 12 f6 35 0b c1 13 45 a6 ad dd c1 ee e9 c8 dc db 4a b0 c7 94 be 93 c7 46 81
39 13 93 00 b7 3b 7f 97 3e 9f 7e aa 32 cb 65 82 1d 8c 26 d0 d1 bb f6 bb 8c f1 43 f1 9d 55 67
73 e7 b9 82 b7 5a de 77 00 00 02 00 7f 7e f9 cc 76 8e 00 00 40 b5 78 ca eb 01 00 00 f0 81 78
ca eb 01 00 00
Post header 2.3 information :
Binary type: 0x10
Non authenticated payload length: 0x0
Non authenticated payload hash: 0x0