MCUXpresso SDKv2.11 SDRAM example not working wth ARMGCC tools

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

MCUXpresso SDKv2.11 SDRAM example not working wth ARMGCC tools

Jump to solution
3,466 Views
yf2
Contributor III

Dear support,

I am learning i.MXRT MCUs with RT1170-EVK boards, I am using MCUXpresso SDK 2.11 on Ubuntu with ARMGCC 10.2. and CMake tools. My board has been set to boot from octal flash.

I have a very simple RTT demo program and I can build programs with different build types successfully.  

  • I can run program from "debug" build in a gdb session.
  • I can run program from "flexspi_nor_debug" build after board reset and I can see RTT logs. I can also run it in gdb session.

However, the program from "flexspi_nor_sdram_debug" build couldn't reach my "main()" function even inside a gdb session. I've attached the .elf program and my build and gdb session logs in "octal_sdram_err.bz2" for your review.

 

Regards,

yf2

 

 

 

 

Tags (1)
0 Kudos
Reply
1 Solution
3,335 Views
yf2
Contributor III

@kerryzhou 

Okay, I have created new ticket for SDKv2.12 and will close this ticket soon, please help to check that ticket.

 

Regards,

yf2

 

View solution in original post

0 Kudos
Reply
12 Replies
3,456 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yf2 ,

   Thanks for your new question post.

   To be honesty, I don't have the Ubuntu test platform.

   But I am familiar with the windows+RT1170+octal flash.

   About your RTT demo, do you use the SDRAM or not? If not, you don't need to add DCD area, if yes, you still need to add the DCD configuration, which is the SEMC configuration for the SDRAM.

   About your RTT demo, when need to download to the octal flash, you still need to modify the FCB to the octal flash, about the FCB related file, I already share with you in another post previously.

  So, now, I think, maybe you can generate the RTT demo .bin or srec file, and test it on the windows system, make sure that image is working with the octal flash, then you can switch to your Ubuntu system, as you are more familiar with Ubuntu system.

 

 

Best Regards,

Kerry

 

0 Kudos
Reply
3,440 Views
yf2
Contributor III

@kerryzhou 

My hello_rtt program is based on hello_world demo, the main difference is that hello_rtt doesn't use debug console but uses RTT console for logging.

During my learning process, I noticed that there are different linker descriptor files in armgcc/ folder:

$ ls *.ld
MIMXRT1176xxxxx_cm7_flexspi_nor.ld
MIMXRT1176xxxxx_cm7_flexspi_nor_sdram.ld
MIMXRT1176xxxxx_cm7_sdram.ld
MIMXRT1176xxxxx_cm7_sdram_txt.ld
MIMXRT1176xxxxx_cm7_ram.ld

From the CMake scripts file, I learnt that I have tried the first and last linker descriptors already with "debug" and "flexspi_nor_debug" built types. Then I wanted to try more build types.

From the rest linker descriptor file names,  I can see "sdram" is contained by all the rest three other linker files.

So even though my program doesn't explicitly require SDRAM, these linkers may require to use SDRAM. For example, maybe they want to map functions or global data of my program to SDRAM address space.

By default, my hello_rtt program doesn't require to use "dcd.c" but without it the linker complained that  "dcd_data" is undefined reference. So I tried two ways to resolve it:

  1. Modify build script to remove dependency to "dcd.c'. This led to a program which can be loaded but the startup_MIMXRT1176_cm7.S failed to enter the "main()" function. I guess that something is missing so that to let the startup knowing to use SDRAM.
  2. Add "dcd.c" to the program. This led to the issue as reported in this ticket.

So if you know any links or guides about how to build and run programs in SDRAM, please teach and I can see what to do from there.

Regards,

yf2

 

 

 

 

 

 

 

0 Kudos
Reply
3,438 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yf2 ,

  Please tell me, the SDK original hello_world demo work Ok or not on your side with DCD?

   If your  hello_rtt don't use the SDRAM, you can set the define:

XIP_BOOT_HEADER_DCD_ENABLE =0, then build the project again, it will without the DCD area for the SDRAM.

   You can check your code setting, whether this method works OK on your side or not.

Best Regards,

KERRY

0 Kudos
Reply
3,434 Views
yf2
Contributor III

@kerryzhou 

>>> Please tell me, the SDK original hello_world demo work Ok or not on your side with DCD?

My answer is no. You can confirm it with hello_world/cm77/armgcc/build_sdram_debug.bat script and see if the program can run with JLink.

Here it can't enter the main() function with JLinkGDBServerCL v7.66a.

 

Regards,

yf2

 

0 Kudos
Reply
3,428 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yf2 ,

   Thanks for your information.

   Ok, I get it, when I have time, I will establish the ARMGCC platform to test it. Recently, really a lot of cases in the queue to test.

   Now, could you please help to test this code:

\SDK_2_11_1_MIMXRT1170-EVK\boards\evkmimxrt1170\demo_apps\led_blinky

  Still the same, change FCB to octal flash which I told you, this project didn't add the SDRAM, whether it works on your side with JLINK or not?

  Just to confirm it.

Best Regards,

Kerry

0 Kudos
Reply
3,425 Views
yf2
Contributor III

Kerry

Yes,. the led_blinky demo app can be programed to cctal flash by JLink using your RT-URL-Kerry device driver and it can run well.

Regards,

yf2

0 Kudos
Reply
3,423 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yf2 ,

   Thanks good! So, it makes things a little easy now.

   To the helloworld, you can check the define, set this one in the complie define:

XIP_BOOT_HEADER_DCD_ENABLE =0,

  Then, it will help you commend the SDRAM related code, then it should also works like the led_blinky.

  If you don't need the SDRAM, just check it. For the build type, also use the same as the led_blinky instead of the sdram_debug.

  If you need the SDRAM, please also let me know.

Best Regards,

Kerry

0 Kudos
Reply
3,421 Views
yf2
Contributor III

@kerryzhou 

Actually I need all ARMGCC build types of hello_world app can work. There are five build types as I listed above, two build types (debug and flexspi_nor_debug) already work. The other three types (sdram, sdram_txt and nor_sdram) doesn't work now.

Since hello world is a part of the SDK release, it is better to work in all types so that we can learn more from it. The iled_blinky has less build types and its "sdram" build type doesn't work either.

So the problem seems to be like:

- "sdram" related ARMGCC build types can't build workable SDK sample apps.

 

I do need to explore the SDRAM usage so that to better understand the RT117x device. So please help when you are free later.

 

Regards,

yf 

0 Kudos
Reply
3,418 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yf2 ,

  Thanks for your information!

  Ok, clear, I will find time to establish the platform and test it.

 

Best Regards,

Kerry

 

0 Kudos
Reply
3,360 Views
yf2
Contributor III

@kerryzhou 

any updates on this?

 

Regards,

yf2

Tags (1)
0 Kudos
Reply
3,354 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yf2 ,

  I am so sorry for the later reply! It's my mistake to miss the testing, as recently, too many cases were in the testing queue.

   I will use the newest SDK 2.12.0 to test it these days.

  If you have time, please also try the newest SDK2.12.0, thanks.

   If it's OK could you please create a new question post about this post to continue it, and let me know, as we can't open one post so a long time.

  Thanks a lot for your understanding.

Best Regards,

Kerry

0 Kudos
Reply
3,336 Views
yf2
Contributor III

@kerryzhou 

Okay, I have created new ticket for SDKv2.12 and will close this ticket soon, please help to check that ticket.

 

Regards,

yf2

 

0 Kudos
Reply