Programming data flash s32k3

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Programming data flash s32k3

Jump to solution
1,926 Views
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 Kudos
Reply
1 Solution
1,906 Views
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.
-------------------------------------------------------------------------------

View solution in original post

5 Replies
1,907 Views
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.
-------------------------------------------------------------------------------

1,846 Views
vusal
Contributor III

@Robin_Shen ,

Any chance flash_test project available online?

Thanks!

0 Kudos
Reply
1,897 Views
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 Kudos
Reply
1,879 Views
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.

1,856 Views
vusal
Contributor III
Thank you!
0 Kudos
Reply