Flash Magic Tool Failed to Autobaud

In this post we’ll discuss most popular issue i.e. Flash Magic tool failed to autobaud faced by users especially beginners. I am sure you have encountered or seen this before. it’s an Operation Failed (failed to autobaud – Step1) while using Flash Magic to program microcontroller over serial RS232 cable. I have spent frustrating hours to deal with this issue and thought to write troubleshoot guide to address this problem.

The error message Flash Magic- Failed to autobaud is by far most common problem that people run into and there are several settings and procedure needs to be taken care of while loading Hex file into microcontroller using Flash Magic.

There can be several reason to get this error message one could be your microcontroller chip is not branded or from unauthorized distributor. That’s reason why solution to solve this issue depends on your situation and you must have to do little investigation and understand what is happening. Let’s first understand what this error message means and how it looks like:

Flash Magic Tool Failed to Autobaud
Flash Magic Tool Failed to Autobaud

What is Autobauding?

Failed to autobaud is something you can get when RS232 transfers, since RS232 is asynchronous, i.e. the receiver is internally clocking the time between when it will poll for the different bits. When you use Flash Magic, the boot loader doesn’t know what baudrate you have. And it doesn’t know what crystal you have connected to the microcontroller.
So initially, the boot loader in the processor uses the internal RC oscillator (IRC) for running the processor, and uses the auto-baud feature to try to measure the bit lengths to figure out what baudrate the PC sends the commands with. Some batches of LPC21xx chips fails this autobaud step unless you change down to very low baudrates. In my case, I have had some microcontrollers requiring 19200 baud and some have required 9600 baud. Maybe there are microcontrollers which require even lower baudrate for the autobaud to work. If the boot loader do manage to auto-baud, then Flash Magic can report the crystal oscillator frequency to the boot loader (that is one of the input fields when configuring Flash Magic), and the boot loader can then switch to the crystal for the rest of the transfer.

learn-embedded-system

In most of the cases error you are getting is caused by Flash Magic not receiving a response from the microcontroller:

  • Using wrong COM port in selection menu.
  • Serial cable is faulty or not connected to PC and RS232 transceiver on your hardware.
  • You are using a USB to RS232 cable which doesn’t work properly.
  • Improper or incomplete installation of USB driver is causing problems.
  • There is a bad solder joint on your hardware stopping the autobaud character from arriving at UART0 RXD.
  • The ISP bootloader failed to start.
  • The microcontroller cannot execute code because of no running oscillator, insufficient power supply, glitches on the power supply, etc.
  • The baud rate you are using is too high or too low.
  • If you are using a P89V51Rx2 or P89LV51Rx2 and the autobaud character is not being sent in time.
Unable to Communicate Flash Magic
Unable to Communicate Flash Magic

Let’s examine each of these in turn and how we can check them. They are in no particular order.

Using wrong COM port
Make sure you are using the correct COM port. If you are using a USB to RS232 cable or Future Designs USB interface then unplug the cable, go to Control Panel –> System –> Hardware –> Device Manager  –> Ports (COM & LPT) and see which COM ports are available. Then plug your cable back in and see which new one appears.

Serial cable is faulty or not connected to PC and RS232 transceiver on your hardware
Put an oscilloscope on the RIN pin of the RS232 transceiver. Click on Start in Flash Magic and watch for the autobaud character. If it doesn’t appear then try a different PC and serial cable. Try putting the oscilloscope on the COM port connector on your PC and checking there.
Check for an electrical connection between the Ground, TXD and RXD pins of the cable at each end. Note that a problem with the ground can stop communications from working. If in case you don’t have an oscilloscope then get one. They are required for developing with embedded systems and are necessary to see what is happening in the circuit. Without one you will run into constant problems and frustration that will waste days of your life.

You are using a USB to RS232 cable which doesn’t work properly
There are plenty of reports online which says problems with these cables (especially cheap and untrusted brands). Some work well and some don’t. There is no list of what does and doesn’t work. This would be one of the things we would suspect.

A USB driver is causing problems
If you are using a USB to RS232 cable or Future Designs USB interface and you have tried the above, then try the following steps:

  1. Go to Control Panel –> System –> Hardware Tab –> Device Manager
  2. Expand Ports (COM & LPT) in the list
  3. Right click over the COM port assigned to your USB cable
  4. Choose “Uninstall” from the menu
  5. Unplug the cable and Plug it back in
  6. Go through the driver installation steps

If that doesn’t help then try:

  1. Go to Control Panel –> System –> Hardware Tab –> Device Manager
  2. Expand Ports (COM & LPT) in the list
  3. Right click over the COM port assigned to your USB cable
  4. Choose “Properties” from the menu
  5. Click on the Port Settings tab then Advanced…
  6. Choose a new COM port number, for example COM9. Don’t pick one that it says is in use, even if it really isn’t in use.
  7. Click on OK then OK.
  8. Unplug your USB cable and plug it back in.
  9. Make sure the cable is assigned the new COM port number

There is a bad solder joint on your hardware stopping the autobaud character from arriving at UART0 RXD
Put an oscilloscope on the RXD pin of the microcontroller. If the pin is not accessible put the scope on the RXD signal as close as possible to the pin. Click on Start in Flash Magic and watch for the autobaud character. If it doesn’t appear then start checking at various points in the circuit working your way from the microcontroller to the RS232 transceiver.

The ISP bootloader failed to start
This is a common cause. The user manual for your device or microcontroller board will describe all the conditions necessary to start the ISP bootloader. You must check and make sure all of them are being met. Measure voltages and timing at the pins of the microcontroller.

The microcontroller cannot execute code because of no running oscillator, insufficient power supply, glitches on the power supply, etc.
Check all electrical aspects with an oscilloscope and make sure your circuit meets the AC and DC specifications in the data sheet for the microcontroller.

The baud rate you are using is too high or too low
The baud rates that can be used to communicate with the bootloader vary depending on the frequency of the oscillator being used. It is recommended to use at least 10MHz and 9600 baud. Try different baud rates. However the bootloader will only attempt to autobaud once after a reset so be sure to reset it between attempts.

If you are using a P89V51Rx2 or P89LV51Rx2 and the autobaud character is not being sent in time
These devices are different in how the bootloader is activated and it is important to understand these differences. They are not like other devices with similar names. Do not make assumptions about any particular device and how it works based only on the part number. Read the data sheet and user manual.

These devices must receive the autobaud character within a specific time after reset to enable the bootloader. Flash Magic can reset the device for you (with support in the hardware) or you must do it manually this all depends on your hardware. This setting can be found in Options –> Advanced Options –> Hardware Config. Uncheck/untick the “Use DTR to control RST” for manual resets. When clicking on the Start button a window will open telling you to reset the device. While the window is open Flash Magic is sending out a constant stream of autobaud characters. This is when you reset the device.

Before attempting to use the DTR option get it working without DTR. This simplifies the situation and reduces the potential for problems. If you still cannot get one of these devices to communicate with Flash Magic then use an oscilloscope to check that a constant stream of ‘U’s are arriving at the RXD pin of the microcontroller. This will look like a square wave. Then check if anything is being output on the TXD pin.

We hope this post will help you to resolve issue of Flash Magic tool failed to autobaud. If you still running problem to communicate with microcontroller then please read datasheet and user manual of your kit. I am sure every kit has supplied with User Manual with Microcontroller Kit. Please feel free to leave a comment and share your thoughts on topic. Good Luck !

Get Free Courses & Webinars
You'll receive only high quality learning material, tips & tricks
I agree to have my personal information transfered to MailChimp ( more information )
We respect your privacy

About Umesh Lokhande

Umesh Lokhande holds a Master degree in Scientific Instrumentation from University of Applied Sciences Jena, Germany. and has previously worked at Orbotech, Alere Technologies etc. Umesh is also a founder and first author of BINARYUPDATES.COM

Login

Register | Lost your password?