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