Programming data flash s32k3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Programming data flash s32k3

跳至解决方案
2,810 次查看
vusal
Contributor III

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!

0 项奖励
回复
1 解答
2,790 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Sorry for the inconvenience we bring you! 
It seems to be the code in the flash_test project of S32K3xxDRV_r1.4.

FLASH_BYTES_MASK FLASH_DATAX_MASK.png


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.
-------------------------------------------------------------------------------

在原帖中查看解决方案

5 回复数
2,791 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Sorry for the inconvenience we bring you! 
It seems to be the code in the flash_test project of S32K3xxDRV_r1.4.

FLASH_BYTES_MASK FLASH_DATAX_MASK.png


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.
-------------------------------------------------------------------------------

2,730 次查看
vusal
Contributor III

@Robin_Shen ,

Any chance flash_test project available online?

Thanks!

0 项奖励
回复
2,781 次查看
vusal
Contributor III

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!

0 项奖励
回复
2,763 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

This is internal bare metal drivers, which was done before RTD was decided. In case you want official ones, the RTD are only available.

2,740 次查看
vusal
Contributor III
Thank you!
0 项奖励
回复