S32K324 UTest NVM OTP location writing fails

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

S32K324 UTest NVM OTP location writing fails

741 Views
anilsp31PA
Contributor III

We want to write to S32K324 UTEST NVM OTP locations from 0x1B000770 onwards. But the Write API is failing with error code 

C40_IP_STATUS_ERROR_PROGRAM_VERIFY. We observed memory was not written properly. But C40_Ip_MainInterfaceWrite() API was successful.
We ran the C40_Ip_MainInterfaceWrite() and C40_Ip_MainInterfaceWriteStatus() functions from RAM.
Anything needs to be checked for failure?

Tags (3)
0 Kudos
Reply
6 Replies

543 Views
anilsp31PA
Contributor III

This worked after putting respective functions to run from RAM. Only thing is now I am trying to find better way to use macro 

MEM_43_INFLS_START_SEC_RAMCODE to put whole C40 driver to run from RAM. But that is not happening. May need some more understanding on this.
0 Kudos
Reply

414 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @anilsp31PA,

The C40_Ip is placed in SRAM in this example:
https://community.nxp.com/t5/S32K-Knowledge-Base/S32K312-C40-Ip-SRAM-RTD-500-DS35/ta-p/2074245


However, I would recommend using the MCAL INFLS driver instead. When the option “Mem Load Access Code On Job Start” is enabled, the necessary code is automatically loaded into SRAM, eliminating the need for manual placement.

 

BR, Daniel

 

 

 

0 Kudos
Reply

706 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @anilsp31PA,

 

Do you verify that the flash phrase you intend to program is fully erased (all 0xFF) before performing the write operation?

You can refer to this example:
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K344-decouple-RTD400-Ip-C40-DS35/ta-p/18...


It may also help to test the write procedure on standard D-Flash first to confirm that the write behaves as expected.


BR, Daniel

0 Kudos
Reply

699 Views
anilsp31PA
Contributor III

Yes, We are checking it locations are 0xFF before writing.

After running it from RAM we go it working once the first time for 8 bytes. But it returned error. Not sure which API failed. I was not debugging it.

Also, it never written again in next set of 8 locations. It returns error from 

C40_Ip_Compare().
0 Kudos
Reply

635 Views
anilsp31PA
Contributor III

I have stopped C40_IP_PROGRAM_VERIFICATION_ENABLED. Now it is writing successfully.
But giving HardFault in C40_Ip_MainInterfaceHVJobStatus().

0 Kudos
Reply

630 Views
anilsp31PA
Contributor III

I checked writing to DFLASH works. I tried on address 0x1001f770 for S2K324. It works fine. Just address is different code is same. Same code does not work for writing to UTEST DCF memory areas address range from 0x1B000770U.

Tags (3)
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2340516%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K324%20UTest%20NVM%20OTP%20location%20writing%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2340516%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWe%20want%20to%20write%20to%20S32K324%20UTEST%20NVM%20OTP%20locations%20from%200x1B000770%20onwards.%20But%20the%20Write%20API%20is%20failing%20with%20error%20code%26nbsp%3B%3C%2FP%3E%3CP%3EC40_IP_STATUS_ERROR_PROGRAM_VERIFY.%20We%20observed%20memory%20was%20not%20written%20properly.%20But%20C40_Ip_MainInterfaceWrite()%20API%20was%20successful.%3CBR%20%2F%3EWe%20ran%20the%20C40_Ip_MainInterfaceWrite()%20and%20C40_Ip_MainInterfaceWriteStatus()%20functions%20from%20RAM.%3CBR%20%2F%3EAnything%20needs%20to%20be%20checked%20for%20failure%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2340905%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K324%20UTest%20NVM%20OTP%20location%20writing%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2340905%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F229232%22%20target%3D%22_blank%22%3E%40anilsp31PA%3C%2FA%3E%2C%3C%2FP%3E%0A%3CDIV%20style%3D%22font-family%3A%20'Segoe%20UI'%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20line-height%3A%2020px%3B%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3EDo%20you%20verify%20that%20the%20flash%20phrase%20you%20intend%20to%20program%20is%20fully%20erased%20(all%200xFF)%20before%20performing%20the%20write%20operation%3F%3C%2FP%3E%0A%3CP%3EYou%20can%20refer%20to%20this%20example%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FExample-S32K344-decouple-RTD400-Ip-C40-DS35%2Fta-p%2F1866329%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FExample-S32K344-decouple-RTD400-Ip-C40-DS35%2Fta-p%2F1866329%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EIt%20may%20also%20help%20to%20test%20the%20write%20procedure%20on%20standard%20D-Flash%20first%20to%20confirm%20that%20the%20write%20behaves%20as%20expected.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBR%2C%20Daniel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2341297%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K324%20UTest%20NVM%20OTP%20location%20writing%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2341297%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EYes%2C%20We%20are%20checking%20it%20locations%20are%200xFF%20before%20writing.%3C%2FP%3E%3CP%3EAfter%20running%20it%20from%20RAM%20we%20go%20it%20working%20once%20the%20first%20time%20for%208%20bytes.%20But%20it%20returned%20error.%20Not%20sure%20which%20API%20failed.%20I%20was%20not%20debugging%20it.%3C%2FP%3E%3CP%3EAlso%2C%20it%20never%20written%20again%20in%20next%20set%20of%208%20locations.%20It%20returns%20error%20from%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EC40_Ip_Compare().%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2342141%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K324%20UTest%20NVM%20OTP%20location%20writing%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2342141%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20have%20stopped%20C40_IP_PROGRAM_VERIFICATION_ENABLED.%20Now%20it%20is%20writing%20successfully.%3CBR%20%2F%3EBut%20giving%20HardFault%20in%20C40_Ip_MainInterfaceHVJobStatus().%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2342185%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K324%20UTest%20NVM%20OTP%20location%20writing%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2342185%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20checked%20writing%20to%20DFLASH%20works.%20I%20tried%20on%20address%200x1001f770%20for%20S2K324.%20It%20works%20fine.%20Just%20address%20is%20different%20code%20is%20same.%20Same%20code%20does%20not%20work%20for%20writing%20to%20UTEST%20DCF%20memory%20areas%20address%20range%20from%26nbsp%3B%3CSPAN%3E0x1B000770U.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2344763%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K324%20UTest%20NVM%20OTP%20location%20writing%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2344763%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThis%20worked%20after%20putting%20respective%20functions%20to%20run%20from%20RAM.%20Only%20thing%20is%20now%20I%20am%20trying%20to%20find%20better%20way%20to%20use%20macro%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EMEM_43_INFLS_START_SEC_RAMCODE%20to%20put%20whole%20C40%20driver%20to%20run%20from%20RAM.%20But%20that%20is%20not%20happening.%20May%20need%20some%20more%20understanding%20on%20this.%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2346035%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K324%20UTest%20NVM%20OTP%20location%20writing%20fails%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2346035%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F229232%22%20target%3D%22_blank%22%3E%40anilsp31PA%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EThe%20C40_Ip%20is%20placed%20in%20SRAM%20in%20this%20example%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K312-C40-Ip-SRAM-RTD-500-DS35%2Fta-p%2F2074245%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K312-C40-Ip-SRAM-RTD-500-DS35%2Fta-p%2F2074245%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EHowever%2C%20I%20would%20recommend%20using%20the%20MCAL%20INFLS%20driver%20instead.%20When%20the%20option%20%E2%80%9CMem%20Load%20Access%20Code%20On%20Job%20Start%E2%80%9D%20is%20enabled%2C%20the%20necessary%20code%20is%20automatically%20loaded%20into%20SRAM%2C%20eliminating%20the%20need%20for%20manual%20placement.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20Daniel%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditordanielmartynek_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E