Howto run and debug the bare metal platform SDK on IMX6DL

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

Howto run and debug the bare metal platform SDK on IMX6DL

Jump to solution
2,752 Views
andreaskarlsson
Contributor III

Hi,

 

Task: I want to be able to run and debug bare metal code directly from DDR3 via trace32.

 

1. We have a Sabre SD rev C2 populated with an IMX6DL, MCIMX6DL-SDP.

2. I've test to run and debug imx6_platform_sdk_v1.1.0.tgz

3. I've ported tools\ds5\MX6DL_SabreSD_DDR3_v1.6.ds to trace32 syntax. Attached:  imx6DL_sabresd.cmm

 

To test:

4. I start trace32 and init the imx6DL via attached script

5. Load the Data.LOAD.Elf sdk_unit_test_ALL.elf built with CodeSourcey's Lite arm-eabi

6. I come to the _start label and can start single step

7. When singlestep and I reach startup.S code below (first branch instruction)  a bus error is generated

 

    @ check cpu id - cpu0 is primary cpu

    cmp     r5, #0

    beq     primary_cpu_init <-------------------------------  here a T32 "bus error generated by CPU" is generated

 

If I start the SDK without single stepping I get to the main test menu.

 

Question:

Is something else required to be able to rund and debug bare metal code? I power on the SBARESD without SD card present.

Is the DDR settings the same for MT41K128M16JT as for MT41J128M16HA-15E (script ref MT41J but MT41K is populated on the board according to the BOM) ?

 

 

 

Added ELF

Added file casuing the issue if someone got the time to try out on an MCIMX6DL card, prebuilt with CodeSorcery arm-eabi-lite and ./tools/build_sdk -t mx6sdl -b smart_device -v c

I can't single step beyond "0x1000074c beq"

 

Thanks for inout

Andreas

Original Attachment has been moved to: imx6DL_sabresd.cmm.txt.zip

Original Attachment has been moved to: sdk_unit_test_ALL.elf.zip

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
1,502 Views
andreaskarlsson
Contributor III

It was realy simple in the end, the cmm script opened a stack frame window in T32, that stack frame window performed a read of an illigal ram address causing a bus error getting generated by the CPU duing startup.

regards

Andreas

View solution in original post

0 Kudos
Reply
4 Replies
1,503 Views
andreaskarlsson
Contributor III

It was realy simple in the end, the cmm script opened a stack frame window in T32, that stack frame window performed a read of an illigal ram address causing a bus error getting generated by the CPU duing startup.

regards

Andreas

0 Kudos
Reply
1,502 Views
igorpadykov
NXP Employee
NXP Employee

Hi andreas

I have not trace32, but I would suggest to move .stacks section

to OCRAM, as done in

"running code in iram iRAM (OCRAM) i.MX6 SDK Application."

probably debugger uses stack when single stepping.

Do not think that new DDR settings needed, otherwise you would not be able

to reach to the main test menu without single stepping.

In any way SDK has simple DDR test and you can run it.

0 Kudos
Reply
1,502 Views
andreaskarlsson
Contributor III

Thanks for input, unfortunately it didn't help.

regards

Andreas

0 Kudos
Reply
1,502 Views
andreaskarlsson
Contributor III

I re-used the code from another post on running code in iram iRAM (OCRAM) i.MX6 SDK Application.

The iram code with a slightly modifed linker script runs OK and it is possible to single step through the exacte same startup.S code that fails in DDR. So there seems to be something not beeing correct setup for the DDR ram.

0 Kudos
Reply