Hello
s32k144 flash API don't support read ?
i find only below API FLASH_DRV_ReadResource can read data from flash , it only support 8bytes ?
if i want to support any length to read the data from, can i do it below ? or do you have example project or code ?
BTW,i need the flex_nvm data from data (addr:0x10000000U)
status_t hal_read_from_flash(uint32_t address, uint8_t* p_bufsrc,uint32_t length)
{
uint8_t data[8];
int i;
int ret;
for(i=0;i<length/8;i++)
{
memset(data,0,8);
FLASH_DRV_ReadResource(&ssdConfig,(address+8*i),data,0);
memcpy(p_bufsrc+i*8,data,8);
}
int remain_len = length%8;
ret = FLASH_DRV_ReadResource(&ssdConfig,(address+8*i),data,0);
memcpy(p_bufsrc+i*8+remain_len,data,remain_len);
return ret;
}
/*FUNCTION**********************************************************************
*
* Function Name : FLASH_DRV_ReadResource
* Description : Read data from special purpose memory in Flash memory module
* including P-Flash IFR, swap IFR, D-Flash IFR space and version ID.
*
*END**************************************************************************/
status_t FLASH_DRV_ReadResource(const flash_ssd_config_t * pSSDConfig,
uint32_t dest,
uint8_t * pDataArray,
uint8_t resourceSelectCode)
Hello Alice,
There is no SDK API to read the flash, the FLASH_DRV_ReadResource() launches the FTFx_READ_RESOURCE command (FTFx_CMD 0x3) that is not supported on S32K1xx.
But the flash can be easily read by a pointer.
Or you can use the RTD Ftfc_Ip driver that has this API:
Ftfc_Fls_Ip_Read()
Regards,
Daniel
ok, got it, thanks
another question is
does this osif_IsIsrContext API is get current status in isr or task with freertos?
can i used it in printf/scanf ?
Can you create a new thread for this question?
It has nothing to do with the flash.
Thank you,
Daniel
BTW,i need read flash(addr:0x10000000U) data to ram with random length