FLash Sector 48 locked after a C40_ip flash programming. Impossible to download a Jtag elf

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

FLash Sector 48 locked after a C40_ip flash programming. Impossible to download a Jtag elf

跳至解决方案
4,620 次查看
FabioG
Contributor III

Hi there

I have done a program using C40_Ip RTD (placed in ramcode) in order to download a srec file in some BLOCK0 record of s32k310.

After the very first programming, Segger J.link tells that is unable to erase one of programmed sectors so it can't erase it and download code.

1) I have no Idea How it could be possible: all flash was ever locked and code I made do no do any explicit lock function.

2) I have tried to do  chip erases and sector erases but via J-Flash but erase is not possible because of te protected sector. How can explicit unpretect sector via Jtag/segger ?

 

Best Regards

Fabio

0 项奖励
回复
1 解答
4,425 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @FabioG,

1. I'm not sure if this PE Micro debugger is available in other IDEs.

2. This works for me:

danielmartynek_3-1749193818167.png

 

danielmartynek_1-1749193590485.png

Follow the Getting Started guide:

https://www.nxp.com/document/guide/getting-started-with-the-s32k31xevb-q100-evaluation-board-for-gen...

 

Check for PE Micro updates in the IDE.

Help -> S32DS Extensions and Updates

Help -> Install New Software

在原帖中查看解决方案

0 项奖励
回复
7 回复数
4,580 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @FabioG,

Can you share the log?

0 项奖励
回复
4,542 次查看
FabioG
Contributor III

have loaded Bootloader Code (JFLASH) and perform a C40_Ip_ClearLock (in ramcode) at power-on from sectors from C40_CODE_ARRAY_0_BLOCK_0_S016 to C40_CODE_ARRAY_0_BLOCK_0_S057 (inside s32k310 appl flash), then I read back with C40_Ip_GetLock and all sector are correctly. I also check this at runtime and nobody locks memory. When I try to flash program with JFLASH or Ozone, the verify fails because sector is locked ...but unlocking sector from code all is done correctly

0 项奖励
回复
4,544 次查看
FabioG
Contributor III

hi @danielmartynek

I apologize for the late,

In attached the logs you have requested:

You'll find three logs:

1) during programming code of the very first zone of FLASH (the boot sectors).

by using Segger Ozone v3.38d and Segger-Jlink: I was reprogramming the booloader sectors.

2) during a sector erasing process by using J-FLash v8.22 and Segger-Jlink

3) during a chip  erase by using J-FLash v8.22 and Segger-Jlink

I'm developing on s32K31XEVB devel-board. with a USB J-link Base connected to the external connector (I don't use the built in Jtag-chip).

 

Keep in mind that, during flash procedure, I was always checking that the address read from the srec file  are placed into  the right flash boundaries (lower/upper check), so the case that I write into flash registers are quite no possible.

Best Regards

Fabio

0 项奖励
回复
4,498 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @FabioG,

It does not make much sense to me. 

There is no option to permanently lock the sectors. 

The debugger should be able to reset the MCU and reprogram it.

 

The EVB has an on-board PE Micro debugger, can you test it?

 

Thank you

0 项奖励
回复
4,490 次查看
FabioG
Contributor III

Dear  @danielmartynek

I'm attempting to use onboard PE-micro Debugger.

1) Should It be integrated  only on S32DS or in other IDEs?

2) I have some difficulties to configure it on S32DS: 

which is the configuration parameters ? it attached the S32DS Tabs screenshots. I need to configure them but I not be able to connect

Can you give me some docs?

Best Regards

 


 

 
 
 
 
0 项奖励
回复
4,426 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @FabioG,

1. I'm not sure if this PE Micro debugger is available in other IDEs.

2. This works for me:

danielmartynek_3-1749193818167.png

 

danielmartynek_1-1749193590485.png

Follow the Getting Started guide:

https://www.nxp.com/document/guide/getting-started-with-the-s32k31xevb-q100-evaluation-board-for-gen...

 

Check for PE Micro updates in the IDE.

Help -> S32DS Extensions and Updates

Help -> Install New Software

0 项奖励
回复
4,511 次查看
FabioG
Contributor III

hi @danielmartynek,

some news now.

A newer error (attached .png file) happens:

Download fails (Ozone and J-Flash) because Jlink ramcode fails on  a particular algorithm and ramcode never-ends.

When I was able to download the bootloader code  (SWD)  it programs .srec file succesfully (via CAN bus)! so the problem should be on Jtag (in DTCM memory that Jflash uses for RAM code ? I tryed to move it on upper regions because lower ones are used by my application ,with no results....).

I tried to change Jlink usb debugger interface  but the problem does not disappear.

Unfortunately I have no other s32k31xEVB evaluation boards and no other s32310 stuff in order to check it  on them 

Best regards,

Fabio

0 项奖励
回复