Run FreeRTOS on i.mx8m with small size of DRAM

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

Run FreeRTOS on i.mx8m with small size of DRAM

1,546 Views
richard_hu
Contributor V

Hello, NXP technical support team:

We made a i.mx8M board with 3 kinds of DDR size: 1GB, 2GB and 3GB.

For the i.mx8M board with 1GB DDR, it can't run "rpmsg_lite_pingpong_rtos_linux_remote.bin"  in DDR (not TCM).

The McuXpresso SDK we use is "SDK_2.5.1_EVK-MIMX8MQ.tar.gz".

We follow the document: "Getting Started with MCUXpresso SDK i.MX 8M Devices.pdf" to load m4 binary into DDR.

• fatload mmc 0:1 0x80000000 rpmsg_lite_pingpong_rtos_linux_remote.bin
• dcache flush
• bootaux 0x80000000

Then it goes to reset.

U-Boot 2018.03-00127-g10286c6 (Jun 17 2019 - 01:37:25 -0700)
CPU:   Freescale i.MX8MQ rev2.0 1300 MHz (running at 800 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 54C
Reset cause: POR
DRAM:  1 GiB
MMC:   FSL_SDHC: 0
Loading Environment from MMC... OK
No panel detected: default to HDMI
Display: HDMI (1280x720)
In:    serial
Out:   serial
Err:   serial
BuildInfo:
  - ATF 1cb68fa
  - U-Boot 2018.03-00127-g10286c6
switch to partitions #0, OK
mmc0(part 0) is current device
flash target is MMC:0
Net:
Error: ethernet@30be0000 address not set.
No ethernet found.
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0
u-boot=> fatload mmc 0:1 0x80000000 rpmsg_lite_pingpong_rtos_linux_remote.bin
"Synchronous Abort" handler, esr 0x96000145
elr: 0000000040201784 lr : 000000004022a808 (reloc)
elr: 000000007ff13784 lr : 000000007ff3c808
x0 : 0000000080000000 x1 : 0000000080004e00
x2 : 0000000000000040 x3 : 000000000000003f
x4 : 000000000000000e x5 : 000000000000000e
x6 : 000000007ff7f0b0 x7 : 000000007ff7f0b0
x8 : 0000000000000010 x9 : 0000000000000002
x10: 0000000000000000 x11: 0000000000000006
x12: 000000000001869f x13: 000000007e90a38c
x14: 000000007e90a4a0 x15: 0000000000000002
x16: 0000000000001080 x17: 0000000000000000
x18: 000000007e911da0 x19: 0000000030b40000
x20: 000000007e90a038 x21: 000000007e913ed0
x22: 000000007e90a050 x23: 0000000030b40000
x24: 0000000008000810 x25: 000000007e914dd0
x26: 000000007ff8c56d x27: 0000000000000011
x28: 000000000000fff0 x29: 000000007e909f80
Resetting CPU ...

Then we notice the load address "0x80000000" is out of 1GB range.

So we modify the link script "MIMX8MQ6xxxJZ_cm4_ddr_ram.ld" in "rpmsg_lite_pingpong_rtos" example:

multicore_examples/rpmsg_lite_pingpong_rtos/linux_remote/armgcc/MIMX8MQ6xxxJZ_cm4_ddr_ram.ld

/* Specify the memory areas */
MEMORY
{
  m_interrupts          (RX)  : ORIGIN = 0x80000000, LENGTH = 0x00000240
  m_text                (RX)  : ORIGIN = 0x80000240, LENGTH = 0x001FFDC0
  m_data                (RW)  : ORIGIN = 0x80200000, LENGTH = 0x00200000
  m_data2               (RW)  : ORIGIN = 0x80400000, LENGTH = 0x00C00000
}

multicore_examples/rpmsg_lite_pingpong_rtos/linux_remote/board.c

    /* Select Region 2 and set its base address to the DDR start address. */
    MPU->RBAR = (0x80000000U & MPU_RBAR_ADDR_Msk) | MPU_RBAR_VALID_Msk | (2 << MPU_RBAR_REGION_Pos);

We modify the address from "0x80000000" to " 0x59000000 ".

multicore_examples/rpmsg_lite_pingpong_rtos/linux_remote/armgcc/MIMX8MQ6xxxJZ_cm4_ddr_ram.ld

/* Specify the memory areas */
MEMORY
{
  m_interrupts          (RX)  : ORIGIN = 0x59000000, LENGTH = 0x00000240
  m_text                (RX)  : ORIGIN = 0x59000240, LENGTH = 0x001FFDC0
  m_data                (RW)  : ORIGIN = 0x59200000, LENGTH = 0x00200000
  m_data2               (RW)  : ORIGIN = 0x59400000, LENGTH = 0x00C00000

multicore_examples/rpmsg_lite_pingpong_rtos/linux_remote/board.c

    /* Select Region 2 and set its base address to the DDR start address. */
    MPU->RBAR = (0x59000000U & MPU_RBAR_ADDR_Msk) | MPU_RBAR_VALID_Msk | (2 << MPU_RBAR_REGION_Pos);

Then we rebuild binary and run it again.

At this time, it doen't crash with following commands:

• fatload mmc 0:1 0x59000000 rpmsg_lite_pingpong_rtos_linux_remote.bin
• dcache flush
• bootaux 0x59000000

But i don't see any output from the M4 debug console.

It seems there is still something needs to be changed, or anything i'm doing is wrong?

BR,

Richard

Labels (1)
Tags (2)
0 Kudos
Reply
2 Replies

1,169 Views
shivanipatel
Senior Contributor II

Hi, Richard Hu

I have tried to reproduce the issue on i.MX8MQ EVK board. As i.MX8MQ EVK board has 3GB DDR, I have decrease the DDR size and then run the M4 application "rpmsg_lite_pingpong_rtos_linux_remote.bin" in DDR with below commands and I am able to run the application successfully.

  • fatload mmc 0:1 0x80000000 rpmsg_lite_pingpong_rtos_linux_remote.bin
  • dcache flush
  • bootaux 0x80000000

Can you please provide the DTS files (fsl-imx8mq-evk.dts, fsl-imx8mq-evk-m4.dts) to debug further?

Regards,

Shivani

0 Kudos
Reply

1,169 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Richard,

I internally escalated your request, and AE team has checked their environment as follows:

Settings in u-boot to run M4 binary are:

u-boot=> setenv m4_image audio_server.bin

u-boot=> setenv m4_loadaddr 0x7e0000

u-boot=> setenv load_m4_image "fatload mmc '${mmcdev}':'${mmcpart}' '${m4_loadaddr}' '${m4_image}'"

u-boot=> setenv run_m4_image "run load_m4_image; bootaux '${m4_loadaddr}'"

u-boot=> saveenv

Then use "run run_m4_image" to run the program.

Try if it works for you.


Hope this will be useful for you.
Best regards!
/Carlos
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
-------------------------------------------------------------------------------

0 Kudos
Reply