You are here

SD Card based bootloader for PSoC3 | Cypress Semiconductor

SD Card based bootloader for PSoC3

Summary: 10 Replies, Latest post by Kabron on 29 Jan 2014 06:43 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
user_66945721's picture
256 posts

Hey,I've written out a proof-of-concept SD card based bootloader.

The Bootloader will write a pre-specified file from an attached SD Card(SPI interfaced) to
the chip's flash,and execute a software reset following that.

This is actually a stock USB HID bootloader that has been given this extra functionality.After an SD card bootload
attempt,the bootloader will enumerate as a USB HID too,and can accept the program CYACD file from there as well.
Hence this extra feature can be added easily to any kind of existing bootloader,or can also function standalone.

Note that this uses the emFile Component,and hence will need its dependent source files which can be downloaded from

This code has been tested with the CY8CKIT-030,and the microSD module from with PSoC Creator updated to Component Pack 3.

Find the code here

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

PSoC Rocks,






LookAtSystemSolutions's picture
31 posts

That is an interesting concept. I wonder if this will be picked up here in the forum.

Are there more members here that have tried this out?

Just curious.

user_78878863's picture
2551 posts

Great work! Do you know whether this will work on a PSoC5? Or will it need modifications?

user_66945721's picture
256 posts


thanks for the kind words guys.

Yes,this can most definitely work with the PSoC5,only the method of creating the emFile part will change.I dont have a PSoC5 kit around,so cant test it.

But it works beautifully with the PSoC3 :-D


Actually this can be made more streamlined my modifying the cy_boot component itself.But I didnt want to touch that,so this currently has code thats added onto a USB Bootloader.

user_66945721's picture
256 posts

Also,this takes up quite a bit of flash,which can be reduced by writing your own SDCard interfacing routines.I plan to do that sometime in the future,so lets see.The emFile ones,while convinient,seem to take up some flash space.

user_66945721's picture
256 posts

(Sorry,I should keep it all in one post.I recall stuff just after I hit 'Submit')

This doesnt do any checksum stuff,because I believe in an ideal world.But its really simple to implement the Basic Summation type of checksum.

This also doesnt check the SiliconID and revision.I mean,the code is there,but I've commented it out.

srim's picture
Cypress Employee
111 posts

 Great work kmmankad :) You can try out the new PSoC creator 2.1 (EA) to modify the bootloader alone without meddling with Cy_Boot component as it is a seperate component consuming much smaller size.

igp1's picture
1 post

 hi ,i am using psoc 5lp board i am writing data in to 8 gb sd card  through sd card mode protocol (4 bit sd  card mode)  if any emfile is there please give link 

user_39759791's picture
357 posts

 you mean you need a link to the emFile firmware library?

here it is

user_11721473's picture
48 posts
Hello, kmmankad
I'd ported your great project to PSoC5LP and stopped at writing to flash function CyWriteRowFull.
The program fells into exception trap CY_ISR(IntDefaultHandler) in CM3Start.c module.
Before, I tested that this function works fine with  USB HID Bootloader part of your program.
Also, the program finished successfuly if I comment CyWriteRowFull call.
So, I have no idea what it could be. Hope you have more experience to clear the problem.

Thanks in advance,


user_11721473's picture
48 posts

P.S. Here is the project Bundle

Log in to post new comments.