CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

SPI bootloader over MMC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
f00dstamps



Joined: 28 Mar 2006
Posts: 10
Location: Kansas City, MO

View user's profile Send private message AIM Address

SPI bootloader over MMC
PostPosted: Thu Apr 20, 2006 4:43 pm     Reply with quote

do you all think it's possible to bootload via SPI using a hex file stored on an MMC/SD card? i don't think i could store all the code that would read data from the MMC and store it into program space in 256 words.

please advise.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Apr 20, 2006 6:55 pm     Reply with quote

Yes it is possible. Why does the bootloader need to fit in 256 words?
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
f00dstamps



Joined: 28 Mar 2006
Posts: 10
Location: Kansas City, MO

View user's profile Send private message AIM Address

PostPosted: Thu Apr 20, 2006 10:11 pm     Reply with quote

i don't know much about bootloaders but from what i've read, i thought they had to be smaller than 256 words in the 1st part of program memory. can you give me instructions on what i need to do to implement bootloading from an MMC?
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Apr 20, 2006 10:56 pm     Reply with quote

There is no limitation to the size of a bootloader. The size depends on the complexity of the technology being used and the capabilities built into the bootloader itself. There are a couple of different approaches - this that require a dedicated client that put all the intelligence at the PC end. This means you have a small footprint in terms of PIC resources but little fault tolerance at the PIC end. The other puts the intelligence into the PIC enabling a range of standard pc appliications, such as Hyperterm, to be used.

In terms of footprint versus technology, one of my bootloaders is an Ethernet bootloader capable of bootloading a remote PIC as long as the PIC is reachable over the internet. If you think about it, it requires the bootloader to have an (admittedly cut down) IP stack. It also has to deal with an external Ethernet controller and survivability (remote system). This bootloader is over 4K in size.

In terms of how to build a SPI bootloader that will load from an MMC card. There are many ways to skin a cat. One way is to follow the old PC DOS model, put a "bootstrap loader" in the master boot record of the MMC. In this approach the PIC contains a very primitive bootloader with enough intelligence to initialise the SPI interface and read the first physical sector (containing the next stage of the bootstrap loader). This code is programmed into flash using standard table write mechanisms. The PIC then jumps to this code. This code then downloads a full bootloader from the root directory of the MMC card (that you put in a file called something like MSDOS.SYS) and programs it into flash. This may be enough alternatively you may need to go to the next step and bootstrap the last part of the bootloader. This bootloader will have sufficient intelligence to read a fat file system, search for a file (like command.com) and load this code into the PIC. The PIC then passes command to this code.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group