i.MX RT1160 loading Zephyr image using blhost

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX RT1160 loading Zephyr image using blhost

660 Views
danielberhe
Contributor IV

Hi All,

I'm currently successfully building and running the Zephyr project blinky sample on the imxrt1160 evk. I program the firmware to flash using Segger jlink and that happily works.

What I would now like to do is to get the Zephyr blinky app to run from the internal SRAM after being loaded using blhost over USB SDP.

- I've modified mimxrt1160_evk_cm7.dts chosen node to the following:

 

chosen {
  zephyr,sram = &dtcm; //&sdram0;
  zephyr,dtcm = &dtcm;
  zephyr,itcm = &itcm;
  zephyr,console = &lpuart1;
  zephyr,shell-uart = &lpuart1;
  zephyr,canbus = &flexcan3;
  zephyr,flash-controller = &is25wp128;
  zephyr,flash = &is25wp128;
  zephyr,code-partition = &slot0_partition;
  zephyr,cpu1-region = &ocram;
  zephyr,ipc = &mailbox_a;
};

 

- Modified mimxrt1160_evk/Kconfig.defconfig CODE_LOCATION:

 

choice CODE_LOCATION
  default CODE_ITCM
endchoice

 

- Made sure that the board is in SDP mode and verified by running blhost get-property:

 

$ ./blhost.exe -u 0x1fc9,0x013d -- get-property 1
Inject command 'get-property'
Response status = 0 (0x0) Success.
Response word 1 = 1258487809 (0x4b030001)
Current Version = K3.0.1

 

- I then loaded the blinky binary file using blhost but I don't see the blinking LED:

 

$ ./blhost.exe -u 0x1fc9,0x013d -- load-image zephyr.bin
Inject command 'load-image'
Preparing to send 35244 (0x89ac) bytes to the target.
(1/1)100% Completed!
Successful generic response to command 'load-image'
Response status = 0 (0x0) Success.
Response word 1 = 0 (0x0)
Wrote 35244 of 35244 bytes.

 

- looking at zephyr.bin (attached), I can see that the IVT is starting at offset 0x1000. Am I right in thinking that we want the IVT to be at offset 0?

- I came accross https://community.nxp.com/t5/i-MX-RT/mimxrt1024-EVK-flash-and-boot/m-p/1327990/highlight/true#M15997 but a lot of the blhost commands mentioned there (read-memory, write-memory, and execute) are returning 'kStatus_UnknownCommand'.

Can someone please help with this issue?

Thanks,

Daniel

Tags (1)
0 Kudos
4 Replies

596 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @danielberhe ,

It seems you want to save the code in flash and run in ITCM. But actually you image is still pure flash bass. You can see the application start address is 0x30003579, still in flash. It should be in ITCM, for example, 0x00003579. Then boot ROM will copy the image to ITCM.

jingpan_1-1696919880429.png

Moreover, the BOOT_IMAGE_BASE and BOOT_IMAGE_SIZE in g_boot_data structure should also be changed to ITCM.

 

Regards,

Jing

Tags (1)
0 Kudos

593 Views
danielberhe
Contributor IV

Hello Jing,

Thanks for your reply.

I don't want to store the image in flash. I would like to load it to the internal SRAM using SDP when the unit is powered on. The entirety of the image would reside in RAM.

Thanks,
Daniel

0 Kudos

587 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @danielberhe ,

1.The image must be compile to 0, not 0x30000000.

2. Then make a flashloader style binary like this.

jingpan_0-1696934882398.png

 

Regards,

Jing

 

0 Kudos

553 Views
danielberhe
Contributor IV

Hello Jing,

I will give this a go and report back. Thank you.

0 Kudos