MCUXpresso SDK v2.12 SDRAM example not working wth ARMGCC tools

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

MCUXpresso SDK v2.12 SDRAM example not working wth ARMGCC tools

Jump to solution
2,409 Views
yf2
Contributor III

Dear support,

 

I am learning MCUxpresso SDK v2.12 with RT1170-EVK and ARMGCC toolchain. My host environment is Ubuntu 16 and my debug probe is the on-board JLink probe wiith JLink tools v7.66a.

It seems that I can successfully build the demo app "${SDK_D}/boards/evkmimxrt1170/demo_apps/led_blinky/cm7/armgcc/" using cmake with CMAKE_BUILD_TYPE=debug and run the demo on my rt1170-evk. I can see the led blinking and I can use gdb to debug the output elf correctly.

However, when I swtched the build type to "sdram_debug", I can generate elf output successfully but the app can't enter my main() function in gdb session, nor can I see LED blinking.

I am wondering if the example work when SDRAM is used?

Regards,

yf2

 

 

 

 

 

 

 

 

Tags (1)
0 Kudos
Reply
1 Solution
2,369 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I think you miss step 4.

jeremyzhou_0-1661328545830.png

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
8 Replies
2,390 Views
jeremyzhou
NXP Employee
NXP Employee


Hi,
I was wondering if you can list the steps you testing via screenshots, as I didn't encounter the phenomenon you mentioned.

TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
------------------------------------------------------------------------------

0 Kudos
Reply
2,388 Views
yf2
Contributor III

Hi,

Here are the steps I used:

$ cd ~/tmp/mcu/led
$ ARMGCC_DIR=/opt/armgcc/ cmake -DCMAKE_TOOLCHAIN_FILE=/opt/rt1170/tools/cmake_toolchain_files/armgcc.cmake /opt/rt1170/boards/evkmimxrt1170/demo_apps/hello_rtt/cm7/armgcc/ -DCMAKE_BUILD_TYPE=sdram_debug
-- TOOLCHAIN_DIR: /opt/armgcc/
-- BUILD_TYPE: sdram_debug
-- TOOLCHAIN_DIR: /opt/armgcc/
-- BUILD_TYPE: sdram_debug
-- The ASM compiler identification is GNU
-- Found assembler: /opt/armgcc//bin/arm-none-eabi-gcc
...
-- Generating done
-- Build files have been written to: /home/u/tmp/mcu/led
$ make
...
[100%] Built target iled_blinky_cm7.elf
$ gdb sdram_debug/iled_blinky_cm7.elf
(gdb) target remote pc:2331
(gdb) load
Loading section .interrupts, size 0x400 lma 0x0
Loading section .text, size 0x62b8 lma 0x400
Loading section .ARM, size 0x8 lma 0x66b8
Loading section .init_array, size 0x4 lma 0x66c0
Loading section .fini_array, size 0x4 lma 0x66c4
Loading section .data, size 0x64 lma 0x66c8
Start address 0x000004bc, load size 26412
Transfer rate: 117 KB/sec, 3773 bytes/write.
(gdb) break main
(gdb) c

 

My JLinkGDBServer runs at pc:2331 thus my gdb client connects to it to load the app to target and then run. but my break point can't be teached.

 

Regards,

yf2

 

 

0 Kudos
Reply
2,370 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I think you miss step 4.

jeremyzhou_0-1661328545830.png

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
2,363 Views
yf2
Contributor III

@jeremyzhou

 

Thanks for pointing it out.

 

I tried again with jlinkscriptfile= option but failed to connect to target. Please see attached log file for more details.

 

Regards,

yf2

0 Kudos
Reply
2,352 Views
yf2
Contributor III

@jeremyzhou 

I retried JLinkGDBServer in Wiindows, it can connect to target with the jlink script file successfuly and I can load sdram_debug type led_blinky to my target and enter breakpoint in main() function.

However, I found the app stucked in function "void SysTick_DelayTicks(uint32_t n)"....

I noticed the reason is that the variable g_systickCounter never reduces... guess the copy in cache was not written through to SDRAM...

Not sure if you have similar issue with LED blinky demo?

Regards,

yf2

0 Kudos
Reply
2,348 Views
jeremyzhou
NXP Employee
NXP Employee

Hi @yf2 ,
Thanks for your reply.
No, I didn't encounter the similar issue, on window OS, the demo works well in debugging.
frequency.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
2,390 Views
yf2
Contributor III

Thank you Kerry.

@jeremyzhou I just checked the cm7/armgcc/flags.cmake file and noticed that for SDRAM build type, a macro called "USE_SDRAM" is defined but it is not used in dcd.c. Thus I guess the output .elf doesn't contain DCD data.

I am looking forward to your investigation results.

 

 

 

0 Kudos
Reply
2,394 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yf2 ,

   Thanks so much for your new question post!

   After internal checking, my colleague @jeremyzhou has the related experience, so, he will help you to check it.

    Thanks for your cooperation!

 

Best Regards,

kerry

0 Kudos
Reply