Propeller SD Card boot loader with Xbee RF module and XMODEM File upload suppor
Mike Cook
Posts: 829
Sorry this post got long & rambling.....
Here's a start of a project that I'm currently working on. I'm posting this in the hope that it might help someone and or further contributions can be made to it. I don't program for a living, you can probably tell that from my 'Top File'! This is purely a relaxation hobby for me!
What it does:
1. Boot loader loads a *.binary file from the SD card and executes it.
2. If the *.binary file is not on the SD card then the boot loader invokes a XMODEM method to upload a file to the SD card.
3. If the XMODEM transfer was successful then the XMODEM program will reboot the propeller so the boot loader, stored in EEPROM, will execute the program.
Program requirements:
1. Propeller Demo Board or ProtoBoard with a SD card interface installed on PINs 0..3
2. Maxstream Xbee module installed on PINs 4 & 5
3. Optional: TV interface installed on PINs 12..15, used for the *.binary that is loaded from the SD card. In this example I have complied the Parallax Graphics_Demo.spin file to a binary.
How to use:
1. Build the hardware as described above.
2. unzip the archive: SD_SpinLoader_Serial_w_XMODEM.zip
3. If no modifications are needed to your Propeller platform then compile the top file: SD_SpinLoader_Serial_w_XMODEM.spin and load with F11. Otherwise study the top file and make changes as necessary.
4. Start your terminal program (HyperTerm used in the example), and connect to the communications port that your Xbee transceiver is installed on.
5. Turn on or reboot your Propeller board.
6. When prompted, then upload the 'BOOTFILE.TXT' via XMODEM
Tips to avoid cursing:
1. Make sure your MaxStream Xbee's can communicate with each other before using them with this program. Maxstream's $99.00 development kit will come in handy here. If your cheap/frugal then you can build your own Xbee development kit, and purchase 'bare' modules.
2. Make sure your Propeller can communicate with the SD card - search the Parallax Propeller forums and/or my top file has some links to the various objects used to create this boot loader.
3. One of the MaxStream Xbee's is connected to the PC running Hyperterm, this is the 'Base Station' used to communicate with the Boot Loader. The other MaxStream Xbee is connected to the Propeller board.
4. Both MaxStream Xbee's are left at their factory defaults. Only modifications I've made to the Xbee's was to make sure that they have the current firmware loaded. I've been receiving Xbee's with firmware version 1083. I have loaded all of mine with firmware 10A5 - Gives I/O support.
TODO:
1. Lots of refinements!
2. Want to use the Xbee's I/O to be able to remotely reboot the propeller using the RES line.
3. Boot loader needs to be able to monitor an Xbee I/O line to determine if the Base Station has rebooted the propeller system.
4. Add download support to the boot loader.
5. Dump Hyperterm for Procomm and write a Procomm script to automate the process and/or item 6.
6. Convert the Xbee 'Base Station' to operate via Telnet using either a Rabbit Semiconductor RCM3700 or SitePlayer Telnet module. Internet Control!
Files contained in the archive:
Questions:
I'll try to answer, but I frequently get very busy and disappear. From my testing this works as described.
Credits:
TopFile derived from:
Mike Green's FemtoBasic v2.002, with Tomas Rokicki's FAT16 SD Support
Simon Ampleman's XModem Wave Player's XMODEM method.
Links.....
SD Support:
http://tomas.rokicki.com/fat16work/
http://forums.parallax.com/showthread.php?p=622673
FemtoBasic:
http://forums.parallax.com/showthread.php?p=634092
XModem_Wave_Full:
http://forums.parallax.com/showthread.php?p=619134
Have Fun & Happy Holidays!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Post Edited (Mike Cook) : 12/27/2007 2:48:21 PM GMT
Here's a start of a project that I'm currently working on. I'm posting this in the hope that it might help someone and or further contributions can be made to it. I don't program for a living, you can probably tell that from my 'Top File'! This is purely a relaxation hobby for me!
What it does:
1. Boot loader loads a *.binary file from the SD card and executes it.
2. If the *.binary file is not on the SD card then the boot loader invokes a XMODEM method to upload a file to the SD card.
3. If the XMODEM transfer was successful then the XMODEM program will reboot the propeller so the boot loader, stored in EEPROM, will execute the program.
Program requirements:
1. Propeller Demo Board or ProtoBoard with a SD card interface installed on PINs 0..3
2. Maxstream Xbee module installed on PINs 4 & 5
3. Optional: TV interface installed on PINs 12..15, used for the *.binary that is loaded from the SD card. In this example I have complied the Parallax Graphics_Demo.spin file to a binary.
How to use:
1. Build the hardware as described above.
2. unzip the archive: SD_SpinLoader_Serial_w_XMODEM.zip
3. If no modifications are needed to your Propeller platform then compile the top file: SD_SpinLoader_Serial_w_XMODEM.spin and load with F11. Otherwise study the top file and make changes as necessary.
4. Start your terminal program (HyperTerm used in the example), and connect to the communications port that your Xbee transceiver is installed on.
5. Turn on or reboot your Propeller board.
6. When prompted, then upload the 'BOOTFILE.TXT' via XMODEM
Tips to avoid cursing:
1. Make sure your MaxStream Xbee's can communicate with each other before using them with this program. Maxstream's $99.00 development kit will come in handy here. If your cheap/frugal then you can build your own Xbee development kit, and purchase 'bare' modules.
2. Make sure your Propeller can communicate with the SD card - search the Parallax Propeller forums and/or my top file has some links to the various objects used to create this boot loader.
3. One of the MaxStream Xbee's is connected to the PC running Hyperterm, this is the 'Base Station' used to communicate with the Boot Loader. The other MaxStream Xbee is connected to the Propeller board.
4. Both MaxStream Xbee's are left at their factory defaults. Only modifications I've made to the Xbee's was to make sure that they have the current firmware loaded. I've been receiving Xbee's with firmware version 1083. I have loaded all of mine with firmware 10A5 - Gives I/O support.
TODO:
1. Lots of refinements!
2. Want to use the Xbee's I/O to be able to remotely reboot the propeller using the RES line.
3. Boot loader needs to be able to monitor an Xbee I/O line to determine if the Base Station has rebooted the propeller system.
4. Add download support to the boot loader.
5. Dump Hyperterm for Procomm and write a Procomm script to automate the process and/or item 6.
6. Convert the Xbee 'Base Station' to operate via Telnet using either a Rabbit Semiconductor RCM3700 or SitePlayer Telnet module. Internet Control!
Files contained in the archive:
SD_SpinLoader_Serial_w_XMODEM.spin : Top file 256_FullDuplexSerial.spin : Had to have a larger serial send/receive buffer fsrwFemto.spin : Support Object for top file sdspiFemto.spin : Support Object for top file BOOTFILE.TXT : Graphics_Demo.spin, included with the Propeller Tool, complied to a *.binary and re-named ASCII_SETUP.JPG : Screen Shots of How HyperTerm is set up. COMx_Properties.JPG SendFile.JPG Folder - XMODEM_DOC : XMODEM info downloaded from the internet
Questions:
I'll try to answer, but I frequently get very busy and disappear. From my testing this works as described.
Credits:
TopFile derived from:
Mike Green's FemtoBasic v2.002, with Tomas Rokicki's FAT16 SD Support
Simon Ampleman's XModem Wave Player's XMODEM method.
Links.....
SD Support:
http://tomas.rokicki.com/fat16work/
http://forums.parallax.com/showthread.php?p=622673
FemtoBasic:
http://forums.parallax.com/showthread.php?p=634092
XModem_Wave_Full:
http://forums.parallax.com/showthread.php?p=619134
Have Fun & Happy Holidays!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Post Edited (Mike Cook) : 12/27/2007 2:48:21 PM GMT
Comments
Some piece of work!
Mind if I incorporate this code into the BBS project I'm re-writing?
Might be interesting to see if we can launch some spin code from
a few thousand miles away. <smirk>
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Getting started with the Protoboard? - Propeller Cookbook
Got an SD card? - PropDOS
A Living Propeller FAQ - The Propeller Wiki
(Got the Knowledge? Got a Moment? Add something today!)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
However, Maxstream changed course over the summer and introduced the model 2, which supports mesh.
Long story short, I am stuck with dozens of Xbee and Xbee Pro modules that can only do Broadcast and Point-To-Point.
The promised Mesh firmware didn't work out.
I was deeply sidetracked when the Propeller was made available. I intend to the tracking system, but i have several ideas cooking with the propeller as a more powerful cpu and ultrasonic localization.
May I look at your code and possibly work synergistically with you?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH
Sure, have fun with what is posted.
I too just recently started with the Xbee's Series 1 and then later discovered that only the Series 2 support mesh networking. However from my testing I've found that the XbeePro's work the best, for my application (Back yard pool and lighting application). To date I have not seen a XbeePro Series 2 available to purchase as 'bare' modules. But for right now, the Series 1's will work for me since I'll be doing a 'Star' network.
Lots of stuff to do and so little free time!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Post Edited (Mike Cook) : 12/26/2007 5:04:12 PM GMT
1. Had a bug in 256_FullDuplexSerial, corrected and tested.
2. Bug in above file was causing the problem with the first XMODEM packet being sent twice. Removed the 'shotgun fix' of filtering out the first XMODEM packet in the file: SD_SpinLoader_Serial_w_XMODEM.spin
3. Added file name support, XMODEM upload now prompts for File name. No error checking or back spacing allowed, limited to 12 characters, i.e. xxxxxxxx.xxx
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm