Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Andy Ayre

#44
General / Failed To Autobaud
July 07, 2009, 01:55:29 PM
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.

For example for the LPC1100 family pin P0.1 must be held low during reset until the reset has completed to activate the UART bootloader. Pin 0.3 must also be held low during reset to activate the CAN bootloader.

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.
#45
Previously code read protection was enabled by checking a box in the main window of Flash Magic. This supported only level 2 of CRP.

Starting with Flash Magic 5.11 the code read protection setting is read from the hex file and all CRP levels are supported. If an attempt is made to set the device to CRP3 then the user is prompted for confirmation.

To set the CRP value in your project add something like the following (Keil RealView example):

const unsigned long crp __attribute__ ((at(0x1FC))) = 0x87654321;

or:

const unsigned long crp __attribute__ ((at(0x2FC))) = 0x87654321;

If you don't wish to use CRP then set the value to zero.

If you have previously programmed hex files without problems and now find that you cannot read the contents of memory or access a few other features then this change is the likely cause. Erase all the flash in the device and add the above line (or similar).

Andy
#47
Announcements / Email Addresses Ending in .info
June 03, 2009, 09:16:37 AM
Effective immediately it is no longer possible to sign up for an account on this forum with an email address ending in .info.

It seems the .info TLD has become a popular target for spammers. In the entire history of this forum no real user has signed up with a .info address and made any postings. However spammers are doing this continually with many different domain names. It's unfortunate that whoever controls the .info TLD is letting it be used like this.

If you wish to post on this forum and your email address happens to end in .info then we encourage you to sign up using your work email address or something else. Sorry to anyone who has a legitimate .info domain name and wishes to use this forum, we hope you understand.
#51
General / Running Flash Magic on Linux
November 19, 2008, 07:34:19 PM
Please see this blog posting with steps and screenshots:

http://karuppuswamy.com/wordpress/2008/11/20/flashmagic-on-linux-using-wine/

Andy
#52
General / MOVED: Re: Debugging ISP Problems
September 22, 2008, 08:22:32 AM
#56
LPC2xxx / MOVED: Regarding Flash Magic CUI
February 26, 2008, 07:43:47 AM
#57
Announcements / Google GMail
January 14, 2008, 08:39:03 AM
We have been receiving some particularly nasty pornographic spam from people registering under gmail accounts. When we reviewed Google's gmail requirements to report account users we saw that they are only interested in illegal activities. Unfortunately we have had to suspend new account activation at this time for people using gmail accounts. As this is a professional forum our recommendation is to use your work address, or another email service. Sorry for the inconvenience this may cause.

Andy
#58
Feature Requests / MOVED: Some Bug Report
December 26, 2007, 08:10:03 AM
#59
LPC2xxx / Missing Line Feed Problem
December 13, 2007, 01:11:14 PM
There has been a sporadic problem with some LPC2xxx devices where the device failed to transmit line feeds. Unfortunately both NXP and ourselves never had a device in front of us that failed in this way.

Version 4.10 of Flash Magic is now available that works around this problem, so if we previously diagnosed your problem as the missing LF issue, please give it a try. If you run into problems post a message so we can take a look.

Andy
#60
Go to: http://www.teamfdi.com/products/usb-icp/usb-icp.shtml and update the firmware in your USB-ICP device to at least v1.6. This fixes a
global erase bug.

Go to Options -> Advanced Options -> Security and uncheck "Protect ISP code".

In step 1 in the main window select your ICP interface.

In step 2 in the main window select "erase all flash".

Click on "Start".