FlashMagic Problem - Failed To Autobaud - Andy Ayre ESAcademy Staff Sr. Member Posts: 1830 « on: July 07, 2009, 09:55:29 PM »
http://forum.flashmagictool.com/index.php?topic=3628.0
If you are reading this you probably received an error message from Flash Magic telling you that autobauding failed. This is by far the most common problem that people run into and this post will provide some pointers.
Read this post entirely before posting a new topic or contacting us for help.
Because hardware and microcontrollers vary I will first give you the bad news - there is no magic one-size-fits-all answer to your problem. The solution depends on your situation and you will have to do a bit of investigating and understand what is happening. This is always the case when hardware is involved.
For People in India
We have a lot of people in India who have difficultly with autobauding. From trying to solve this problem with several people we have come to the conclusion that there are small shops selling microcontrollers that are not brand new and might have an unknown past. Only puchase brand new microcontrollers from authorized NXP distributors, otherwise you might be wasting a lot of your time.
Overview of Autobauding
What is autobauding? When the ISP bootloader in the microcontroller is started it waits for a special character (called the autobaud character) to be received on UART0. The character used varies depending on the device. Generally 8051 and XA devices use a 'U' while ARM devices use a '?'.
When the character is received the bootloader uses it to measure the baudrate you are using in Flash Magic. It then configures UART0 to use the same baudrate. Finally it sends a response back to Flash Magic.
In 99.9% of cases the error you are getting is caused by Flash Magic not receiving a response from the microcontroller. What could cause this? Some possible reasons are:
Using wrong COM port
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
A 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
You are using a P89V51Rx2 or P89LV51Rx2 and the autobaud character is not being sent in time
Let's examine each of these in turn and how you 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 (Thanks Jan for this one).
If 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
We have had a LOT of reports of problems with these cables. Some work well and some don't. There is no list of what does and doesn't work. This would be one one of the things we would suspect. Obtain a PC with a COM port. It is also possible to buy PCI cards with COM ports for desktop PCs.
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:
Go to Control Panel -> System -> Hardware Tab -> Device Manager
Expand Ports (COM & LPT) in the list
Right click over the COM port assigned to your USB cable
Choose "Uninstall" from the menu
Unplug the cable and plug it back in
Go through the driver installation steps
If that doesn't help then try:
Go to Control Panel -> System -> Hardware Tab -> Device Manager
Expand Ports (COM & LPT) in the list
Right click over the COM port assigned to your USB cable
Choose "Properties" from the menu
Click on the Port Settings tab then Advanced...
Choose a new COM port number, for example COM17. Don't pick one that it says is in use, even if it really isn't in use.
Click on OK then OK.
Unplug your USB cable and plug it back in.
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 will describe all the conditions necessary to start the 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.
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 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.
Additional Notes
Get the User Manual for your device from http://www.nxp.com/microcontrollers
Try communicating with the device using Hyperterminal. Use 8 bits, no parity, 1 stop bit, no flow control. Send the autobaud character and see if anything is echoed back. If it isn't then the problem is likely not with Flash Magic.
If communications work with Hyperterminal but not with Flash Magic then a possible cause is in how DTR and RTS are used. For example the Keil MCB900 board requires proper control of DTR to enable the outputs of the RS232 transceiver. Other boards may do something similar. Check the schematic diagram for your board and understand the requirements. Contact the vendor of the board if needed. In Flash Magic under Options -> Advanced Options -> Hardware Config try checking/ticking and unchecking/unticking the "Assert DTR and RTS while COM port open" option to see if that helps.
Some users have reported having PCs where DTR and RTS are inverted for some reason. It is always worth trying another PC of a different make or model to see if the problem appears there.
A good way of getting to a "known state" is to buy a tried and tested board from places like www.lpctools.com. These boards are low cost and if you buy a Keil board then typically the schematic diagrams are available on www.keil.com. Contact Keil for details on the diagrams. We typically use Keil boards in-house for developing and testing Flash Magic. If you contact us with a problem the first thing we will usually do is grab the appropriate Keil board and test with it.
Ultimately the best person in a position to track down and solve the problem is you. You have the PC, microcontroller, cables and hardware in front of you.
If you have gone through and checked everything in this posting and still feel you need help then we need a detailed email or posting on this forum with everything you know and understand about the problem. It is difficult for us to diagnose problems remotely and without detailed information your request for help will likely only result in us asking questions.
« Last Edit: April 30, 2010, 03:10:44 PM by Andy Ayre »
Re: Failed To Autobaud « Reply #1 on: May 12, 2010, 05:02:06 PM »
These are from Steve H (thanks Steve!):
Loopback check serial cable
Jumper pins 2 and 3 together then run Hyperterminal and see if you get an echo. If so, most likely your serial port and cabling are working fine.
Verify if you need a null modem or straight through cable
Some boards will require a null modem, while others need a straight though. It should be stated in the documentation. You sort of allude to this in the "additional notes" section, but you don't come right out and say it.
.END
http://www.ni.com/white-paper/3450/en
Overview
A loopback test allows you to send and receive data from the same serial port to verify that the port is operational. To perform this test, you need to temporarily connect the proper pins to allow signals to be sent and received on the same port.
Table of Contents
Loopback Test
Connectors
Performing a Loopback Test in Hyperterminal
Performing a Loopback test in Measurement & Automation Explorer
Performing a Loopback test in LabVIEW
1. Loopback Test
A loopback test can be used to troubleshoot serial communications. It can show problems in the serial port, the cable, or the software generating the messages without having to connect to third party hardware. By connecting the proper wires, a loopback test can verify the operation of serial communication. Loopback tests can be used for RS-232, RS-422, and RS-485 serial communication.
For more information on RS-232, RS-422, and RS-485 see the Serial Communication Overview. Note that not all serial devices, especially those with many connections on one card, allow hardware flow control on every serial output of the device.
To perform a loopback test for RS-232, the TXD pin must be connected to the RXD pin. This allows the data to flow from the transmit to the receive pins. Since the communication is differential for RS-422 and RS-485, the TXD+ connects to the RXD+ and the TXD- connects to the RXD- pins.
A more advanced loopback test that allows hardware flow control will need more pins connected to allow the flow control signals to be properly passed. For RS-232, the CTS and RTS pins must be connected along with the DTR and DSR pins. For RS-422 and RS-485, CTS+ should be connected to RTS+ and CTS- should be connected to RTS-.
For more information about National Instrument’s serial interfaces, visit ni.com/serial.
Back to Top
2. Connectors
DE-9 (DB9) Connector
The DE-9 connector is the most common serial connector. This connector is found on National Instrument’s one and two port serial interfaces.
Figure 1: Pinout diagram for DE-9 Connector
To perform a loopback test with no hardware flow control, you will need to connect pins 2 and 3 for RS-232 and pins 4 to 8 and 5 to 9 for RS-422/485. These connections can be seen in red below (figure 2 for RS-232 and figure 3 for RS-422/485).
When using hardware flow control, you will need to connect pins 4 to 6 and 7 to 8 for RS-232. Pins 7 and 8 are used for RTS/CTS hardware flow control where pins 4 and 6 are used for DTR/DSR hardware flow control. For RS-422/485, you will need to connect pins 2 to 3 and 6 to 7. Both of these connections are required for RTS/CTS hardware flow control since RS-422/485 have differential connections. These connections can be seen in blue below (figure 2 for RS-232 and figure 3 for RS-422/485).
Figure 2: RS-232 female DE-9 plug with connections required for loopback test
Figure 3: RS-422/485 female DE-9 plug with connections required for loopback test
DB-25 Connector
This connector is not as common as the DE-9 connector. This connector can still be used to perform a loopback test with a method similar to the one used for the DE-9 connector.
Figure 4: Pinout diagram for DB-25 Connector
Most of the pins on DB-25 connectors are not connected since only nine pins are used for RS-232, RS-422, and RS-485 communication.
To perform a loopback test with no hardware flow control with a DB-25 connector, connect pins 2 to 3 for RS-232. For RS-422/485 connect pins 5 to 20 and 7 to 22. The required connections can be seen in red on figures 5 and 6.
For hardware flow control using RS-232, pins 4 and 5 must be connected along with pins 6 and 20. When using RS-422/485, pin 5 must connect to pin 20 and pin 7 must connect to pin 22. This will allow the loopback test to use the proper flow control lines. These connections can be seen in blue on figures 5 and 6.
Figure 5: RS-232 female DB-25 plug with connections required for loopback test
Figure 6: RS-422/485 female DB-25 plug with connections required for loopback test
10P10C (RJ50) Connector
This connector is most commonly found on National Instrument’s 4 port serial interfaces. The National Instrument 4 port serial interfaces come with 4 10P10C to DE-9 male converter cables.
Figure 7: Pinout diagram for RJ50 Connector
It is not recommended to use the 10P10C connector by itself to perform a loopback test due to the small separation between pins. Using a 10P10C to DE-9 connector (Part Number 192190-01), a looback test can be performed using the methods described above.
3. Performing a Loopback Test in Hyperterminal
1. Create a new connection with any name and icon.
2. Select the communications port you would like to test
3. Select the type of flow control you would like to use. Note that Xon / Xoff is software flow control and will only require that the TXD and RXD pins to be connected.
4. Type a message using the computer's keyboard. Any data that shows in Hyperterminal is received from the device.
4. Performing a Loopback test in Measurement & Automation Explorer
1. Open Measurement & Automation Explorer and select the communications port you would like to use.
2. Ensure the proper settings are selected for flow control.
3. Save the settings by selecting the Save button then select the Open VISA Test Panel button
4. On the Write tab, type the message you would like to send (followed by a \n) then select Execute
5. On the Read tab, select Execute and verify the message
5. Performing a Loopback test in LabVIEW
Note: For a free evaluation copy of LabVIEW, visit ni.com/trylabview
1. Start LabVIEW
2. Select Help»Find Examples...
3. Browse to Hardware Input and Output»Serial»Basic Serial Write and Read.vi
4. Ensure the proper settings are selected, enter the string you would like to write in the "string to write" box, and then select the white run arrow on the toolbar.
.END
No comments:
Post a Comment