Load application to MCUboot during Debug

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Load application to MCUboot during Debug

246 次查看
MassimilianoPegaso
Contributor II

Hello NXP Community,

I'm encountering an issue while trying to load an application to MCUboot during the debug process. Here are the steps I've taken and the problems I'm facing:

Steps Taken:

Post-Build Script:

I created a post-build script that signs the application.

Loading the Signed .bin File:

  • Initially, I attempted to load the signed .bin file using the GDB command load in the Debug configuration/Startup.
  • I tried placing the command in both the Initialization and Run command sections with the following syntax:

 

load path/file_signed.elf 0x60...​

 

To perform this task, I followed these articles:

Problems Encountered:

  • The code appears to be completely ignored. After starting the debug session, I checked the flash, and it was blank.
  • I'm not sure if there are issues with the GDB commands or the conversion process.

Alternative Method Tried:

  • I also tried using LinkServer, which worked, but I don't know how to run the script when I start the debug session.
  • I need the probe to remain unused and for the probe to be taken by GDB when I start the debug session. For the probe, I'm using an MCU-link.

Request for Assistance:

 

  • Could anyone provide guidance or any suggestions on correctly loading the signed .bin file using GDB during the debug process?

 

Thank you for your help!

Best regards,

标签 (1)
0 项奖励
回复
4 回复数

166 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @MassimilianoPegaso ,

Thanks for your interest in NXP MIMXRT series!
Frankly the operation you mentioned is not something that anyone has gone through internally to do something similar, nor is it a standardized process. But from your description, the whole workflow would be very elegant if it could be implemented. It's very interesting. I'm not sure if this will work but will give what you mentioned a try. Once you find something new please don't hesitate to discuss it with us.

Best regards,
Gavin

165 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @MassimilianoPegaso ,

Thanks for your patience!

Following the reference link you gave, I tested it locally. https://mcuoneclipse.com/2022/11/01/loading-multiple-binary-files-with-gdb/

It is possible to load the MCUBoot project using GDB. The operation is consistent with the documentation. Here are my test results for reference:

Gavin_Jia_0-1720000590687.pngGavin_Jia_1-1720000636040.png

 

Best regards,
Gavin

 

153 次查看
MassimilianoPegaso
Contributor II

Hi @Gavin_Jia,

I use an MCU-link as a debugger interface. To manually load the signed application, I use a command like this:

 

LinkServer.exe flash MIMXRT1052xxxxB:IMXRT1050_Refill load C:\application_signed.bin --addr 0x60100000

 

I need to specify the flash command because I need to load this application onto a custom board that uses a different flash memory than the EVK board.

It work, the problem is that I don't know how to run this code automatically in the IDE. I tried a solution like this:

Immagine 2024-07-03 173909.png

 

But it doesn't work; it seems that the command is completely ignored. I don't know how to check if the command reports an error when it is executed.

I tried various combinations of the command: I placed it in the initialization command section, in the run command section, and I tried the GDB version (like load data.bin.elf 0x70000). I attempted it with and without flash in front of it or on the previous line. Nothing changed; the load is never performed.

Immagine 2024-07-03 175316.png

As a completion, the initialization command section included this command:

 

set non-stop on
set pagination off
set mi-async
set remotetimeout 60000
##target_extended_remote##
set mem inaccessible-by-default ${mem.access}
mon ondisconnect ${ondisconnect}
set arm force-mode thumb
${load}

 

Best regards.

Massimiliano

0 项奖励
回复

126 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @MassimilianoPegaso ,

Thanks for your update.

I tried your procedure with similar results. Also, I tried adding scripts, and if there are errors in the commands in the scripts, the IDE points them out when running Debug and the operation is interrupted:

Gavin_Jia_0-1720165304134.png

 

So I think the commands in the script were actually executed successfully, except that in a subsequent operation, the IDE emptied the previous signed.bin file again. If you're just trying to burn it into flash and the command line succeeds, I don't think we actually need to stick to the IDE point-and-click-and-succeed approach.

It's perfectly fine to try writing scripts or executing it via the post-build command after compiling, after all, this operation doesn't require the IDE's debugging capabilities.

Best regards,
Gavin

0 项奖励
回复