Modify, add or delete bootloader commands.

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

cross mob
Anonymous
Not applicable

Hi,

   

Me and my team developed a small application allowing us to update the PSoC 3 when it's in bootloader mode. This would allow our clients to do a firmware upgrade via our software if there is the need for it. Currently, we are able to flash all the rows, verify them and boot into the new application using the C API Cypress provided.

Here's our problem, we would like our host program to be able to receive information from the PSoC 3 while it's in bootloader mode. I.E we would like to get the software version running on it, the firmware version, the serial number etc. (Stuff burned in EEPROM).

   

Currently there exists commands like Enter bootloader, get flash size, erase row, verify checksum etc.

   

My question is, is there a way to modify those commands provided by the API (add, delete or modify them)?

   

(Example of commands below)

#define Bootloader_1_COMMAND_CHECKSUM     (0x31u)
#define Bootloader_1_COMMAND_REPORT_SIZE  (0x32u)
#define Bootloader_1_COMMAND_APP_STATUS   (0x33u)
#define Bootloader_1_COMMAND_ERASE        (0x34u)
#define Bootloader_1_COMMAND_SYNC         (0x35u)
#define Bootloader_1_COMMAND_APP_ACTIVE   (0x36u)
#define Bootloader_1_COMMAND_DATA         (0x37u)
#define Bootloader_1_COMMAND_ENTER        (0x38u)
#define Bootloader_1_COMMAND_PROGRAM      (0x39u)
#define Bootloader_1_COMMAND_VERIFY       (0x3Au)
#define Bootloader_1_COMMAND_EXIT         (0x3Bu)
#define Bootloader_1_COMMAND_GET_METADATA (0x3Cu)

   

Thank you!

0 Likes
1 Solution
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Yes, simply customize the BL to read those areas of EE and FLASH and

   

com them out.

   

 

   

    

   

          

   

http://www.cypress.com/?rID=56014     PSoC® 3, PSoC 4, and PSoC 5LP Introduction To Bootloaders

   

http://www.cypress.com/?rID=83293     AN86526 - PSoC® 4  I2C Bootloader

   

http://www.cypress.com/?rID=50230     AN68272 - PSoC® 3, PSoC 4 and PSoC 5LP UART Bootloader

   

 

   

Regards, Dana.

View solution in original post

0 Likes
5 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Yes, simply customize the BL to read those areas of EE and FLASH and

   

com them out.

   

 

   

    

   

          

   

http://www.cypress.com/?rID=56014     PSoC® 3, PSoC 4, and PSoC 5LP Introduction To Bootloaders

   

http://www.cypress.com/?rID=83293     AN86526 - PSoC® 4  I2C Bootloader

   

http://www.cypress.com/?rID=50230     AN68272 - PSoC® 3, PSoC 4 and PSoC 5LP UART Bootloader

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Thanks Dana,

But isn't modifying the generated API a bad thing? It's going to be overwritten if a regenerate the project right?

Patrick
 

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

From the ap notes I poisted -

   

 

   

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

So what you're saying is that I should add my eeprom read and whatnot before the CyBtlrStart (which is a blocking function and doesn't allow us to do any other) and that I need to re-implement usb commands and whatnot? 

What would be best would be to simply add a new command code in the bootloading mode with the correct format (stop bits, command, length of data, data, checksum and end bits) and adding a case for that.

   

I don't think the state machine with the timed interrupt would be a good thing as we could be transferring at the same time. Unless I got what you said wrong.

Thanks
 

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I have not done a custom BL, but looking thru files I do not see

   

any banner areas for user code. So I think its correct, that user

   

non BL related capability is implemented before the start.

   

 

   

To confirm this, consider posting a CASE and point to this thread.

   

You might point out to Cypress that should be clear in ap note(s).

   

 

   

    

   

          

   

To create a technical or issue case at Cypress -

   

 

   

www.cypress.com

   

“Support”

   

“Technical Support”

   

“Create a Case”

   

 

   

You have to be registered on Cypress web site first.

   

 

   

Regards, Dana.