cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

AnkitaP
New Contributor II
Hi Cypress,
 
We want to retrieve the Bootloader Application version to verify that the correct bootloader is programmed on our device.
 
This is how we are doing it.
  1. Edit the Bootloader app version using the Bootloader component customizer and build the Bootloader project.
  2. Read the bootloader version stored in the metadata from the bootloadable application by doing the following - CY_GET_REG16(BOOTLOADER_VERSION_ADDR)

    where BOOTLOADER_VERSION_ADDR = CYDEV_FLASH_BASE + CYDEV_FLASH_SIZE - 0 - 64u + 18u (0 as the appId is 0)
  3. Program the new bootloader.
  4. Build bootloadable project.
  5. Install the bootloadable .cyacd file in the device.
  6. The Bootloader application version is eventually retrieved in our C++ host application from the bootloadable project.
 
The problem with this approach if we install only the bootloadable cyacd file into our device without programming the new bootloader version, the new bootloader version is retrieved from the Bootloadable.
This does not serve the purpose of the bootloader version because it ends up retrieving the version of bootloader which is not even yet programmed on the board but ends up retrieving what is stored in the metadata.
How can we avoid this?
 
What are other ways to retrieve bootloader application version from bootloadable or from an external C++ application?
 
Our C++ application also directly talks to the bootloader using CyBootloaderUtils (2011) but I dont see a useful API to do the same.
 
Please let us know at your earliest.
 
Additional info -
Bootloader component =- 1.50
PSoC Creator - 3.3
Device name - PSoC4 (PSoC5 also used)
0 Likes
5 Replies
Alakananda_BG
Moderator
Moderator

Hi,

The problem with this approach if we install only the bootloadable cyacd file into our device without programming the new bootloader version, the new bootloader version is retrieved from the Bootloadable.
This does not serve the purpose of the bootloader version because it ends up retrieving the version of bootloader which is not even yet programmed on the board but ends up retrieving what is stored in the metadata.
How can we avoid this?
 

>>From this are you building the new Bootloadable project with new Bootloader or Old Bootloader?

Regards

Alakananda
0 Likes
AnkitaP
New Contributor II

Hi Alakananda,

I am building the bootloadable project with new bootloader. 

To be more clear about the scenario -
Lets say I built the bootloadable and the bootloader with bootloader application version changed from default 0x0000 to 0x1111. 

Now when I program the bootloader on the product that we are building, and install the bootloadable .cyacd, I get the bootloader version return as 0x1111.  All fine till now.

But when I install only the .cyacd file (lets say accidently) without programming the new bootloader (with version 0x1111) and try to retrieve the bootloader version from our C++ program through the bootloadable, I still get 0x1111. This is actually false information because the bootloader version on the product is still 0x0000 because it was not programmed (lets say accidently).  

Thanks,

Ankita

0 Likes
AnkitaP
New Contributor II

Hello Alakananda and team,

Any updates? 

I'd really appreciate any help. Thanks!

 

Regards,

Ankita  

0 Likes
Alakananda_BG
Moderator
Moderator

Hi,

When you upload the new bootloadable the program overwrites the metadata with the bootloader version with which the bootloader is built.

I have attached the image from the .cyacd file where the bootloader app version is present.

Alakananda_BG_0-1612864719098.png

 

Regards

Alakananda
0 Likes
AnkitaP
New Contributor II

Is there a way to avoid writing only that part of the metadata? Anything we can do/ a setting/ code so that the bootloadable does not write the bootloader app version part of the metadata at least if not the whole metadata section?

I am thinking of using the "Checksum exclude section size" feature

0 Likes