add binary Size and Checksum into the Adjacent flash section

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

add binary Size and Checksum into the Adjacent flash section

Jump to solution
673 Views
viveknath_thulasi
Contributor II

Hello,

I have a requirement where I need to add the Binary size and the Checksum to be loaded into different flash sections.

Device : MK10DN 512K

I have divided the flash into 2 sections 256K primarily to perform the Firmware Update and Flash Swap.

Each of 2 sections are further divided into 252K (Build Firmware) and 2k * 2 to store Flash indicator and flash verification such as like this :

First partition:

0x0000- 0x3f000 First flash section 

0x3f000-0x3f800 Second Flash section

0x3f800-0x40000

Similarly for second Partition .. 

 

From the Project settings, I understand that if checksum flag checked , the 32Bit checksum is generated as a part of "post Build Step" and adds to "Reserved Memory" at 0x1c

 

But Instead of inbuilt 32bit checksum,I would like to store  3 attributes

1) 16bit checksum

2) start address

3) bytecount(size) of the built binary

 into the second flash location mentioned above 0x3f000-0x3f800.

 

I played around with the SRecord mentioned from similar support requests,

where I have to generate srec files, So if my firmware has 60% of the first flash section

I filled remaining parts of First flash section with 0xFF , then added the 16Bit Checksum. 

I need to add the other 2 attributes in the similar way.

 

But is there a way that I can do this post build step ie 16 bit checksum and Size of binary directly at 2nd flash location?

maybe by modifying the linker script or using the Macros in "cr_section_macros.h"?

or by changing settings here?

viveknath_thulasi_0-1624026643124.png

Especially as a post build step, the inbuilt 32 checksum is getting added to generated .bin files directly.

 

How can I do this?

thanks in Advance!

Best regards

Viveknath

 

 

 

 

 

Labels (1)
0 Kudos
1 Solution
648 Views
nxf56274
NXP Employee
NXP Employee

Hi,

One easy way is to use the python. After you generate the program bin file. You can write a python file. This python program will calculate the parameter you need and write it into the bin file's specified address. Good luck.

 

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days 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

0 Kudos
1 Reply
649 Views
nxf56274
NXP Employee
NXP Employee

Hi,

One easy way is to use the python. After you generate the program bin file. You can write a python file. This python program will calculate the parameter you need and write it into the bin file's specified address. Good luck.

 

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days 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.
-------------------------------------------------------------------------------

0 Kudos