I am currently working on the integration of the SAF Library Premium Version into a Battery Management System (BMS) project, with the target controller being the S32K344. I have encountered several challenges related to the sCheck module and the Mode Selector, and I would greatly appreciate your guidance and assistance in resolving these issues.
Questions regarding the sCheck_Swt0_FuncResetStartupTest:
Initialization and Configuration of Timers (STM): In the sCheck documentation, it is mentioned that the STM (System Timer Module) needs to be configured for use by the SAF Library. However, it is recommended not to initialize anything before running sCheck tests. Could you please provide guidance on how to properly initialize and configure the STM for use with the SAF Library while adhering to the recommended best practices?
STM Configuration for sCheck_Swt0_FuncResetStartupTest: I am attempting to run the sCheck_Swt0_FuncResetStartupTest. Could you provide specific STM configuration settings that are required to successfully execute this test?
Reset Register Cleared by Hardware Initialization: When running the sCheck_Swt0_FuncResetStartupTest, I observed that the reset register is cleared by hardware initialization after the test completes. This causes the test to rerun upon restart, resulting in continuous resets. How can I prevent the reset register from being cleared during hardware initialization after the test execution?
Questions regarding the sCheck_ExecuteStartupTests:
During the Mode Selector process, the sCheck_ExecuteStartupTests run various tests, but some of them fail, causing hard faults. These failures include:
I would appreciate your insights into resolving these failures during the sCheck_ExecuteStartupTests.
Mode Selector Module Issue:
Within the mSel_NvmStorage.c file, the SAF Library initializes the selected mode using MSEL_error. However, when the library reads from NVM, if the previously saved mode is anything other than the normal mode, it does not save anything in NVM. Consequently, the project only runs successfully the first time, after which it returns an error due to the initialized return value being set to E_NOT_OK. Could you provide guidance on a more appropriate solution for this issue?
Additionally, there seems to be a discrepancy between the library's EIM module address (0x40258000UL) and the address mentioned in the data sheet (0x4050C000UL) for the EIM module. Could you clarify this discrepancy and guide on the correct address to use?
I would greatly appreciate your assistance in resolving these issues and providing guidance on how to proceed with the SAF Library integration into my BMS project on the S32K344 controller. Thank you for your support.
I would like to discuss specific challenges encountered during the execution of sCheck_ExecuteStartupTests, particularly in the areas of ECC and CMU testing.
CMUFC Test Issue:
ECC Test on Flash:
ECC Test on RAM:
ECC Safety Mechanism Testing:
SAF Library Version:
Request for Release Notes and Documentation:
Thank you for your continued support, and I look forward to your guidance on these matters.
Best Regards,
Mohamed abdelrazek
Questions regarding the sCheck_Swt0_FuncResetStartupTest:
Questions regarding the sCheck_ExecuteStartupTests:
During the Mode Selector process, the sCheck_ExecuteStartupTests run various tests, but some of them fail, causing hard faults. These failures include:
I would appreciate your insights into resolving these failures during the sCheck_ExecuteStartupTests.
[NXP] During sCheck testing there are bus faults/hard faults expected. To properly handle them it is needed to follow all the steps in sCheck user manual (c:\NXP\S32K3_SAF_1.0.3\eclipse\plugins\sCheck_TS_T40D34M10I3R0\doc\S32K3_SAF_SCHECK_UM.pdf). See section “5 Software Integration”. Especially important to prevent wrong hard faults is to follow there sections “5.3 Memory Allocation”, i.e. it is required to have all the sections properly integrated in linker file (alignment, placement into proper memory ranges) and also correspondingly setup MPU regions for these sections in MPU (Memory Protection Unit) – these include attributes as cacheable/non-cacheable, placement on proper addresses and all others as documented in that section. Also it is needed to implement the functions described in section “3.8 External Reference”, i.e. function for testing ISRs (Interrupt Service Routines) and testing ESRs (Exception Service Routines). Also check the section “5.8 Conditions, Limitations and Side Effects” documenting confitions to run all tests.
Mode Selector Module Issue:
Within the mSel_NvmStorage.c file, the SAF Library initializes the selected mode using MSEL_error. However, when the library reads from NVM, if the previously saved mode is anything other than the normal mode, it does not save anything in NVM. Consequently, the project only runs successfully the first time, after which it returns an error due to the initialized return value being set to E_NOT_OK. Could you provide guidance on a more appropriate solution for this issue?
[NXP] I’m not able to reproduce this issue. The result of mode selection is either some selected mode or MSEL_NO_OP_AVAILABLE. However, E_NOT_OK is returned by mSel_SelectMode() in case no mode is selected due to some detected failure(s). Those might be the sCheck results you are referring. MSEL_ERROR can be stored into NVM in the situation when MCU NVM has not been previously written or when the NVM Load fails. Then, when no mode is selected, the MSEL_ERROR mode still appears in NVM and is not overwritten by the selected mode. Another possible scenario when mSel_selectMode() returns E_NOT_OK is when the app mode init functions are NULL pointers – for this please check whether the app mode init functions are properly configured.
Additionally, there seems to be a discrepancy between the library's EIM module address (0x40258000UL) and the address mentioned in the data sheet (0x4050C000UL) for the EIM module. Could you clarify this discrepancy and guide on the correct address to use?
[NXP] For S32K344 the correct address to use is 0x40258000UL. This address is properly documented in S32K3xx_memory_map.xlsx attached to HW reference manual (S32K3xxRM_Rev7.pdf), sheet "Peripherals". But I have seen that the address is wrongly documented in S32K3xxRM_Rev7.pdf, section “51.6.1 EIM memory map”.
I checked internally and this issue is already known and it was already reported to HW team to get it fixed in HW reference manual.