MPC5748G Shared Memory Accross Core Only Works in Debug

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5748G Shared Memory Accross Core Only Works in Debug

ソリューションへジャンプ
1,508件の閲覧回数
EmbeddedS
Contributor I

Hi All,

I've created a project, that specifies a shared memory section in the flash across Core 0 (Z4_0) and Core 1 (Z4_1) of the MPC5748G development board.

I've configured LEDs PA10 and DS11 to represent Core 0 running properly. I've also configured LEDs PA7 and DS10 to represent Core 1 running properly. In Debug, there's no issue.

When i terminate the debug session and reconnect the board - my project fails.

If I comment out any shared memory section access, everything works in debug or standard.

What am i missing ? I've attached the project in this post.

0 件の賞賛
返信
1 解決策
1,449件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Ok, I expected that the elf files are up to date.

Anyway, it's caused by missing RAM initialization.

Core Z4_0 initializes first 256KB by its startup file:

lukaszadrapa_0-1743409795175.png

Core Z4_1 initializes  next 256KB:

lukaszadrapa_1-1743409825998.png

Remaining 256KB is usually initialized by Z2 core which is not present in your project... even if it is defined in project properties:

lukaszadrapa_2-1743409933768.png

 

So, you put shared_memory to those last 256KB:

lukaszadrapa_3-1743410041809.png

 But it's not initialized:

lukaszadrapa_4-1743410088327.png

If you use debugger in S32DS, it initializes whole RAM explicitly. If you run without debugger, it will crash on bus error when accessing uninitialized RAM.

You need to ensure that also this RAM is initialized.

Regards,

Lukas

 

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,493件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @EmbeddedS 

Was this code really working in debug mode?

I just load your elf files to my board (I didn't compile the projects again) and I can see that rxCAN is optimized out and it looks like the code in main.c does not correspond to elf file in the Z4_1 project.

Regards,

Lukas

0 件の賞賛
返信
1,481件の閲覧回数
EmbeddedS
Contributor I

This code definitely compiles and runs in debug mode.

Under "Z4_0 / Sources / shared_mem.c" rxCAN is defined as volatile. I may of commented out "rxCAN" the last time I compiled, for testing purposes. 

I've linked Z4_0's compiled shared_func and shared_mem ".o" files under Z4_1's project properties. This was a hardcoded path on my machine, so will need to be changed for another machine. 

When you reference the code in main.c, is this for Z4_0 or Z4_1? I've changed my boot order to Z4_0 first if this is what's causing confusion. 

0 件の賞賛
返信
1,450件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Ok, I expected that the elf files are up to date.

Anyway, it's caused by missing RAM initialization.

Core Z4_0 initializes first 256KB by its startup file:

lukaszadrapa_0-1743409795175.png

Core Z4_1 initializes  next 256KB:

lukaszadrapa_1-1743409825998.png

Remaining 256KB is usually initialized by Z2 core which is not present in your project... even if it is defined in project properties:

lukaszadrapa_2-1743409933768.png

 

So, you put shared_memory to those last 256KB:

lukaszadrapa_3-1743410041809.png

 But it's not initialized:

lukaszadrapa_4-1743410088327.png

If you use debugger in S32DS, it initializes whole RAM explicitly. If you run without debugger, it will crash on bus error when accessing uninitialized RAM.

You need to ensure that also this RAM is initialized.

Regards,

Lukas

 

0 件の賞賛
返信
%3CLINGO-SUB%20id%3D%22lingo-sub-2070249%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMPC5748G%E5%85%B1%E6%9C%89%E3%83%A1%E3%83%A2%E3%83%AA%20%E3%82%A2%E3%82%AF%E3%83%AD%E3%82%B9%20%E3%82%B3%E3%82%A2%E3%81%AF%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%A7%E3%81%AE%E3%81%BF%E6%A9%9F%E8%83%BD%E3%81%97%E3%81%BE%E3%81%99%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2070249%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%E7%9A%86%E3%81%95%E3%82%93%E3%80%82%3C%2FP%3E%3CP%3EMPC5748G%E9%96%8B%E7%99%BA%E3%83%9C%E3%83%BC%E3%83%89%E3%81%AE%E3%82%B3%E3%82%A20(Z4_0)%E3%81%A8%E3%82%B3%E3%82%A21(Z4_1)%E3%81%AB%E3%81%BE%E3%81%9F%E3%81%8C%E3%82%8B%E3%83%95%E3%83%A9%E3%83%83%E3%82%B7%E3%83%A5%E3%81%AE%E5%85%B1%E6%9C%89%E3%83%A1%E3%83%A2%E3%83%AA%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E6%8C%87%E5%AE%9A%E3%81%99%E3%82%8B%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CP%3ELED%20PA10%20%E3%81%A8%20DS11%20%E3%81%AF%E3%80%81%E3%82%B3%E3%82%A2%200%20%E3%81%8C%E6%AD%A3%E3%81%97%E3%81%8F%E5%8B%95%E4%BD%9C%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%81%93%E3%81%A8%E3%82%92%E7%A4%BA%E3%81%99%E3%82%88%E3%81%86%E3%81%AB%E6%A7%8B%E6%88%90%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E3%81%BE%E3%81%9F%E3%80%81LED%20PA7%20%E3%81%A8%20DS10%20%E3%81%AF%E3%80%81Core%201%20%E3%81%8C%E6%AD%A3%E3%81%97%E3%81%8F%E5%8B%95%E4%BD%9C%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%81%93%E3%81%A8%E3%82%92%E7%A4%BA%E3%81%99%E3%82%88%E3%81%86%E3%81%AB%E6%A7%8B%E6%88%90%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%A7%E3%81%AF%E3%80%81%E5%95%8F%E9%A1%8C%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3C%2FP%3E%3CP%3E%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%20%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E7%B5%82%E4%BA%86%E3%81%97%E3%81%A6%E3%83%9C%E3%83%BC%E3%83%89%E3%82%92%E5%86%8D%E6%8E%A5%E7%B6%9A%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%81%8C%E5%A4%B1%E6%95%97%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E5%85%B1%E6%9C%89%E3%83%A1%E3%83%A2%E3%83%AA%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E3%82%A2%E3%82%AF%E3%82%BB%E3%82%B9%E3%82%92%E3%82%B3%E3%83%A1%E3%83%B3%E3%83%88%E3%82%A2%E3%82%A6%E3%83%88%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%E3%81%99%E3%81%B9%E3%81%A6%E3%81%8C%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%BE%E3%81%9F%E3%81%AF%E6%A8%99%E6%BA%96%E3%81%A7%E6%A9%9F%E8%83%BD%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E4%BD%95%E3%81%8C%E8%B6%B3%E3%82%8A%E3%81%AA%E3%81%84%E3%81%AE%E3%81%A7%E3%81%99%E3%81%8B%3F%E3%81%93%E3%81%AE%E6%8A%95%E7%A8%BF%E3%81%AB%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%82%92%E6%B7%BB%E4%BB%98%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2070612%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20MPC5748G%20%E5%85%B1%E6%9C%89%E3%83%A1%E3%83%A2%E3%83%AA%20%E3%82%A2%E3%82%AF%E3%83%AD%E3%82%B9%20%E3%82%B3%E3%82%A2%E3%81%AF%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%A7%E3%81%AE%E3%81%BF%E6%A9%9F%E8%83%BD%E3%81%97%E3%81%BE%E3%81%99%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2070612%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E3%81%93%E3%81%AE%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AF%E3%80%81%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%20%E3%83%A2%E3%83%BC%E3%83%89%E3%81%A7%E7%A2%BA%E5%AE%9F%E3%81%AB%E3%82%B3%E3%83%B3%E3%83%91%E3%82%A4%E3%83%AB%E3%81%8A%E3%82%88%E3%81%B3%E5%AE%9F%E8%A1%8C%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E3%80%8CZ4_0%20%2F%20%E3%82%BD%E3%83%BC%E3%82%B9%20%2F%20shared_mem.c%E3%80%8D%E3%81%AE%E4%B8%8BrxCAN%E3%81%AFvolatile%E3%81%A8%E3%81%97%E3%81%A6%E5%AE%9A%E7%BE%A9%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%E3%83%86%E3%82%B9%E3%83%88%E7%9B%AE%E7%9A%84%E3%81%A7%E3%80%81%E6%9C%80%E5%BE%8C%E3%81%AB%E3%82%B3%E3%83%B3%E3%83%91%E3%82%A4%E3%83%AB%E3%81%97%E3%81%9F%E3%81%A8%E3%81%8D%E3%81%AB%E3%80%8CrxCAN%E3%80%8D%E3%82%92%E3%82%B3%E3%83%A1%E3%83%B3%E3%83%88%E3%82%A2%E3%82%A6%E3%83%88%E3%81%97%E3%81%9F%E3%81%8B%E3%82%82%E3%81%97%E3%82%8C%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3C%2FP%3E%3CP%3EZ4_0%E3%81%AE%E3%82%B3%E3%83%B3%E3%83%91%E3%82%A4%E3%83%AB%E3%81%95%E3%82%8C%E3%81%9Fshared_func%E3%82%92%E3%83%AA%E3%83%B3%E3%82%AF%E3%81%97%E3%80%81%20%22.o%22shared_mem%E3%81%97%E3%81%BE%E3%81%97%E3%81%9FZ4_1%E3%81%AE%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%83%97%E3%83%AD%E3%83%91%E3%83%86%E3%82%A3%E3%81%AE%E4%B8%8B%E3%81%AE%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%E7%A7%81%E3%81%AE%E3%83%9E%E3%82%B7%E3%83%B3%E3%81%A7%E3%81%AF%E3%83%8F%E3%83%BC%E3%83%89%E3%82%B3%E3%83%BC%E3%83%89%E3%81%95%E3%82%8C%E3%81%9F%E3%83%91%E3%82%B9%E3%81%A0%E3%81%A3%E3%81%9F%E3%81%9F%E3%82%81%E3%80%81%E5%88%A5%E3%81%AE%E3%83%9E%E3%82%B7%E3%83%B3%E3%81%AB%E5%A4%89%E6%9B%B4%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3Emain.c%E3%81%AE%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E5%8F%82%E7%85%A7%E3%81%99%E3%82%8B%E3%81%A8%E3%81%8D%E3%80%81%E3%81%93%E3%82%8C%E3%81%AFZ4_0%E7%94%A8%E3%81%A7%E3%81%99%E3%81%8B%E3%80%81%E3%81%9D%E3%82%8C%E3%81%A8%E3%82%82Z4_1%E7%94%A8%E3%81%A7%E3%81%99%E3%81%8B%3F%E3%81%93%E3%82%8C%E3%81%8C%E6%B7%B7%E4%B9%B1%E3%81%AE%E5%8E%9F%E5%9B%A0%E3%81%A8%E3%81%AA%E3%81%A3%E3%81%A6%E3%81%84%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AF%E3%80%81%E3%83%96%E3%83%BC%E3%83%88%E9%A0%86%E5%BA%8F%E3%82%92%E6%9C%80%E5%88%9D%E3%81%ABZ4_0%E3%81%AB%E5%A4%89%E6%9B%B4%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E