Flash Integrity test (SM1.FLASH.AI_SELFCHECK)

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

Flash Integrity test (SM1.FLASH.AI_SELFCHECK)

1,365 Views
sandeepSingh18606
Contributor II
I am currently working on enabling the flash memory safety mechanism (SM1.FLASH.AI_SELFCHECK) and have a few questions regarding the implementation.
 
I found two relevant APIs in the c40_ip driver: C40_Ip_ArrayIntegrityCheck and Fls_IPW_CheckUserTestStatus.
 
1. If C40_Ip_ArrayIntegrityCheck starts the flash integrity test and returns the test status (true or false), what is the specific purpose of the Fls_IPW_CheckUserTestStatus API?
 
2. I understand that the code needs to be copied from flash to SRAM before running the flash integrity test. Could you please provide guidance on how to implement this? What specific changes are required in the linker script?
 
3. In the latest AUTOSAR standard, the mem40_Infls module is used. Previous AUTOSAR versions included the fls module, which provided configuration options for a user test mode. How can the user test functionality be achieved using the latest AUTOSAR version?
 
Thank you for your help with these queries.

 

0 Kudos
Reply
7 Replies

125 Views
sandeepSingh18606
Contributor II
Hi Daniel,
 
Thank you for your suggestion.
 

I have attempted to execute the array integrity check function from SRAM using the provided example code. However, the application is currently triggering a Hard Fault error. I suspect that updates to the linker file may be required to support this implementation.

0 Kudos
Reply

1,035 Views
sandeepSingh18606
Contributor II
Hi Daniel,
 
Thank you for providing the example code.
 
I have tested the code, and while it occasionally works, it is mostly entering the bus fault handler. After checking the CPU registers, the CFSR indicates an instruction bit error.
 
sandeepSingh18606_0-1766569971296.png

 

 
I suspect the code needs to be moved to SRAM before starting the Array Integrity Check.
 
Could you please advise on the correct procedure for implementing this?
 
Best regards,
Sandeep Singh
0 Kudos
Reply

713 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @sandeepSingh18606,

I'm sorry for the delayed response — I am currently out of the office.


You are correct; it should run from SRAM.


I haven't found any flash-based example that includes the integrity check running from SRAM. I also contacted the owner of the C40_Ip driver to ask how this was validated, and the answer was that the entire test project was executed from SRAM.


You can place C40_Ip_ArrayIntegrityCheck(), C40_Ip_CheckUserTestStatus(), and your wrapper function in SRAM, similar to how it is done in the following example. At the moment, I'm not fully sure if there are additional functions that also need to be moved to SRAM.

https://community.nxp.com/t5/S32K-Knowledge-Base/S32K312-C40-Ip-SRAM-RTD-500-DS35/ta-p/2074245

 

Regards,

Daniel

0 Kudos
Reply

1,162 Views
sandeepSingh18606
Contributor II

Hi Daniel,

Is there any update on above topic?

Regards

Sandeep Singh

0 Kudos
Reply

1,119 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @sandeepSingh18606,

I'm attaching an example created with RTD 3.0.0 P07.

We don't have any other reference project.

 

Regards,

Daniel

0 Kudos
Reply

1,323 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @sandeepSingh18606,

Which version of the RTD do you use? 

1.

I think this is very similar to the current implementation in Mem_43_INFLS (S32K3xx RTD 6.0.0)

Mem_43_INFLS_ArrayIntegrityCheck()

Mem_43_INFLS_GetJobUtestState()

C40_Ip_ArrayIntegrityCheck()

C40_Ip_CheckUserTestStatus()

Refer to RTD_MEM_43_INFLS_UM.pdf (located in the RTD installation folder).

3.6.4.3 Driver Hardware Utest Mode Service

There are also examples how to use the APIs.

 

2.

Let me check.

 

3.

Refer to the User Manual mentioned above.

 

Regards,

Daniel

0 Kudos
Reply

1,303 Views
sandeepSingh18606
Contributor II
Hi Daniel,

I am using RTD 3.0.0. Above api's may be available in latest RTD you mentioned. I will check that.

It will be more helpful if you can share any example code for array integrity check if you have.

Regards
Sandeep Singh
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2263777%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EFlash%20Integrity%20test%20(SM1.FLASH.AI_SELFCHECK)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2263777%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3EI%20am%20currently%20working%20on%20enabling%20the%20flash%20memory%20safety%20mechanism%20(SM1.FLASH.AI_SELFCHECK)%20and%20have%20a%20few%20questions%20regarding%20the%20implementation.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EI%20found%20two%20relevant%20APIs%20in%20the%20c40_ip%20driver%3A%20C40_Ip_ArrayIntegrityCheck%20and%20Fls_IPW_CheckUserTestStatus.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E1.%20If%20C40_Ip_ArrayIntegrityCheck%20starts%20the%20flash%20integrity%20test%20and%20returns%20the%20test%20status%20(true%20or%20false)%2C%20what%20is%20the%20specific%20purpose%20of%20the%20Fls_IPW_CheckUserTestStatus%20API%3F%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E2.%20I%20understand%20that%20the%20code%20needs%20to%20be%20copied%20from%20flash%20to%20SRAM%20before%20running%20the%20flash%20integrity%20test.%20Could%20you%20please%20provide%20guidance%20on%20how%20to%20implement%20this%3F%20What%20specific%20changes%20are%20required%20in%20the%20linker%20script%3F%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E3.%20In%20the%20latest%20AUTOSAR%20standard%2C%20the%20mem40_Infls%20module%20is%20used.%20Previous%20AUTOSAR%20versions%20included%20the%20fls%20module%2C%20which%20provided%20configuration%20options%20for%20a%20user%20test%20mode.%20How%20can%20the%20user%20test%20functionality%20be%20achieved%20using%20the%20latest%20AUTOSAR%20version%3F%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThank%20you%20for%20your%20help%20with%20these%20queries.%3C%2FDIV%3E%3CP%3E%3CSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2264368%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Flash%20Integrity%20test%20(SM1.FLASH.AI_SELFCHECK)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2264368%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%20Daniel%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20using%20RTD%203.0.0.%20Above%20api's%20may%20be%20available%20in%20latest%20RTD%20you%20mentioned.%20I%20will%20check%20that.%3CBR%20%2F%3E%3CBR%20%2F%3EIt%20will%20be%20more%20helpful%20if%20you%20can%20share%20any%20example%20code%20for%20array%20integrity%20check%20if%20you%20have.%3CBR%20%2F%3E%3CBR%20%2F%3ERegards%3CBR%20%2F%3ESandeep%20Singh%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2264052%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Flash%20Integrity%20test%20(SM1.FLASH.AI_SELFCHECK)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2264052%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%2F256373%22%20target%3D%22_blank%22%3E%40sandeepSingh18606%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EWhich%20version%20of%20the%20RTD%20do%20you%20use%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%3C%2FP%3E%0A%3CP%3EI%20think%20this%20is%20very%20similar%20to%20the%20current%20implementation%20in%26nbsp%3BMem_43_INFLS%20(S32K3xx%20RTD%206.0.0)%3C%2FP%3E%0A%3CP%3EMem_43_INFLS_ArrayIntegrityCheck()%3C%2FP%3E%0A%3CP%3EMem_43_INFLS_GetJobUtestState()%3C%2FP%3E%0A%3CP%3EC40_Ip_ArrayIntegrityCheck()%3C%2FP%3E%0A%3CP%3EC40_Ip_CheckUserTestStatus()%3C%2FP%3E%0A%3CP%3ERefer%20to%20RTD_MEM_43_INFLS_UM.pdf%20(located%20in%20the%20RTD%20installation%20folder).%3C%2FP%3E%0A%3CP%3E3.6.4.3%20Driver%20Hardware%20Utest%20Mode%20Service%3C%2FP%3E%0A%3CP%3EThere%20are%20also%20examples%20how%20to%20use%20the%20APIs.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E2.%3C%2FP%3E%0A%3CP%3ELet%20me%20check.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E3.%3C%2FP%3E%0A%3CP%3ERefer%20to%20the%20User%20Manual%20mentioned%20above.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2267391%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Flash%20Integrity%20test%20(SM1.FLASH.AI_SELFCHECK)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2267391%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Daniel%2C%3CBR%20%2F%3E%3CBR%20%2F%3EIs%20there%20any%20update%20on%20above%20topic%3F%3CBR%20%2F%3E%3CBR%20%2F%3ERegards%3C%2FP%3E%3CP%3ESandeep%20Singh%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2267576%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Flash%20Integrity%20test%20(SM1.FLASH.AI_SELFCHECK)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2267576%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%2F256373%22%20target%3D%22_blank%22%3E%40sandeepSingh18606%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EI'm%20attaching%20an%20example%20created%20with%20RTD%203.0.0%20P07.%3C%2FP%3E%0A%3CP%3EWe%20don't%20have%20any%20other%20reference%20project.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2268650%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Flash%20Integrity%20test%20(SM1.FLASH.AI_SELFCHECK)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2268650%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3EHi%20Daniel%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThank%20you%20for%20providing%20the%20example%20code.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EI%20have%20tested%20the%20code%2C%20and%20while%20it%20occasionally%20works%2C%20it%20is%20mostly%20entering%20the%20bus%20fault%20handler.%20After%20checking%20the%20CPU%20registers%2C%20the%20CFSR%20indicates%20an%20instruction%20bit%20error.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22sandeepSingh18606_0-1766569971296.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22sandeepSingh18606_0-1766569971296.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22sandeepSingh18606_0-1766569971296.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22sandeepSingh18606_0-1766569971296.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371139i02BD76E1627D5F72%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22sandeepSingh18606_0-1766569971296.png%22%20alt%3D%22sandeepSingh18606_0-1766569971296.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EI%20suspect%20the%20code%20needs%20to%20be%20moved%20to%20SRAM%20before%20starting%20the%20Array%20Integrity%20Check.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3ECould%20you%20please%20advise%20on%20the%20correct%20procedure%20for%20implementing%20this%3F%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EBest%20regards%2C%3C%2FDIV%3E%3CDIV%3ESandeep%20Singh%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2269933%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Flash%20Integrity%20test%20(SM1.FLASH.AI_SELFCHECK)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269933%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%2F256373%22%20target%3D%22_blank%22%3E%40sandeepSingh18606%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EI'm%20sorry%20for%20the%20delayed%20response%20%E2%80%94%20I%20am%20currently%20out%20of%20the%20office.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EYou%20are%20correct%3B%20it%20should%20run%20from%20SRAM.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EI%20haven't%20found%20any%20flash-based%20example%20that%20includes%20the%20integrity%20check%20running%20from%20SRAM.%20I%20also%20contacted%20the%20owner%20of%20the%20C40_Ip%20driver%20to%20ask%20how%20this%20was%20validated%2C%20and%20the%20answer%20was%20that%20the%20entire%20test%20project%20was%20executed%20from%20SRAM.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EYou%20can%20place%20C40_Ip_ArrayIntegrityCheck()%2C%20C40_Ip_CheckUserTestStatus()%2C%20and%20your%20wrapper%20function%20in%20SRAM%2C%20similar%20to%20how%20it%20is%20done%20in%20the%20following%20example.%20At%20the%20moment%2C%20I'm%20not%20fully%20sure%20if%20there%20are%20additional%20functions%20that%20also%20need%20to%20be%20moved%20to%20SRAM.%3C%2FP%3E%0A%3CP%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%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2289066%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Flash%20Integrity%20test%20(SM1.FLASH.AI_SELFCHECK)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2289066%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3EHi%20Daniel%2C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThank%20you%20for%20your%20suggestion.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%3EI%20have%20attempted%20to%20execute%20the%20array%20integrity%20check%20function%20from%20SRAM%20using%20the%20provided%20example%20code.%20However%2C%20the%20application%20is%20currently%20triggering%20a%20Hard%20Fault%20error.%20I%20suspect%20that%20updates%20to%20the%20linker%20file%20may%20be%20required%20to%20support%20this%20implementation.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E