"Bootloader application validation" error

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

cross mob
SaMi_4664361
Level 1
Level 1

Hi.

I am using Psoc Creator 3.3 and am designing a Bootloader component to be used with a Bootloadable component.

One of the requirements is that the bootloader needs to validate itself before proceeding with bootloading, which is provided by the "Bootloader application validation" setting in the bootloader component in "TopDesign.cysch" file.

However, after building and flashing the project in Eclipse with a J-Link (not Miniprog3), the code hangs during checksum calculation. The reason is these two following lines in Bootloader_1.c:

const uint32 CYCODE Bootloader_1_SizeBytes = 0xFFFFFFFFu;

const uint32 CYCODE *Bootloader_1_SizeBytesAccess = (const uint32 CYCODE *)(&Bootloader_1_SizeBytes);

As you can see, the bootloader's size is hard coded and as a result it will calculate the checksum forever. I confirmed this by pausing the program with the debugger.

According to Cypress:

Bootloader application validation

If this option is enabled, the bootloader validates itself by calculating the checksum and comparing it with the saved one that resides in the internal variable. PSoC Creator generates and puts the exact value into this variable during the post-build step.If validation does not pass, the device halts.If this option is disabled, the bootloader is executed even if it is corrupted. This can lead to unpredictable results.

this should be handled during post-build.

Am I missing a setting somewhere?

0 Likes
1 Solution

Thank you for replying.

I actually found the error. My development is setup in Eclipse in Linux, and the command for the cyelftool.exe in the post-build script was this:

wine cyelftool.exe -B $PROJNAME.elf --flash_row_size 256 --flash_size 131072 --flash_array_size 65536 --ee_array 64 --ee_row_size 16

instead of this:

wine cyelftool.exe -P $PROJNAME.elf --flash_row_size 256 --flash_size 131072 --size_var_name Bootloader_1_SizeBytes --checksum_var_name Bootloader_1_Checksum

As you can see, it was missing the two arguments for size and checksum. This was the reason these values were not updated in the .elf file.

View solution in original post

0 Likes
2 Replies
lock attach
Attachments are accessible only for community members.
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi,

We tried running a code example in PSoC Creator 4.3 and the bootloadable application is running at our end.

I have attached the project , can you please try and let us know if this works.

The two lines which you have mentioned, is there in the code example which i have attached and the code is working.

Please let us know if this works.

Regards

Alakananda

Alakananda
0 Likes

Thank you for replying.

I actually found the error. My development is setup in Eclipse in Linux, and the command for the cyelftool.exe in the post-build script was this:

wine cyelftool.exe -B $PROJNAME.elf --flash_row_size 256 --flash_size 131072 --flash_array_size 65536 --ee_array 64 --ee_row_size 16

instead of this:

wine cyelftool.exe -P $PROJNAME.elf --flash_row_size 256 --flash_size 131072 --size_var_name Bootloader_1_SizeBytes --checksum_var_name Bootloader_1_Checksum

As you can see, it was missing the two arguments for size and checksum. This was the reason these values were not updated in the .elf file.

0 Likes