why bootloader's hex file is so big ?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am working on a bootloader project and I noticed that there is a discrepancy between what PSOC Creator states and the hex file. The Creator say my bootloader is using about 4% from the FLASH. And the hex file has the entire FLASH in it i.e. upto adrress 3FFFF.

Is there a way to reduce bootloader's hex file ?

0 Likes
1 Solution
Anonymous
Not applicable

Unfortunately it is not that easy. The bootloader's image is not linear i.e. there some fragmentation, which prevents me to do that.

Any way I managed to generate a C file which contains the bootloader by using cyelftool.exe.

View solution in original post

0 Likes
6 Replies
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Eventhough the bootloader hex file contains the entire flash space, space after first 4% should be filled with zeros.

If not, are you looking at the bootloadable hex file?

0 Likes
Anonymous
Not applicable

That's right I am looking at the hex file.  Perhaps I must explain what I want to do.

I have a project which has a bootloader. Now I want to update the bootloader without recalling all devices I have already sent to users. My intention is go create a bootloadable project , which has the bootloader's image inside as a C array and upon programming it to update the bootloader with the new version. That's why I need smaller hex file. i.e. without the zeroes.

Any help ?

0 Likes
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

I assume your application is to update bootloader via flash writes from bootloadable firmware - please confirm.

Instead of storing the entire hex file (mostly zeros), bootloadable needs to keep and update only the valid bootloader region (~4% of flash). To further reduce this, can you compare both bootloader hex files and observe how much do they vary? What are the modifications in the latest bootloader project?

0 Likes
Anonymous
Not applicable

Yes, idea is to have a bootloadable which  updates the bootloader.

Your observation regarding the bootloader is correct , however the question is how to make difference between areas which should be zero and those which are just filling space.

At the moment I have a regular bootloader , but I want to replace it with dual-app bootloader.

BR

Petar

0 Likes
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Flash memory in PSoC 5LP is programmed in rows. Each flash row has 256 code bytes. When the bootloader project is built, the PSoC Creator Output window shows the amount of flash used. For example, if the new version of Bootloader project output window says, Flash used: 9250 of 65536 bytes (14.11 %).

Thus, bootloader uses 9250 bytes and occupies 37 rows of flash (9250/256). ie., flash locations used are from 0x0000 to 0x2400. For hex file organisation, refer to Appendix 1 of PSoC 5LP Programming Specifications.

0 Likes
Anonymous
Not applicable

Unfortunately it is not that easy. The bootloader's image is not linear i.e. there some fragmentation, which prevents me to do that.

Any way I managed to generate a C file which contains the bootloader by using cyelftool.exe.

0 Likes