This is from AN13388.
{
register tFLASH_STATUS status = FLASH_PEG_ST;
register uint8_t *pDst = (uint8_t*)dst, *pSrc = (uint8_t*)src, *pTmp;
register uint32_t *pData;
uint32_t tmp;
while ((nbytes > 0L) && (status & FLASH_PEG_ST))
{
pData = (uint32_t*)((uint32_t)&FLASH->DATA[0] + ((uint32_t)pDst & FLASH_DATAX_MASK));
FLASH_InitSeq (pDst);
do {
tmp = 0xffffffffUL;
pTmp = (uint8_t*)((uint32_t)&tmp + ((uint32_t)pDst & FLASH_BYTES_MASK));
do {
*pTmp++ = *pSrc++; pDst++;
} while ((nbytes-- > 0L) && ((uint32_t)pTmp & FLASH_BYTES_MASK));
*pData++ = tmp;
} while ((nbytes > 0L) && ((uint32_t)pData & FLASH_DATAX_MASK));
status = FLASH_ExecSeq (FLASH_MCR_PGM_MASK);
}
return
I couldn't find reference to FLASH_BYTES_MASK and FLASH_DATAX_MASK. Any thoughts?
Thanks!
Solved! Go to Solution.
Hi
Sorry for the inconvenience we bring you!
It seems to be the code in the flash_test project of S32K3xxDRV_r1.4.
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi
Sorry for the inconvenience we bring you!
It seems to be the code in the flash_test project of S32K3xxDRV_r1.4.
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
@Robin_Shen ,
Any chance flash_test project available online?
Thanks!
Hi @Robin_Shen,
Thank you very much for this. This answers my question.
One more thing, I couldn't find S32K3xxDRV_r1.4 example project in my IDE. Any thoughts?
Thanks!
This is internal bare metal drivers, which was done before RTD was decided. In case you want official ones, the RTD are only available.