How to program UTEST when installing HSE on S32K358

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

How to program UTEST when installing HSE on S32K358

189 Views
MarkFan
Contributor III

Hi ,

Background:
I successfully ran the S32K344_HSE_FW_INSTALL demo project and was able to program the UTEST area on the S32K344 using the PFLASH driver.

Example (S32K344):

/* Unlock UTEST data flash sector */
PFLASH_Unlock(PFLASH_BL5, PFLASH_SS0, PFLASH_S0);

/* Write in UTEST sector using main interface */
status = FLASH_Write((uint32_t*)UTEST_BASE_ADDRESS,
hseFwFeatureFlagEnabledValue,
sizeof(hseFwFeatureFlagEnabledValue));


Steps Tried on S32K358:
When moving to the S32K358, I switched to the C40 driver. The code I tried looks like this:

if (STATUS_C40_IP_SECTOR_PROTECTED == C40_Ip_GetLock(FLS_MAX_VIRTUAL_SECTOR)) {
C40_Ip_ClearLock(FLS_MAX_VIRTUAL_SECTOR, FLS_MASTER_ID);
}

C40_Ip_MainInterfaceWrite(UTEST_BASE_ADDRESS,
sizeof(hseFwFeatureFlagEnabledValue),
(uint8 *)(hseFwFeatureFlagEnabledValue),
FLS_MASTER_ID);

#define C40_UTEST_ARRAY_0_S000 (1040U) /* 0x1B000000 */

#define FLS_MAX_VIRTUAL_SECTOR 1039;


Issue:

On S32K358, I cannot find a clear mapping for C40_UTEST_ARRAY_0_S000.

Currently, the UTEST sector seems to be identified as FLS_MAX_VIRTUAL_SECTOR (1039), but I am unsure if this is correct.

The write operation to UTEST does not succeed.

Question:

What is the correct way to use the C40 driver API to program the UTEST area on S32K358?

Is there a specific configuration or sector mapping required for UTEST on S32K358 that differs from S32K344?

Thanks in advance for your support.

Best regards,
Mark

     

   

0 Kudos
Reply
3 Replies

161 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

UTEST sector definition is the same over all S32K3 family.

 

I would expect some sort of extra protection as UTEST is OTP memory.

davidtosenovjan_0-1759256871427.png

Typically HSE FW is being installed by different method, for instance by debugger, but this options is possible as well, of course, but I haven't tested it until now.

 

0 Kudos
Reply

148 Views
MarkFan
Contributor III

Hi David,

    Thanks for your reply. 
    I use SD3.5 with RTD 3.0 SDK

MarkFan_0-1759307123194.png


    There is no UTest driver as you show on the screen.
     How can I get this UTest driver?

Best regards,
Mark

 

 

  

 

  

0 Kudos
Reply

141 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

I see. Current version of RTD is 6.0.0. I would recommend to use current version.

0 Kudos
Reply