Preserve memory lead to debug fail

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

Preserve memory lead to debug fail

2,400 Views
ybb34713
Contributor II

  When I debug a Example flash_partitioning_s32k144 from SDK and debug configurations as illustrated in following figure.

D.png

无标题.png

Then IDE appeared pegdbserve_console.exe has stoped as following picture show.

无题.png

So, I was tried to fix it by update PEmcrio from Help->install new software->work with PEMicro - http://www.pemicro.com/eclipse/updates. After it installed done, things got worse when I tried to debug again.The GDB Server was not able to establish a connection to the target processor. And Flash an elf file also went wrong.

标题.png

I'm sure the PE drive and s32k144 EVB is all right. I tried to reinstall S32DS, but again, once you preserve memory and perform a debug , you have a problem. It's fine when you Flash with preserve memory.

题.png

0 Kudos
11 Replies

2,389 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @ybb34713,

Can you show the whole debug configuration?

How do you preserve the memory?

 

Thank you.

BR, Daniel

 

2,376 Views
ybb34713
Contributor II

Hi, @danielmartynek 

Now I have updated the post. I'm sorry that I missed relevant pictures before. Last time I reserved the DFlash memory, and today I will still have the same problem if I reserved the PFlash memory.

0 Kudos

2,339 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @ybb34713,

It seems like there is a bug in the PE Micro plugin.

Please read these two threads:

https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/EXAMPLE-S32K144-EEEPROM-usage-No-SDK/t...

https://community.nxp.com/t5/S32-Design-Studio/Pe-Micro-preserve-memory-bug/m-p/976739

I think you can just preserve the partitioning.

danielmartynek_0-1618229147190.png

In the example, the FlexNVM block is used for EEE Backup and it is not accessible anyway - it can be erased by Mass Erase only, and the debugger will not mass erase the MCU if the Preserve Partitioning for the device option is used.

 

Regards,

Daniel

 

 

0 Kudos

2,328 Views
ybb34713
Contributor II

Hi, @danielmartynek 

  First of all, thank you for your reply. I've seen the two threads you mentioned before, and they don't seem to solve the problem. I would like to share with you my test results and questions I would like to ask you.

1. Unfortunately, the DFLASH (all backed up as EEPROM) data will still be erased by testing if I just preserve the partitioning. 

  In the flash algorithm file freescale_s32k144f512m15_pflash_dflash_eeprom.arp, as shown in the figure below, you can see that the Mass Erase directive might have been used, but I'm not sure if it had anything to do with it.

Freescale算法文件.jpg

2. Surprisingly, if I just preserve the partitioning and used the Flash algorithm file nxp_s32k144f512m15_sector_erase.arp, the DFLASH data would not be erased. 使用nxp.jpg So I want to know the difference between nxp_s32k144f512m15_sector_erase.arp and freescale_s32k144f512m15_pflash_dflash_eeprom.arp and whether all projects can be downloaded programs or debugged by nxp_s32k144f512m15_sector_erase.arp.

3. Another discovery when using nxp_s32k144f512m15_sector_erase.arp is that if you use Non-Volatile Memory Preservation to preserve DFlash, the download program still has errors. I think this is probably the reason why you can only use FlexRAM to access it.
If the PFLASH is preserved (for example, 0x0007f000-0x0007ffff), it performs fine, downloads the program successfully and can read the data previously written to the PFLASH.Pflash保存.pngconsole-log.jpg

  In conclusion, If we can solve the problem with this,I want to confirm whether nxp_s32k144f512m15_sector_erase.arp can be used as freescale_s32k144f512m15_pflash_dflash_eeprom.arp

1.)  Is nxp_s32k144f512m15_sector_erase.arp the RTM version?

2.)  What is the difference between nxp_s32k144f512m15_sector_erase.arp and freescale_s32k144f512m15_pflash_dflash_eeprom.arp ? Why do you need to provide two Flash algorithms?

Looking forward to your reply.

 

Best wishes,

Bob

 

0 Kudos

2,317 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Bob,

I just tested it by changing the code of the example and even with the freescale_s32k144f512m15_pflash_dflash_eeprom.arp algorithm, the partitioning is preserved.

I read the SIM_FCFG1[DEPART] register.

If the partitioning is removed, DEPART == 0xF.

This is a PE Micro plugin and their algorithms, please contact PE Micro for more information.

http://www.pemicro.com/arm/device_support/NXP_Automotive/S32K1xx/S32K144F512M15/index.cfm

 

Thank you,

BR, Daniel

0 Kudos

2,300 Views
ybb34713
Contributor II

Hi Daniel,

    In my previous tests, the partitioning function was also fine, but the DFlash (all as E-Flash) retained data did not work properly, as mentioned in the first communication I suspect it was erased during the download process.

    At present, I am trying to contact PE Micro.

    Thank you for your positive reply.

    Bob

 

 

0 Kudos

2,279 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @ybb34713,

If the partitioning has been preserved (this can be verified in the DEPART register), the FlexNVM block is not erased. The FlexVNM block can be erased by Erase All Blocks / Mass erase only if the FlexNVM is partitioned for EEPROM, but this would remove the partitioning too.

So, If EEPROM backup size != 0, the FlexNVM is partitioned for EEPROM and the FlexNVM is not erased.

danielmartynek_0-1618831260136.png

The EEPROM is then ready (FlexRAM contains valid data) when EEERDY = 1.

 

Regards,

Daniel

0 Kudos

2,245 Views
ybb34713
Contributor II

Hi Daniel,

Sorry for replying so late.

1. Have you actully test on S32K144 EVB with freescale_s32k144f512m15_pflash_dflash_eeprom.arp?

2.Could you post your debug configuration interface if have fixed it?

 

 Regards,

 Bob

0 Kudos

2,220 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Bob,

Yes, I have tested it with freescale_s32k144f512m15_pflash_dflash_eeprom.arp and the partitioning was preserved (DEPART register).

I already posted the configuration I used in this thread.

 

Regards,

Daniel

0 Kudos

2,200 Views
ybb34713
Contributor II

Hi Daniel,

 This configuration, provided by you, ensures that FlexNVM(EEPROM) data will not be erased by simply checking Preserve Partitioning for the device and not preserving the memory range of FlexNVM?

danielmartynek_0-1618229147190(1).png

 

Regards,

Bob

0 Kudos

2,191 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Yes, because once the FlexNVM has been partitioned for EEPROM, the FlexNVM flash block is not accessible for the masters on the bus like the core or the debugger, the block is not mapped.

It can't be erased by the Erase Flash Sector FTFC command.

Only by Mass erase or Erase All Blocks FTFC command or by removing CSEc keys.

All the above mentioned operations, however, remove the partitioning.

So, in other words, if the partitioning (see DEPART) is not removed, the EEPORM backup (FlexNVM) is not erased either.

 

Regards,

Daniel

0 Kudos