AnsweredAssumed Answered

Run FreeRTOS on i.mx8m with small size of DRAM

Question asked by Richard Hu on Jun 17, 2019
Latest reply on Jun 28, 2019 by Shivani Patel
Branched to a new discussion

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

Outcomes