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

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

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

Jump to solution
3,813 Views
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 Kudos
Reply
1 Solution
3,737 Views
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

View solution in original post

0 Kudos
Reply
8 Replies
3,791 Views
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 Kudos
Reply
3,772 Views
snaku_lee
Contributor III

Hi Daniel,

Your help will be appreciated. thank you.

Snaku

0 Kudos
Reply
3,738 Views
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 Kudos
Reply
3,210 Views
TysonHu
Contributor II

Hello Daniel,

 

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

0 Kudos
Reply
3,198 Views
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 Kudos
Reply
3,190 Views
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 Kudos
Reply
3,179 Views
snaku_lee
Contributor III

Hi TysonHu ,

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

Snaku

0 Kudos
Reply
3,725 Views
snaku_lee
Contributor III

Hi Daniel,

OK, that sounds interesting.

Thanks for your support.

Snaku

0 Kudos
Reply