How to build the image file, flash_api.bin, of the Unified Bootloader?

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

How to build the image file, flash_api.bin, of the Unified Bootloader?

跳至解决方案
3,821 次查看
snaku_lee
Contributor III

Hi,

I am using the Unified Bootloader on S32K144, it works very well.

There is a flash driver (i.e., flash_api.bin) which is position independent, I want to learn how to build this  driver, could you share the S32DS project?

I read Erich's article, but I still not sure how to generate the flash_api.bin.

Thank you,

Snaku

0 项奖励
回复
1 解答
3,745 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Snaku,

I have received this answer from the owner of the bootloader:

Unfortunately, we don't have such a project.

The bin file can be created using these steps:

1. Compile flash driver(e.g., erase, program) in P-Flash at fixed address
2. Output S19 over S32DS
3. Copy the flash driver data to another S19 file from the complete S19 file
4. Used the objdump tool to transfer the S19(flash driver) to bin format

 

Regards,

Daniel

在原帖中查看解决方案

0 项奖励
回复
8 回复数
3,799 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @snaku_lee,

I'm sorry for the delay.

I'm currently trying to get the project.

 

BR, Daniel

0 项奖励
回复
3,780 次查看
snaku_lee
Contributor III

Hi Daniel,

Your help will be appreciated. thank you.

Snaku

0 项奖励
回复
3,746 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Snaku,

I have received this answer from the owner of the bootloader:

Unfortunately, we don't have such a project.

The bin file can be created using these steps:

1. Compile flash driver(e.g., erase, program) in P-Flash at fixed address
2. Output S19 over S32DS
3. Copy the flash driver data to another S19 file from the complete S19 file
4. Used the objdump tool to transfer the S19(flash driver) to bin format

 

Regards,

Daniel

0 项奖励
回复
3,218 次查看
TysonHu
Contributor II

Hello Daniel,

 

Where can I find the source files of S32K1xx flash driver?

0 项奖励
回复
3,206 次查看
snaku_lee
Contributor III

Hi TysonHu,

NXP doesn't release the source code for the flash driver, 

but there is a post introduced how to extract the machine code by arm-none-eabi-objcopy.exe and then generate the flash_api.bin file.

FYI,

Snaku

 

 

0 项奖励
回复
3,198 次查看
TysonHu
Contributor II

Hi snaku,

Thanks for your response.

I found the flash_driver.c file in the flash partioning  example of S32K DS. It has the alias functions defined in the struct tFlashOptInfo. This file probably can be used to generate the flash_api.bin.

The attached source file is flash driver I take from the example of flash_partitioning_s32k144.

C:\NXP\S32DS_ARM_v2.2\S32DS\software\S32SDK_S32K1xx_RTM_3.0.0\platform\drivers\src\flash

typedef struct
{
status_t (*FLASH_EraseAllBlock)(const flash_ssd_config_t * pSSDConfig);
status_t (*FLASH_VerifyAllBlock)(const flash_ssd_config_t * pSSDConfig,uint8_t marginLevel);
status_t (*FLASH_EraseSector)(const flash_ssd_config_t * pSSDConfig,uint32_t dest,uint32_t size);
status_t (*FLASH_VerifySection)(const flash_ssd_config_t * pSSDConfig,uint32_t dest,uint16_t number,uint8_t marginLevel);
void (*FLASH_EraseSuspend)(void);
void (*FLASH_EraseResume)(void);
status_t (*FLASH_Program)(const flash_ssd_config_t * pSSDConfig,uint32_t dest, uint32_t size,const uint8_t * pData);
status_t (*FLASH_ProgramCheck)(const flash_ssd_config_t * pSSDConfig,uint32_t dest,uint32_t size,const uint8_t * pExpectedData,uint32_t * pFailAddr,uint8_t marginLevel);
status_t (*FLASH_ProgramSection)(const flash_ssd_config_t * pSSDConfig,uint32_t dest,uint16_t number);
status_t (*FLASH_EraseBlock)(const flash_ssd_config_t * pSSDConfig, uint32_t dest);
status_t (*FLASH_CommandSequence)(const flash_ssd_config_t * pSSDConfig);
status_t (*FLASH_VerifyBlock)(const flash_ssd_config_t * pSSDConfig,uint32_t dest,uint8_t marginLevel);
} tFlashOptInfo;

 

0 项奖励
回复
3,187 次查看
snaku_lee
Contributor III

Hi TysonHu ,

Yes, i agree with you, thanks for your information.

Snaku

0 项奖励
回复
3,733 次查看
snaku_lee
Contributor III

Hi Daniel,

OK, that sounds interesting.

Thanks for your support.

Snaku

0 项奖励
回复