Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > Bootloading without a bootloader host

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Bootloading without a bootloader host
Moderator:
ANCY

Post Reply
Follow this topic



Bootloading without a bootloader host

Doug McClean posted on 28 Dec 2011 7:00 AM PST
Top Contributor
38 Forum Posts

Hello,

I'm interested in writing a custom bootloader. Unfortunately for what I am trying to do, all of the bootloader examples I can find talk about customizing either (a) critical tasks that the bootloader services in a similar way to how the bootloadable services them or (b) the communications channel between the bootloader and a bootloader host program.

I'd like to write a bootloader that loads the new program from an SD card. In my bootloadable project I already have the SPI interface to the SD card, and a port of the FatFS file system library. I can read and write binary files to the SD card.

It seems like it should be possible (but I could use a hint as to how) to write a bootloader that works like this:

  1. See if there's an SD card. If not, skip to bootloadable.
  2. See if it contains a file named "\firmware\program.hex" (or cycad, whatever the extension should be). If not, skip to bootloadable.
  3. See if the checksum in the header of that file matches the checksum of the currently installed bootloadable. If not, skip to bootloadable. (Or some other fast is-it-already-installed check.)
  4. Copy the new program to flash one row at a time, using the same strategy that the ordinary Cypress-provided bootloader does.
  5. Restart.

Am I missing a reason why this can't work? The reason I'd like to do it this way is because it means that field updates don't need a computer or any other smart bootloader host, they just need my customer to stick in the card I mailed them.

Thanks in advance for any advice you may have.




Re: Bootloading without a bootloader host

dboyette posted on 26 Apr 2012 02:18 PM PST
Member
2 Forum Posts

Have you had any success with your SD card bootloader? We have a PSoC3 design in the field with an SD card slot and would like to offer the same, laptop-less firmware upgrade path.



Re: Bootloading without a bootloader host

U2 posted on 29 Apr 2012 01:48 AM PST
Cypress Employee
589 Forum Posts

 

It is certainly possible to implement a SD Card based Bootloader. In this case PSoC has to act as master and read data from the EEPROM and bootload itself. This requires modification to the cyboot component. 



Re: Bootloading without a bootloader host

kmmankad posted on 02 May 2012 02:12 PM PST
Top Contributor
268 Forum Posts

Yeah,this isnt difficult.

All you need to do is write a bootloader which utilizes a custom communication protocol,here SPI with the SD card.

Use the SD card component(emFile one.) thats included in Creator 2.0,and use its functions inside the 5 functions(start,stop,write read and something..) you need to write out to implement a bootloader that uses a custom communications protocol.There is an appnote on writing your custom bootloader,but I'm just too sleepy to find and paste the link here.The search box should serve you well.

I had a working solution to this effect before my harddisk crashed.(also had an almost working wireless bootloader too :( )

But that emFile thingy takes up a good deal of flash and ram.

Maybe it would be better to write out your own minimalist mmc interfacing code in assembly,so that it takes up very little code space,and executes faster too.



Re: Bootloading without a bootloader host

kmmankad posted on 02 May 2012 02:15 PM PST
Top Contributor
268 Forum Posts

What I had setup was a bootloader that gave a menu on (USB)UART through which you could select which file to boot from in the SD card's root.

If no SD card was found,it would go bootload itself via USB HID.Else would go for the SD card.

Lots of possibilites here.Wireless  bootloading too,like I mentioned.I tried using the CYRF6936 wireless modules and created a custom bootloading component.



Re: Bootloading without a bootloader host

kmmankad posted on 02 May 2012 02:15 PM PST
Top Contributor
268 Forum Posts

I hate exams.Havent tinkered with my psoc stuff since ages 'cuz of them.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20