OTA_S32K144_Use_Case_WS

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

OTA_S32K144_Use_Case_WS

Jump to solution
1,983 Views
HSByun
Contributor I

I’m a beginner of develop NXP product.

When I run the OTA_S32K144_Use_Case_WS Demo program in the AN12323 document using the S32K144 EVB Board, the following error occurs.

(The details of each error when executed on 2 sets of PCs with different OS environments are are as follows.)

I would like to be provided with a development environment that can operate normally and detailed explanations about the process or provided with the firmware (binary file) that runs normally.

I am looking forward to your help.

 

Environment:

  • Widows 7 32bit
  • S32 Design Studio for ARM
  • Version: 2018.R1
  • Build id: 180815
  • HSByun_0-1677480543021.png

     

     HSByun_1-1677480543135.png

     

     
  • HSByun_2-1677480543419.png

     

 

 

 

  • Widows 10 64 bit
  • S32 Design Studio for ARM
  • Version: 2.2
  • Build id: 200116
  • HSByun_3-1677480543552.png

     

     HSByun_4-1677480543920.png

     

  • HSByun_5-1677480544489.png

     

 

0 Kudos
Reply
1 Solution
1,842 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @HSByun 

as I can see on the first screenshot, the device is already partitioned but in different way than what is configured in S32K144_Memory_Partition_Debug_RAM. This example configures:

FTFC->FCCOB[6] = 0x0A; /* FCCOB5 = 0x0A, 16K data flash, 48k EEPROM backup */

But I can see in FCFG1 that whole FlexNVM is already allocated for EEPROM backup flash. So, someone obviously already enabled the Emulated EEPROM and maybe also CSEc on this device.

Step 1: Try to run mass erase (Erase All Blocks Unsecure command). You can add this code to project S32K144_Memory_Partition, to function configure_part_CSEc() before running partition comnmand:

 

while((FTFC->FSTAT & FTFC_FSTAT_CCIF_MASK) != FTFC_FSTAT_CCIF_MASK); /* Wait until any ongoing flash operation is completed */
FTFC->FSTAT = (FTFC_FSTAT_FPVIOL_MASK | FTFC_FSTAT_ACCERR_MASK); /* Write 1 to clear error flags */
FTFC->FCCOB[3] = 0x49; /* FCCOB0 = 0x49, Erase All Blocks Unsecure command */
FTFC->FSTAT = FTFC_FSTAT_CCIF_MASK; /* Start command execution by writing 1 to clear CCIF bit */
while((FTFC->FSTAT & FTFC_FSTAT_CCIF_MASK) != FTFC_FSTAT_CCIF_MASK); /* Wait until ongoing flash operation is completed */
flash_error_status = FTFC->FSTAT; /* Read the flash status register for any Execution Error */

 

If it is successful, it should work now. If not, the CSEc was obviously enabled. To remove the partition, you need to know MASTER_ECU_KEY. If you don't know it, you  need to use new device.

In case that example projects from application note AN5401 or from SDK were used, you can try to run:

1. Project 5_Resetting_flash_to_the_factory_state from AN5401:

https://www.nxp.com/webapp/Download?colCode=AN5401&location=null

https://www.nxp.com/webapp/Download?colCode=AN5401SW&location=null

2. This project from SDK:

c:\NXP\S32DS.3.4\S32DS\software\S32SDK_S32K1XX_RTM_4.0.2\examples\S32K144\driver_examples\system\csec_keyconfig\

... with this macro set to '1':

/* Set this macro-definition to 1 if you want to reset all the keys */
#define ERASE_ALL_KEYS 1

If one of these projects was used in the past with no modification of MASTER_ECU_KEY then this will disable the CSEc, so you can start over. If you are not successful with this, it will be necessary to use new device.

Regards,

Lukas

View solution in original post

0 Kudos
Reply
8 Replies
1,966 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @HSByun 

the projects from AN12323 were created in S32DS 2018 R1, so I would recommend to use this version. I did quick test on my side and I can successfully load this project to S32K144 EVB via OpenSDA.

Did you try to load another project to your board? Maybe you can create only new empty project in S32DS 2018 R1 to see if it is working.

Also I would recommend to update Pemicro drivers, I guess that this could help:

https://www.pemicro.com/downloads/download_file.cfm?download_id=53

Regards,

Lukas

0 Kudos
Reply
1,952 Views
HSByun
Contributor I

Hi, Lukas

Thank you for your kind help.

Unfortunately, When I run (click debug button) the program, I get the following error.

HSByun_0-1677590022042.png

 

    

HSByun_1-1677590022102.png

Could I receive the program that worked normally?

 

The hello_s32k144 project works normally.

(Blue LED turns on when SW2 on the EVB Board is pressed)

HSByun_2-1677590022178.png

 

 

Regards,

HSByun.

0 Kudos
Reply
1,943 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

There's obviously no problem with the project itself. The error message shows that there's some problem with data flash. Was CSEc enabled on your board? It could be the reason.

Also could you double check if this flash algorithm is selected in debug configuration?

lukaszadrapa_0-1677674095603.png

 

Regards,

Lukas

 

0 Kudos
Reply
1,911 Views
HSByun
Contributor I

Hi, Lukas

Thank you very much for your support.

How can I check if CSEc is enabled on my board?

I checked flash algorithm is selected in debug configuration.

HSByun_0-1677762271160.png

Regards,

HSByun.

0 Kudos
Reply
1,897 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @HSByun 

could you show me content of FCFG1 register? It's in SIM module.

And can you check end of FlexRAM memory? I mean address 0x1400_0FFF and lower. If CSEc is enabled, the end of FlexRAM is allocated for keys and then it's not visible in memory map - it's hidden and it can be accessed only by CSEc.

Regards,

Lukas

0 Kudos
Reply
1,858 Views
HSByun
Contributor I

Hi, Lukas

When S32K144_Memory_Partition_Debug_RAM is executed, the FCFG1 register value is as follows.

FCFG1 value is 0xFF 32 40 00

HSByun_0-1678074624080.png

 

End of FlexRAM memory could not be checked.

If you tell me how to check in more detail, I will check it.

Instead, it is said that 4KB is correct for the following data.

HSByun_1-1678074624344.png

 

HSByun_2-1678074624454.png

Regards,

HSByun.

0 Kudos
Reply
1,843 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @HSByun 

as I can see on the first screenshot, the device is already partitioned but in different way than what is configured in S32K144_Memory_Partition_Debug_RAM. This example configures:

FTFC->FCCOB[6] = 0x0A; /* FCCOB5 = 0x0A, 16K data flash, 48k EEPROM backup */

But I can see in FCFG1 that whole FlexNVM is already allocated for EEPROM backup flash. So, someone obviously already enabled the Emulated EEPROM and maybe also CSEc on this device.

Step 1: Try to run mass erase (Erase All Blocks Unsecure command). You can add this code to project S32K144_Memory_Partition, to function configure_part_CSEc() before running partition comnmand:

 

while((FTFC->FSTAT & FTFC_FSTAT_CCIF_MASK) != FTFC_FSTAT_CCIF_MASK); /* Wait until any ongoing flash operation is completed */
FTFC->FSTAT = (FTFC_FSTAT_FPVIOL_MASK | FTFC_FSTAT_ACCERR_MASK); /* Write 1 to clear error flags */
FTFC->FCCOB[3] = 0x49; /* FCCOB0 = 0x49, Erase All Blocks Unsecure command */
FTFC->FSTAT = FTFC_FSTAT_CCIF_MASK; /* Start command execution by writing 1 to clear CCIF bit */
while((FTFC->FSTAT & FTFC_FSTAT_CCIF_MASK) != FTFC_FSTAT_CCIF_MASK); /* Wait until ongoing flash operation is completed */
flash_error_status = FTFC->FSTAT; /* Read the flash status register for any Execution Error */

 

If it is successful, it should work now. If not, the CSEc was obviously enabled. To remove the partition, you need to know MASTER_ECU_KEY. If you don't know it, you  need to use new device.

In case that example projects from application note AN5401 or from SDK were used, you can try to run:

1. Project 5_Resetting_flash_to_the_factory_state from AN5401:

https://www.nxp.com/webapp/Download?colCode=AN5401&location=null

https://www.nxp.com/webapp/Download?colCode=AN5401SW&location=null

2. This project from SDK:

c:\NXP\S32DS.3.4\S32DS\software\S32SDK_S32K1XX_RTM_4.0.2\examples\S32K144\driver_examples\system\csec_keyconfig\

... with this macro set to '1':

/* Set this macro-definition to 1 if you want to reset all the keys */
#define ERASE_ALL_KEYS 1

If one of these projects was used in the past with no modification of MASTER_ECU_KEY then this will disable the CSEc, so you can start over. If you are not successful with this, it will be necessary to use new device.

Regards,

Lukas

0 Kudos
Reply
1,820 Views
HSByun
Contributor I
Hi Lukas
Thank you very much for your support so far.
After performing SDK, I checked that it works normally.
It's meant a lot to me.

Regards,
HSByun.
0 Kudos
Reply