Add Get_Metadata to Host Bootloader application

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

cross mob
MiSt_296941
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

We are using and HID USB interface to a PSoC5LP.  We allow users to update FW from PC Software we wrote.  We now have multiple versions of our products and are concerned they will write the wrong FW to a device.  We need to be able to read the Metadata from the PSoC before we download FW to make sure it is the right product.

I am having trouble finding documentation on the Bootload protocol so we can add this command to our C# program.

Any ideas where to find it?

0 Likes
1 Solution
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

I think you might want to have a closer look at the Bootloader/Bootloadable component datasheet.  The full contents of the metadata section are laid out, as well as the communication packet formatting and commands:

The packet structure is the same no matter the protocol.  In a USB HID loader, it will be contained in a 64-byte HID packet (Bootloadable Datasheet pg46):

KyTr_1955226_0-1615496989796.png

The command for metadata is 0x3C (pg50):

KyTr_1955226_1-1615497049410.png

The structure of the metadata is also in the datasheet (pg43):

KyTr_1955226_3-1615497249804.png

You could probably use the ID/Version/Custom ID to determine if the ID matches the cyacd you are attempting to load.

View solution in original post

4 Replies
BiBi_1928986
Level 7
Level 7
First comment on blog 500 replies posted 250 replies posted

Hello.

This may help you.  It gives detail of metadata, locations programmed, etc.
PSoC 5LP Device Programming Specification (cypress.com)

The bootloader (see Bootloader Component datasheet) has an API for validating the checksum (if you want to go this route):
cystatus Bootloader_ValidateBootloadable (uint8 appId)

To retrieve metadata in bootloader:
uint32 Bootloader_GetMetadata (uint8 field, uint8 appId)

Lots of checksum utilities can be found in bootloader utility folder:
...\PSoC Creator\cybootloaderutils
cybtldr_command, cybtldr_api, cybtldr_parse, search for the word 'checksum'.

Good luck with your product.  Never easy to make things foolproof.

0 Likes
MiSt_296941
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Thanks for the info, but that wasn't what I was looking for.  

I need to find the documentation for the protocol used to communicate with the Bootloader over USB - specifically the Get Metadata command (which is not enabled in a Bootloader Component by default).  

The link you sent covers SWD and JTAG and the Bootload Component datasheet covers the API internal to the PSoC.  I'm looking for the external protocol.  I have to write code in the PC to Get the Metadata from the PSoC before I download firmware.

Mike.

0 Likes
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

I think you might want to have a closer look at the Bootloader/Bootloadable component datasheet.  The full contents of the metadata section are laid out, as well as the communication packet formatting and commands:

The packet structure is the same no matter the protocol.  In a USB HID loader, it will be contained in a 64-byte HID packet (Bootloadable Datasheet pg46):

KyTr_1955226_0-1615496989796.png

The command for metadata is 0x3C (pg50):

KyTr_1955226_1-1615497049410.png

The structure of the metadata is also in the datasheet (pg43):

KyTr_1955226_3-1615497249804.png

You could probably use the ID/Version/Custom ID to determine if the ID matches the cyacd you are attempting to load.

MiSt_296941
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Oh my gosh!  Why was that so hard to find - staring me right in the face!

Thanks!

0 Likes