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

359 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

331 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

318 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

311 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
%3CLINGO-SUB%20id%3D%22lingo-sub-2178018%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20program%20UTEST%20when%20installing%20HSE%20on%20S32K358%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2178018%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%2C%3C%2FP%3E%3CP%3EBackground%3A%3CBR%20%2F%3EI%20successfully%20ran%20the%20S32K344_HSE_FW_INSTALL%20demo%20project%20and%20was%20able%20to%20program%20the%20UTEST%20area%20on%20the%20S32K344%20using%20the%20PFLASH%20driver.%3C%2FP%3E%3CP%3EExample%20(S32K344)%3A%3C%2FP%3E%3CP%3E%2F*%20Unlock%20UTEST%20data%20flash%20sector%20*%2F%3CBR%20%2F%3EPFLASH_Unlock(PFLASH_BL5%2C%20PFLASH_SS0%2C%20PFLASH_S0)%3B%3C%2FP%3E%3CP%3E%2F*%20Write%20in%20UTEST%20sector%20using%20main%20interface%20*%2F%3CBR%20%2F%3Estatus%20%3D%20FLASH_Write((uint32_t*)UTEST_BASE_ADDRESS%2C%3CBR%20%2F%3EhseFwFeatureFlagEnabledValue%2C%3CBR%20%2F%3Esizeof(hseFwFeatureFlagEnabledValue))%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ESteps%20Tried%20on%20S32K358%3A%3CBR%20%2F%3EWhen%20moving%20to%20the%20S32K358%2C%20I%20switched%20to%20the%20C40%20driver.%20The%20code%20I%20tried%20looks%20like%20this%3A%3C%2FP%3E%3CP%3Eif%20(STATUS_C40_IP_SECTOR_PROTECTED%20%3D%3D%20C40_Ip_GetLock(FLS_MAX_VIRTUAL_SECTOR))%20%7B%3CBR%20%2F%3EC40_Ip_ClearLock(FLS_MAX_VIRTUAL_SECTOR%2C%20FLS_MASTER_ID)%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3EC40_Ip_MainInterfaceWrite(UTEST_BASE_ADDRESS%2C%3CBR%20%2F%3Esizeof(hseFwFeatureFlagEnabledValue)%2C%3CBR%20%2F%3E(uint8%20*)(hseFwFeatureFlagEnabledValue)%2C%3CBR%20%2F%3EFLS_MASTER_ID)%3B%3C%2FP%3E%3CP%3E%23define%20C40_UTEST_ARRAY_0_S000%20(1040U)%20%2F*%200x1B000000%20*%2F%3C%2FP%3E%3CP%3E%23define%20FLS_MAX_VIRTUAL_SECTOR%201039%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EIssue%3A%3C%2FP%3E%3CP%3EOn%20S32K358%2C%20I%20cannot%20find%20a%20clear%20mapping%20for%20C40_UTEST_ARRAY_0_S000.%3C%2FP%3E%3CP%3ECurrently%2C%20the%20UTEST%20sector%20seems%20to%20be%20identified%20as%20FLS_MAX_VIRTUAL_SECTOR%20(1039)%2C%20but%20I%20am%20unsure%20if%20this%20is%20correct.%3C%2FP%3E%3CP%3EThe%20write%20operation%20to%20UTEST%20does%20not%20succeed.%3C%2FP%3E%3CP%3EQuestion%3A%3C%2FP%3E%3CP%3EWhat%20is%20the%20correct%20way%20to%20use%20the%20C40%20driver%20API%20to%20program%20the%20UTEST%20area%20on%20S32K358%3F%3C%2FP%3E%3CP%3EIs%20there%20a%20specific%20configuration%20or%20sector%20mapping%20required%20for%20UTEST%20on%20S32K358%20that%20differs%20from%20S32K344%3F%3C%2FP%3E%3CP%3EThanks%20in%20advance%20for%20your%20support.%3C%2FP%3E%3CP%3EBest%20regards%2C%3CBR%20%2F%3EMark%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2178699%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20program%20UTEST%20when%20installing%20HSE%20on%20S32K358%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2178699%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20see.%20Current%20version%20of%20RTD%20is%206.0.0.%20I%20would%20recommend%20to%20use%20current%20version.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2178665%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20program%20UTEST%20when%20installing%20HSE%20on%20S32K358%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2178665%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20David%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20Thanks%20for%20your%20reply.%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20I%20use%20SD3.5%20with%20RTD%203.0%20SDK%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MarkFan_0-1759307123194.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MarkFan_0-1759307123194.png%22%20style%3D%22width%3A%20365px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359140i4EA804A85D155161%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MarkFan_0-1759307123194.png%22%20alt%3D%22MarkFan_0-1759307123194.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20There%20is%20no%20UTest%20driver%20as%20you%20show%20on%20the%20screen.%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BHow%20can%20I%20get%20this%20UTest%20driver%3F%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20regards%2C%3CBR%20%2F%3EMark%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2178368%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20program%20UTEST%20when%20installing%20HSE%20on%20S32K358%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2178368%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EUTEST%20sector%20definition%20is%20the%20same%20over%20all%20S32K3%20family.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EI%20would%20expect%20some%20sort%20of%20extra%20protection%20as%20UTEST%20is%20OTP%20memory.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22davidtosenovjan_0-1759256871427.png%22%20style%3D%22width%3A%20715px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22davidtosenovjan_0-1759256871427.png%22%20style%3D%22width%3A%20715px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359098iFE7D75CC79EB9281%2Fimage-dimensions%2F715x368%3Fv%3Dv2%22%20width%3D%22715%22%20height%3D%22368%22%20role%3D%22button%22%20title%3D%22davidtosenovjan_0-1759256871427.png%22%20alt%3D%22davidtosenovjan_0-1759256871427.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ETypically%20HSE%20FW%20is%20being%20installed%20by%20different%20method%2C%20for%20instance%20by%20debugger%2C%20but%20this%20options%20is%20possible%20as%20well%2C%20of%20course%2C%20but%20I%20haven't%20tested%20it%20until%20now.%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E