Shop OBEX P1 Docs P2 Docs Learn Events
SDloader100 - An SD card bootloader — Parallax Forums

SDloader100 - An SD card bootloader

Brian RileyBrian Riley Posts: 626
edited 2010-06-24 03:34 in Propeller 1
SDloader ver 1.00 - requires a 64K boot eeprom and an SD card (FAT16) and reader. It is a bootloader that resides in lower half of boot EEPROM. You need a Prop Plug, usB2SER, Prop clip et al. to initially load the bootloader, but then withh SDloader in place your Prop board can be field updated with an SD/uSD card.


SDloader started out of a discussion and some code from JonnyMac

http://forums.parallax.com/showthread.php?p=904118

and includes bits and pieces from work by Matthew Cornelisse (Obex #473) and Nick McClanahan and a lot of past work by Mike Green as well as a big fix for me last night from Mike.

Below is a picture of my test platform, a Propeller Platform with two 24LC512s and a microSD (uSD) platform module reader. I have also tested on a Propeller Platform SD board with 1 24lC512 and on board uSD reader.

Below, also is a zip file with all object sources needed

cheers ... BBR


How to use:

1) Load this code to propeller in normal load to low EEPROM fashion

2) open the actual firmware file you want to be on the propeller

3) select save to EEPROM file and name it "update.pgm" and save to SD card

4) insert SD card to propeller system and power up

5) sdloader will read and load "update.pgm" to high EEPROM, erase the file then load from high EEPROM to RAM and begin running the new program

6) if you have a need to load a large number of boards with the same file create and save to the SD card an empty file named "nodelete.txt". This will stop sdloader from erasing the file

Additional features

7) If you need to update the sdloader program itself repeat steps 2-5, except name the file "loader.pgm" and it will be loaded into low EEPROM, step 6 also applies with regard to file erasure.

8) If you want/need to run a program for a quick test, you may open the file and save to EEPROM file, naming it "run.pgm" and save it to the SD card. sdloader will see this and load it directly to RAM and run it. No erase option is available. Upon power cycling or hitting reset no trace of the program is left on the hardware except the file on the SD card.

9) ANY or ALL of the three .PGM files may be present on the SD card. sdloader looks first for "loader.pgm", then "update.pgm" and then "run.pgm"

10) If there is a "run.pgm" the load is terminated by the new load and run. If not it drops down to step 11.

11) If no SD card is present, or an SD card is present, but none of the named files are there, sdloader drops to load from high EEPROM to RAM and run.

12) In step 10 if no intelligible program is in high EEPROM it will still be loaded to RAM and run ... ya get what you get!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear

Post Edited (Brian Riley) : 5/9/2010 7:52:40 PM GMT

Comments

  • wjsteelewjsteele Posts: 697
    edited 2010-05-10 14:11
    Very nice... thanks!
  • KPRKPR Posts: 189
    edited 2010-05-10 18:05
    Brian.. Great job.. I can't wait for my new board so I can play with your code.. I've been attempting to do something similar for the past 4 months, but never get the time to sit down and try to get the code written..

    I originally wanted to use 128k eeproms, using 4 separate 32k areas, but of course the 128k chips are different from there 64k and 32k little brothers.. which is a shame considering I have 6 of them..

    k.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I always have someone watching my back.
  • Nick McClickNick McClick Posts: 1,003
    edited 2010-05-10 18:27
    I updated the Propeller Platform SD so that it includes this firmware - it's awesome!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Forums RSS Feed!

    Gadget Gangster - Share your Electronic Projects
  • Brian RileyBrian Riley Posts: 626
    edited 2010-05-10 22:36
    KPR said...
    Brian.. Great job.. I can't wait for my new board so I can play with your code.. I've been attempting to do something similar for the past 4 months, but never get the time to sit down and try to get the code written..

    I originally wanted to use 128k eeproms, using 4 separate 32k areas, but of course the 128k chips are different from there 64k and 32k little brothers.. which is a shame considering I have 6 of them..

    k.

    The Propeller Platform has slots for 2 24LC512's. Its a simple matter to add two more calls to loadEEPROM to $A2/$0000 and to $A2/$8000 to load programs into lower and upper second EEPROM. just name the files "update1.pgm" (first EEPROM - upper), "update2.pgm" (second EEPROM - lower) and "update3.pgm" (second EEPROM - upper) ... but then it gets tricky. How do you tell it which one to load and run? Two spare I/O pins and jumpers would do it.

    cheers ... BBR

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cheers ... brian riley, n1bq, underhill center, vermont
    The Shoppe at Wulfden
    www.wulfden.org/TheShoppe/
    www.wulfden.org/TheShoppe/prop/ - Propeller Products
    www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
  • KPRKPR Posts: 189
    edited 2010-05-11 15:56
    I think having two 64k areas controlled by a jumper/dip switch block would be the best.. I was looking more of having a backup boot, and your right, having all 4 32k Blocks would be confusing and I can see how easy it would be to screw it up.. [noparse]:)[/noparse]

    k.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I always have someone watching my back.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-11 16:02
    There's an "old" program called "Propeller OS" written some years ago that includes a PASM I2C driver that's the predecessor to sdspiFemto. It includes a command interpreter and an EEPROM file system that maintains named 32K EEPROM blocks and can load them by name (and copy / delete them). The link is in Graham Stabler's Good Thread Index: http://forums.parallax.com/showthread.php?p=609066.

    The file name and some other information is kept in the last 16 bytes of each 32K block. You can have up to 512K of EEPROM attached to each pair of I/O pins. The initialization routine scans for EEPROMs on pins 28/29 and there's a command that will look at other pairs of pins. The EEPROM can be any combination of sizes from 32K to 128K.

    Post Edited (Mike Green) : 5/11/2010 4:07:56 PM GMT
  • Brian RileyBrian Riley Posts: 626
    edited 2010-06-24 00:25
    I finally got around to posting this to the OBEX.

    obex.parallax.com/objects/620/


    cheers ... BBR

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cheers ... brian riley, n1bq, underhill center, vermont
    The Shoppe at Wulfden
    www.wulfden.org/TheShoppe/
    www.wulfden.org/TheShoppe/prop/ - Propeller Products
    www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-06-24 01:23
    I thought the 128KB EEPROMs were backwards compatible. Need to recheck the specs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • Brian RileyBrian Riley Posts: 626
    edited 2010-06-24 03:34
    Cluso99 said...
    I thought the 128KB EEPROMs were backwards compatible. Need to recheck the specs.

    For the Microchip 24xx1025 There is a small hardware difference. The address lines A0 and A1 area 'addressable' ... but A2 must be hardwired to Vcc (logic 1), essentially it acts as a chip select. Left floating or at Vss (logic 0) the chip won't work.

    Cheers ... BBR

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cheers ... brian riley, n1bq, underhill center, vermont
    The Shoppe at Wulfden
    www.wulfden.org/TheShoppe/
    www.wulfden.org/TheShoppe/prop/ - Propeller Products
    www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
Sign In or Register to comment.