MIMXRT1170 - Crash when trying to copy program from FLASH to SRAM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MIMXRT1170 - Crash when trying to copy program from FLASH to SRAM

跳至解决方案
1,062 次查看
MichalKv
Contributor III

Hello,

I'm using MIMXRT1170-EVK board with the MIMXRT1176 MCU. I'm using both cores, CM7 is supposed to do some math, CM4 is supposed to handle things like communications, timers etc. I'm currently trying to move CM4 program into the SDRAM but I'm constantly running into problems.

The project is built on "hello_world" multicore example. I have one simple one (basically the example) where I followed this guide and everything seems like it's working. However when it comes to this project (which is old one converted into SDK 2.15.00 and built on "hello_world" project too) I can't go past copying data sections from FLASH to SRAM. It's the process that is happening in the `ResetISR()` right after `SystemInit()`. 

After some spent time on it, I have honestly no idea why it doesn't wanna work as the "simple" project.. And I'm pretty convinced I already checked every difference between these two projects. But somehow it's still not working and I can't figure out why since I already removed some custom libraries etc. so both of the projects are now "hello_world" projects where CM4 is moved into SDRAM.

 

The exact behaviour looks like this:

- Each of these memory segments are getting initialized just fine except the "SDRAM"

MichalKv_1-1709742371770.png

 

- When it comes to the SDRAM inside the `data_init()` function:

MichalKv_2-1709742429768.png

the `*pullSrc` is written only on the first address (aka 0x80000000) then it moves to address 0x80000004 and crashes. 

It looks to me like there's some write access violation or something like that but still I can't figure out what is the missing piece. Or where else to look.

I already checked the differences in:

  • All the project properties for each core
  • Debug configuration
  • `_Debug.ld` file

and everything looks pretty much fine.

 

Hope someone has an idea what am I doing wrong.

 

标签 (1)
0 项奖励
回复
1 解答
1,022 次查看
MichalKv
Contributor III

Well.. funny enough - I spent hours of trying to understand this whole "booting" procedure etc. to find out the defined macro should be DXIP_BOOT_HEADER_DCD_ENABLE and not DXIP_BOOT_HEADER_DCB_ENABLE .

I just randomly found this out while trying to compare each important file of the projects again. So it was a typo mistake this whole time..

Anyways thanks for your time and I'm going to buy some glasses I guess. 

在原帖中查看解决方案

3 回复数
1,041 次查看
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hi,

 

Please help me confirm the following:

  • You are using RT1170-EVK with a multi-core project
  • You are using SDK 2.15.000
  • Basically, what you are trying to do it to run the multicore hello_world using How to move CM4 core project to SDRAM in RT1176, am I right? But this is not working on your side

Regards,

Daniel.

0 项奖励
回复
1,036 次查看
MichalKv
Contributor III

Hello @DanielRuvalcaba,

to answer your questions:

  • You are using RT1170-EVK with a multi-core project  - Yes
  • You are using SDK 2.15.000 - Yes
  • Basically, what you are trying to do it to run the multicore hello_world using How to move CM4 core project to SDRAM in RT1176, am I right? But this is not working on your side - It's kinda more complicated than that:

In general - yes, I'm trying to run multicore hello_world project using the "moving" guide and it's not working on my side BUT I have one project that is working (pure hello_world multicore example + the moving implementation) and second one that isn't even due to the fact I followed the exact same guide, I made sure that the first project is, in properties/configuration, the exact same, the only difference is that there's much more SDK components included on the CM4 side. But to find out what's wrong I already commented each included library that is different from the original hello_world project but without any luck to find out what's wrong (as I would expect - if the library/component isn't used at all the compiler will just do nothing with them so they act like there's no additional component - but maybe that's the wrong idea since it might do something in the Config Tool? I'm pretty new to the whole MCUXpresso and NXP MCUs). 

When it comes to CM7 core, that's exactly the same - there should be no difference from the original hello_world example. But somehow this core is crashing when it comes to moving program from FLASH to SDRAM where the CM4 program should be (after this operation of course).

EDIT 1:

  • Debugger: J-link Segger Plus compact

After some debugging today I'm experiencing some weird behaviour and probably found the problem but don't know how is it caused. Basically I checked the memory (break right before writing to the 0x80000000 memory space (SDRAM)) and when it comes to the simple hello_world example it looks like that:

MichalKv_0-1709803728121.png

Everything seems fine to me, there're some data etc. so I guess that's fine. However when it comes to the main project, then it looks like this:

MichalKv_1-1709803815652.png

So it looks like the SDRAM isn't initialized. But there's still like 5-10% chance I get the `????????` value one the 0x30009560 address and further on when using Memory monitor (it might be just some IDE thing - or what scares me more the memory is never initialized and the saved values are somehow from previous debug session of the hello_world example - it goes to such a hard fault that I have to:

  • change onboard SW1 to - 0001
  • boot hello_world example
  • change ondboard SW1 to - 0010
  • begin another main project debugging ).

What's also weird is the `len` value (or even the adress value - it's the same thing) which shows that even when I commented the libraries and I'm not using anything more than hello_world example at the moment, the Main project is larger for almost 10kB. And since the `pulSrc` value is different before the SDRAM write, it means either (or these are the scenerious I can imagine):

  • ?? The commented libraries are still part of the project even tho noone uses them 
  • The CM7 part is the larger part of project even when it's coppied hello_world example - doesn't make any sense - I thought there might be something wrong with the memory setup and the sizes of memory space but it's the same for each project
  • The program starts at further FLASH address (which would be really strange bcs there should be nothing before - except the vectors etc.) - but I guess even in case the compiler for some reason move the program to further address it still shouldn't be a problem

About the SDRAM - I saw some articles about initializing SDRAM through the j-link script. I never tried one but also it can't get out of my head that the hello_world example isn't using one either and the SDRAM in hello_world project seems pretty initialized to me and according to the the CM4 debug picture shown below the CM4 part is in the SDRAM

MichalKv_0-1709806695295.png

but when I'm debugging the main project CM4 part (it gets stuck at MCMGR_EarlyInit() waiting for TX register to be empty) it still shows the reset vector at the almost same spot.. 

MichalKv_1-1709807112542.png

 

So.. I'm pretty much confused.

Best regards,

Michal.

0 项奖励
回复
1,023 次查看
MichalKv
Contributor III

Well.. funny enough - I spent hours of trying to understand this whole "booting" procedure etc. to find out the defined macro should be DXIP_BOOT_HEADER_DCD_ENABLE and not DXIP_BOOT_HEADER_DCB_ENABLE .

I just randomly found this out while trying to compare each important file of the projects again. So it was a typo mistake this whole time..

Anyways thanks for your time and I'm going to buy some glasses I guess.