CLASS-B STL Run-time FLASH CRC Error, the test staus is TEST_RUNNING mode only not comming to Test_OK
i have integrated STL XCUBE class-B 2.2.0 Packages with STM32L433 controller here iam facing the test its always TEST_RUNNING not comming to Test_OK stauts, i am getting Run-time FLASH CRC Error, what could be the issue.
#define ROM_START ((uint32_t *)0x08000000uL)
#define ROM_END ((uint32_t *)&_Check_Sum)
#define ROM_SIZE ((uint32_t)ROM_END - (uint32_t)ROM_START)
#define ROM_SIZEinWORDS (uint32_t) (ROM_SIZE/4u)
#define STEPS_NUMBER ((uint32_t)ROM_SIZE/64u)
#define FLASH_BLOCK_WORDS (uint32_t)((ROM_SIZEinWORDS)/STEPS_NUMBER)
rom_test = STL_crc32Run(); /* Requires the control flow check to be modified */
switch ( rom_test )
{
case TEST_RUNNING:
control_flow_resume(FLASH_TEST_CALLER);
break;
case TEST_OK:
break;
case TEST_FAILURE:
case CLASS_B_DATA_FAIL:
default:
#ifdef STL_VERBOSE
printf(" Run-time FLASH CRC Error\n\r");
#endif /* STL_VERBOSE */
FailSafePOR();
break;
ClassBTestStatus STL_crc32Run(void)
{
ClassBTestStatus result = CTRL_FLW_ERROR; /* In case of abnormal func exit*/
CtrlFlowCnt += CRC32_RUN_TEST_CALLEE;
/* Check Class B var integrity */
if ((((uint32_t)pRunCrc32Chk) ^ ((uint32_t)pRunCrc32ChkInv)) == 0xFFFFFFFFuL)
{
if (pRunCrc32Chk < (uint32_t *)ROM_END)
{
/* the next lines replaces the HAL function call
HAL_CRC_Accumulate(&CrcHandle, (uint32_t *)pRunCrc32Chk, (uint32_t)FLASH_BLOCK_WORDS);
due to bug at IAR linker - check sum computation can't support both big & little endian */
uint32_t index;
for(index = 0; index < (uint32_t)FLASH_BLOCK_WORDS; index++)
{
CRC->DR = __REV(*(pRunCrc32Chk + index));
}
pRunCrc32Chk += FLASH_BLOCK_WORDS; /* Increment pointer to next block */
pRunCrc32ChkInv = ((uint32_t *)~((uint32_t)pRunCrc32Chk));
result = TEST_RUNNING;
}
else
{
if ((RefCrc32 ^ RefCrc32Inv) == 0xFFFFFFFFuL)
{
CtrlFlowCnt += CRC32_INIT_CALLER;
if(CRC->DR == *(uint32_t *)(&REF_CRC32))
{
result = TEST_OK;
__io_putchar((int16_t)'S');
}
else
{
result = TEST_FAILURE;
}
STL_FlashCrc32Init(); /* Prepare next test (or redo it if this one failed) */
CtrlFlowCntInv -= CRC32_INIT_CALLER;
}
else /* Class B error on RefCrc32 */
{
__io_putchar((int16_t)'F');
result = CLASS_B_DATA_FAIL;
}
}
}
else /* Class B error pRunCrc32Chk */
{
printf("CRC CHK FAIL\rn");
result = CLASS_B_DATA_FAIL;
}
CtrlFlowCntInv -= CRC32_RUN_TEST_CALLEE;
return (result);
}
if any help it would be grateful
