Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

How to reflash your mini


  • Please log in to reply
7 replies to this topic

#1 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 24 March 2011 - 11:19 PM

This is a howto on reflashing your mini from scratch

Surely there are several similar ways of doing just that, but this is how I did it and it worked well for me. This howto is somewhat of a compilation of several different threads on similar topics and based on the valuable inputs of many.

EDIT: Just found this nice post on reflashing the mini with lots of pictures to go with it.

Note: The procedures described herein are not necessary if you're simply looking to update the firmware of your mini, i.e. it hasn't locked up or anything. If the former is the case, you can just skip directly to 3.9.

Requirements, apart from the mini itself of course, are:

  • 1.1. A USB->RS232 cable*, i.e. the real thing, not TTL levels
  • 1.2. Preferably a serial cable with female DE9 (also called DB9) plugs in both ends
  • 1.3. A pretty crisp 9v battery or a 7-12v wall outlet adaptor
  • 1.4. Version 2.10 of SAM-BA, available from the Atmel homepage
  • 1.5. The RS232 version of TinyBooterDecompressor.bin**
  • 1.6. The firmware version you wish to flash
  • 1.7. A breadboard or what have you
*) You can also use a 3.3v TTL cable (like FTDI) but you'll need a levelshifter. If your computer got an old fashioned RS232 connector, you can skip the USB->RS232 cable all together and connect the serial cable directly to your computer. Not many computers have serial these days (remember the 16550).
**) You could use the TTL version but then you'll have to switch to a USB->TTL cable in between steps 3.8 and 3.9 below.


Now for some preparations before you proceeed:

2.1. Disconnect any and all wires from your mini, this is important!

2.2. Cut off the serial cable (1.2) to reveal the wires inside of it. Sort out the wires corresponding to these RS232 holes/pins:

  • RS232 hole/pin 2 = Rx
  • RS232 hole/pin 3 = Tx
  • RS232 hole/pin 5 = Signal ground (SGND)
Looking into the uncut end of your female DE9 plug, you'll see something similar to this:

 _________________
|  _____________  |
|  \ 5 4 3 2 1 /  |
| O \ 9 8 7 6 / O |
|    ---------    |
|______shield_____|
Tip: Usually these numbers appear as tiny engravings in the plastic housing of the DE9 just next to each of the holes/pins.
Note: When looking into a male DE9, the pins are mirrored.

2.3. Peel off your bared serial cable (1.2) wires a bit in their end points and use a conduction tester (beeper or similar) to identify what wire corresponds to the holes 2, 3 and 5 above respectively. Do this by sticking one testprobe into a hole while using the other to touch the wires one at a time til you get a beep (conduction). Do this for all the three holes 2, 3 and 5.

2.4. Preferably solder a little soldering material to the peeled off wire ends in order to make them a little more rigid.

2.5. Plug the uncut end of the serial cable (1.2) into your USB->RS232 cable (1.1) and connect the USB end of the latter to a free USB slot on your computer.

2.6. Preferably bridge holes 2 and 3 of the female DE9 (1.2) and use Putty or Hyperterminal to connect to the COM-port exposed by your USB->RS232 cable. Type a few letters and verify that they are echoed back to your terminal. If not, check your wires and correct them until you get an echo. Remember to remove the bridge before proceeding!

Ok, so here follows the actual reflashing of the mini:

3.1. Connect the plus and minus poles of your battery (1.3) to pins 24 and 23 respectively on your mini.

3.2. Connect a jumper wire from pin 21 (5v out) on your mini and hold the other end against the gold pad on your mini for about half a second. This will make sure that the on-board flash of your mini gets completely erased.

3.3. Disconnect power from your mini.

3.4. Connect the cut serial cable (1.2) wires 2, 3 and 5 to pins 1, 2, and 4 respectively on your mini. Optionally also connect the shield of your serial cable to pin 23 of your mini, I found this to make the connection a bit more stable.

3.5. Re-connect power to your mini.

3.6. Launch SAM-BA 2.10 (not CDC-version) and select the COM-port that your USB->RS232 exposes. Also select the chip named at91sam7x512-ek from the drop down list, then proceeed.

3.7. SAM-BA should now connect to your erased mini, if not, repeat from 3.2. After that, follow the exact steps in using SAM-BA as shown in this video by VCSandARM. In short summary:

Make sure the tab "Flash" i selected, then select "Boot from flash" in the command drop down, press execute. Next execute the "Enable flash access" command. Send the TinyBooterDecompressor.bin file (1.5) to flash, select "No" in when promted for lock regions. Use the compare function to verify what can actually be read from flash now matches what you just uploaded. If the data match, proceed to next step. If not, repeat the send and compare routine until they do.

3.8. Exit SAM-BA and power cycle your mini.

3.9. Launch MFDeploy.exe using the same COM-port as with SAM-BA. Try a few pings to make sure you have connection. If not, close MFDeploy.exe and repeat from 3.2.

3.10. In MFDeploy, select the firmware (1.6) you wish to reflash and deploy it to your mini.

3.11. All done, now go about doing some more really cool things with your resurrected Netduini mini - but try doing it a little differently this time since you nealy bricked it before :) :)

Should you find something to be incorrect in this howto, please reply to this post and I'll modify the howto accordingly.

Good luck!

#2 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 15 May 2011 - 10:52 PM

When you say "Launch SAM-BA 2.10 (not CDC-version)", what do you mean exactly? Where can the non-CDC version be downloaded from?

#3 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 19 June 2011 - 07:01 PM

Nevermind. Here's the link to all the various versions of SAM-BA on the Atmel site: http://www.atmel.com...sp?tool_id=3784, including the non-CDC version.

#4 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 27 June 2011 - 12:58 AM

Nevermind. Here's the link to all the various versions of SAM-BA on the Atmel site: http://www.atmel.com...sp?tool_id=3784, including the non-CDC version.

Sorry for not answering this one, I seem not to get any notifications of replies anymore. I'm truly sorry. As I recall, the CDC version uses ATMEL proprietary means of interfacing with the chip that is currently not supported by the Netduino. This is why you should use the non-CDC version of the flash utitilty from ATMEL. Hope this clears things.

#5 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 27 June 2011 - 08:11 AM

As I recall, the CDC version uses ATMEL proprietary means of interfacing with the chip that is currently not supported by the Netduino. This is why you should use the non-CDC version of the flash utitilty from ATMEL.

Just for clarification, CDC vs. non-CDC relates to USB communication and it is not really relevant in case of Netduino Mini, which can be only programmed over serial link - i.e. a COM port has to be selected in the SAM-BA user interface (the port may be virtual one if USB <-> RS232 converter is used).

To communicate over USB (with Netduino, Netduino Plus), SAM-BA can use either non-CDC or CDC channel. The non-CDC driver (atm6124.sys) is installed by default during SAM-BA setup, the device is recognized as "atmel at91xxx test board" and identified as "\usb\ARMx" in SAM-BA connection selection dialog.

For CDC channel, the driver has to be installed manually (see Readme_CDC.txt in SAM-BA 'documentation' folder), it is Windows built-in USB virtual COM driver (usbser.sys), the device is recognized as "AT91 USB to Serial Converter" and a COM port has to be selected in SAM-BA dialog.

Hope this helps.

#6 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 27 June 2011 - 07:53 PM

Thanks for following-up.

Here's what I discovered through my own experimentations:
  • SAM-BA CDC does not work to reflash a netduino-mini over RS232: it just hangs permanently right after selecting the port # and the board type. It does work for regular netduino / netduino Plus boards though.
  • To reflash a netduino-mini over RS232, use SAM-BA 2.9 (AT91-ISP.exe v1.13) http://www.atmel.com...sp?tool_id=3784
I found this to be true regardless of the machine architecture (32 bit or 64 bit Windows 7 in this case).

Cheers,
-Fabien.

#7 ludipipo

ludipipo

    New Member

  • Members
  • Pip
  • 6 posts

Posted 07 July 2011 - 07:46 AM

hi, the same preocedure is valid also for netduino plus? thanks, picunz

#8 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 07 July 2011 - 08:32 AM

hi,
the same preocedure is valid also for netduino plus?
thanks,
picunz

Hi picunz,

For the Plus, you can best follow these steps:
http://wiki.netduino...ep-by-step.ashx

-edit- just seen your other topic. Appairently you tried that already without success. Lets continue in the other topic :)

Edited by Stefan, 07 July 2011 - 09:07 AM.

"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.