Editing Linuxstamp

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 38: Line 38:
  
 
When you plug the Linuxstamp into your host (Linux) machine a device should appear '''/dev/ttyUSB0''' (I think the postfix number will increment as you add more devices). '''/dev/ttyUSB0''' will behave as any other serial port now. '''Minicom''' is the standard program to access the serial port in Linux. The first time you run minicom you will have to be root in order to do the setup, after that you can change the permissions on /dev/ttyUSB0 so any user can run minicom. To enter configuration mode in minicom type '''CTRL-A o''', now scroll down to '''Serial port setup'''. Use the letters to navigate. You will want the device to be '''/dev/ttyUSB0''' and '''Bps/Par/Bits''' to read '''115200 8N1'''. Both hardware and software flow control should be OFF. Connection to the board is important for loading Atmel's tiny program and u-boot, but once the board is working it might not be as important.
 
When you plug the Linuxstamp into your host (Linux) machine a device should appear '''/dev/ttyUSB0''' (I think the postfix number will increment as you add more devices). '''/dev/ttyUSB0''' will behave as any other serial port now. '''Minicom''' is the standard program to access the serial port in Linux. The first time you run minicom you will have to be root in order to do the setup, after that you can change the permissions on /dev/ttyUSB0 so any user can run minicom. To enter configuration mode in minicom type '''CTRL-A o''', now scroll down to '''Serial port setup'''. Use the letters to navigate. You will want the device to be '''/dev/ttyUSB0''' and '''Bps/Par/Bits''' to read '''115200 8N1'''. Both hardware and software flow control should be OFF. Connection to the board is important for loading Atmel's tiny program and u-boot, but once the board is working it might not be as important.
 +
<br><br>
  
The default installation of minicom does not automatically include the XModem file transfer module 'sx' which you will need to send files.  It is part of the Linux package named lrzsz ([http://packages.debian.org/lenny/lrzsz lrzsz]).  Just type 'sx' at a command line to see if it is installed.  If not, install the lrzsz package and minicom will find and use 'sx' automatically.
+
XModem transfers between Minicom and U-Boot seem to work fine. This means that you can update U-Boot itself as well as the kernel and root file systems using Minicom. However, the built in xmodem in minicom does not seem to work with the hardware bootloader in the AT91RM9200. If you see "Retry 0: NAK on Sector", you have likely hit this problem. The folks at [http://www.koansoftware.com/it/art.php?art=68 Koan] have created a workaround. The one thing you have to do is edit the .c file for the proper serial port ttyUSB0 in my case. (This link does not seem to work any more, does someone have an alternate?)
 
 
XModem transfers between Minicom and U-Boot seem to work fine. This means that you can update U-Boot itself as well as the kernel and root file systems using Minicom after getting U-Boot itself installed via the built-in hardware bootloader in the AT91RM9200.  The bootloader is much more finicky than U-Boot itself, so getting U-Boot installed can be tricky.  Here is my technique:
 
 
 
* Connect the USB cable to LinuxStamp and start minicom from a terminal window.
 
* Boot the LinuxStamp.  You should see CCC... on the minicom console, with a new C every second or two.
 
* Hit Enter twice.  This will stall the bootloader, and the CCC... sequence will stop.  It will also synchronize the USB/serial converter.
 
* Hit Ctrl-A Z S sequence to bring up the file transfer dialog in minicom.  Select XModem and navigate to and select your u-boot.bin file (space bar).
 
* Hit Enter to start the xmodem transfer in minicom.
 
* Press and release the reset pushbutton on the LinuxStamp. The transfer should happen very quickly (a few seconds).
 
* Immediately hit Enter twice when you see the transfer complete.  You *must* do this very quickly (within 1 second or so), and you *must* hit Enter twice. The first time exits the minicom file tranfer dialog, and the second time stalls the newly-loaded U-Boot program so that it doesn't try to auto-run the not-yet-loaded Linux kernel image.
 
 
 
You now have U-Boot in RAM, but not yet in flash. However, U-Boot is a lot nicer than the hardware bootloader, so you can now use U-Boot to load itself into flash by using the U-Boot menu and retransferring the u-boot.bin file again. This second time, the transfer will end up in flash, and will persist through poweroff/on.
 
  
 
Another alternative is to use HyperTerm on Windows, which works fine with the Hardware boot loader. If you are updating the Darrel Bootloader, note that the loader only has a short delay after you initiate the "receive" (on the loader) after which it send out the "ready to receive" signal. As a result, you'll need to be rather quick to initiate the Xmodem "send" (on HyperTerm). If you are seeing time outs on HyperTerm when you try and send the loader.bin file, you are probably hitting this problem ... you need to have initiated the send before you see the "C" on the screen from the bootloader.
 
Another alternative is to use HyperTerm on Windows, which works fine with the Hardware boot loader. If you are updating the Darrel Bootloader, note that the loader only has a short delay after you initiate the "receive" (on the loader) after which it send out the "ready to receive" signal. As a result, you'll need to be rather quick to initiate the Xmodem "send" (on HyperTerm). If you are seeing time outs on HyperTerm when you try and send the loader.bin file, you are probably hitting this problem ... you need to have initiated the send before you see the "C" on the screen from the bootloader.

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)