i have read the s32k-RM and s32 sdk api thoroughly,but not found the flash sector information about S32K144,i want to konw how many bytes a scetor contains,
secondly,if i just need flexnvm as dflash , what else shoud i need to do in the function "Flash_Init"?
void Flash_Init(void)
{
FLASH_DRV_Init(&Flash_InitConfig0,&Flash_SSD_InitConfig0);
if(Flash_SSD_InitConfig0.EEESize == 0)
{
FLASH_DRV_DEFlashPartition(&Flash_SSD_InitConfig0,0x02,0x04,0,false,true);
FLASH_DRV_Init(&Flash_InitConfig0,&Flash_SSD_InitConfig0);
FLASH_DRV_SetFlexRamFunction(&Flash_SSD_InitConfig0,EEE_ENABLE,0,NULL);
}
}
i have read the api ,but i still fell confused,thank you
Solved! Go to Solution.
all you question can be solved on this article.
1.
2.if i just need flexnvm as dflash,
a.EEPROM DATA SIZE = 0 -----------------------------------> FCCOB4[3:0] = 0xf
b.Data Flash Size = 64 kbytes (for S32K14x)------------->FCCOB5[3:0] = 0x0
FLASH_DRV_DEFlashPartition(&Flash_SSD_InitConfig0,0xF,0x00,0,false,false);
all you question can be solved on this article.
1.
2.if i just need flexnvm as dflash,
a.EEPROM DATA SIZE = 0 -----------------------------------> FCCOB4[3:0] = 0xf
b.Data Flash Size = 64 kbytes (for S32K14x)------------->FCCOB5[3:0] = 0x0
FLASH_DRV_DEFlashPartition(&Flash_SSD_InitConfig0,0xF,0x00,0,false,false);
thank you very much ,your reply is very useful to me ,according to your reply ,i have find some information in s32-RM,here i put them intend to review More conveniently
but i have another two questions to ask help from you :
first ,the flash driver must copy to ram and run in the ram,how coud i do to get it? is there a special function to make it ?
if you're using SDK to create your project then you don't have to do that,
for example, you can see this function was already mapped to RAM.
the instructions you came out with a red coil ,i can not find them in my project with sdk,could you please copy it and paste here,i want learn how to ue se it and figure out the theory
1.
2.S32K144_64_ram.ld for test use
Download the program to RAM, the program will be lost when power off
3.flash driver
“The Flash Driver(actual flash algorithm) is the hardware dependent code for performing the flash functions.In most cases, programming flash memory from flash is not possible.Therefore the Flash Driver is downloaded and executed into RAM to allow programming of the application.The advantage of downloading the flash algorithm into RAM is that updates to the flash algorithms are possible without the need to reprogram the primary bootloader. The algorithm is cleared from RAM upon completion of the download to avoid accidental calls to the flash functions while in application.
In special cases the flash algorithms are kept in flash memory and copied to RAM when needed. Of course the possibility of changing the flash algorithms is no longer available when this configuration is used. Moreover, there is a risk that the flash memory will be unintentionally erased from an accidental call to these functions. A remedy to correct this would be to encrypt the corresponding program code, such as e.g an XOR or the like.”
https://community.nxp.com/t5/S32K-Knowledge-Base/S32K-How-to-make-Flash-Driver-image/ta-p/1630873
i must say :thank you very much ,but i still have questions :
i have found the macro: START_FUNCTION_DEFINITION_RAMSECTION,this means if i want to use the fuction and make it runing in the ram ,i have to add START_FUNCTION_DEFINITION_RAMSECTION and END_FUNCTION_DEFINITION_RAMSECTION while define the function?
or just need do as :https://community.nxp.com/t5/S32K-Knowledge-Base/S32K-How-to-make-Flash-Driver-image/ta-p/1630873
"i have found the macro: START_FUNCTION_DEFINITION_RAMSECTION,this means if i want to use the fuction and make it runing in the ram ,i have to add START_FUNCTION_DEFINITION_RAMSECTION and END_FUNCTION_DEFINITION_RAMSECTION while define the function?"
The above is only designed for flash, if you want to map some functions to RAM, you have to do some steps, just like the steps of making flash driver.
this article is very detailed.
i am building a project named uds bootloader ,as requried,i have to bulid another project named flash_driver, which will be downloaded to ram and run,while the flash driver finish download APP to flash ,the flash drievr code will lose after power down,in the article you adviced ,i find some information :
but this is the first time that i use s32k144,i can not figure out this method is available,in adition ,i want to know the link files'difference between S32K144_64_flash.ld and S32K144_64_ram.ld,When this file is needed for S32K144_64_ram.ld