K70 Tower system MQX, C++, GCC project running in DDR

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

K70 Tower system MQX, C++, GCC project running in DDR

1,340 Views
stephenchorlton
Contributor II

I am trying to create a CodeWarrior 10.4 project for K70 Tower system that runs in DDR memory using MQX 4.0, C++ and the GCC compiler.

I have created a project based on the settings used for the example cplus/cw10gcc.

This has the correct settings when the project is imported into Codewarrior.

I have then modified my code based on the advice given by Carlos_Musich in his reply to question K70 Tower System MQX Application in RAM

I have also modified the .ld file to place the code in DDR, but the code will not run from start up.

When set to free run it jumps to FLASH locations and crashes, but if I single step from the start past the initialisation of MQX the code runs OK.

Any suggestions on what might be going wrong.

Thanks in advance,

Steve

0 Kudos
4 Replies

522 Views
DavidS
NXP Employee
NXP Employee

Hi Stephen,

You might look at the KINETIS120_SC baremetal code that has example of using only the DDR for debugging an application.  A comparison of it might point out the issue.

Also wondering if it could be a caching issue depending on what address you are using for the DDR.  The SC code is using aliased 0x0800_0000 space and not the cached space at 0x7000_0000 (write-back) and 0x8000_0000 (write-through).  Single stepping might allow the cache to flush or clean up whereas free running doesn't.  Just tossing ideas out there.

Regards,

David

522 Views
stephenchorlton
Contributor II

Hi David,

Thanks for the reply, I have made some progress and have managed to get some code running in DDR.
When I remove the watchdog initialisation from the debugger .tcl file and after I fixed a bug in the linker(.ld) file the code will run in DDR. (The bug in the linker file was the uncached data area for MQX was overlapping the boot stack so when MQX was initialised the boot stack was getting corrupted).

I still have some issues with where the start up code should run. Freescale support have said that the boot code should not be run in DDR because of timing issues. I am in an ongoing discussion with Carlos Musich regarding this, but any other input regarding running GCC, C++ code in DDR on the K70 would be most welcome.

Regards,

Steve

0 Kudos

522 Views
slawoj
Contributor I

Currently I also stuck in that problem.

Stephen, could you explain what changes in the linker file should be done?

0 Kudos

522 Views
asmith
Contributor III

Can ypu provide more detail on your changes to the linker file or just attach it ?

0 Kudos