Flash Magic Forum

In-System Programming Support => LPC2xxx => Topic started by: tharkaway on August 27, 2007, 01:11:10 PM

Title: FlashMagic from Dell Core Duo Laptop
Post by: tharkaway on August 27, 2007, 01:11:10 PM
I am trying to use FlashMagic (Ver. 3.64.237) from a Dell Lattitude (core duo 2.0 GHz.) connecting to a LPC2103 device. Several other people with the company can successfully connect to the exact device, using the same cables I am using. I am also able to connect to the device when it is running its application program.

However when I try to connect and read the device's memory with FlashMagic, I get the following error - "Operation Failed. (failed to autobaud - step 1)". I get the same error using both the laptop built in COM 1 port and a USB com port configured as COM 4.

I was wondering if there might be some issues with the Core Duo processor and FlashMagic.
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Je Gold on August 29, 2007, 06:24:27 AM
Lets go back to basic serial comm's.

a)
Digital loopback test...to check serial port or ports
========================================

Run Hyperterminal  and 9600, n, 8, 1  -  echo off  - no hardware handshaking.

-->select "connect"

Connect pins 2-3 together on your cable  (that is TxD to RxD).....only connected to a PC nothing else.

Pressing keys should echo on your screen....... Of not you have comms problem.

Disclaimer - use at own risk.

b)  One of the comms ports could be the internal modem???

c)  Some Laptops  have poor RS232 drivers.

Joe
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: tharkaway on August 30, 2007, 12:09:56 PM
Both the built-in serial port and the USB serial adapter on the laptop work fine. I have test them each with other applications and with the LPC2103 when it is running its application program.
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on August 31, 2007, 09:08:24 AM
Try autobauding with your LPC2103 using Tera Term Pro or something similar. Use the same baudrate you are choosing in Flash Magic. Cut and paste what you get into your reply on here.

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 08:49:48 AM
I am having a similar problem with a LPC2378, it always reports failed to autobaud.  I know the port is communicating with the device because if I program with JTAG I can interact with my applicaion via HyperTerm.

The serial port is a hard port on a laptop.

How do you "autobaud" using hyperterm or terraterm?

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 09:06:32 AM
See the detailed instructions at: http://www.flashmagictool.com/debugstart.html

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 10:23:42 AM
That was very helpfull.

I sent a ? and it said syncronized.  Yet, I still can not program via flash magic.

I ran the following command line:
QUIET(FMOutput.txt)
COM(1, 9600)
DEBUG
DEVICE(LPC2378, 12.000000)
ERASEUSED(NewHex.hex, PROTECTISP)
HEXFILE(NewHex.hex, NOCHECKSUMS,NOFILL,PROTECTISP)
VERIFY(NewHex.hex, NOCHECKSUMS)

I have attached the fmd file generated.
Here is the contents of the FMOutput.txt:  Connection failed: invalid command

Any help is greatly appreciated.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 11:09:16 AM
Here is a snippet:

tx> ?
rx> \0


This means that Flash Magic transmitted a '?' and got a NUL (ASCII 00H) back. It looks like you are using DTR and RTS, but I don't see the HARDWARE directive being used on the command line. I would guess this has something to do with it. Why you used Hyperterminal how did you place the device into ISP mode? With buttons?

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 11:35:59 AM
We dont have the DTR or RTS hooked up.

I put the unit into the boot block by pressing a button.  After I do that, I run the command I showed you.

Or, IF I am in hyperterm, I launch hyperterm, press the button to go into the bootblock then type ? and it says synchronized

Thanks for the quick responses.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 11:56:56 AM
Go to Options -> Advanced Options and disable the DTR/RTS option.

Cycle the power on your board and use the buttons to reset the device into ISP mode.

Then go to ISP -> Read Device Signature

Let me know if that works or not. If not please generate a debug file.

regards, Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 12:17:13 PM
I got the same error withing the GUI.  I don't know how to make a debug file from the gui, so I modified my command file to be:

QUIET(FMOutput.txt)
COM(1, 9600)
DEBUG
DEVICE(LPC2378, 12.000000)
READSIGNATURE

The FMOutput is the same as before: Connection failed: invalid command

The FMD file is attached.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 12:20:24 PM
Now it looks like the device has already autobauded, which doesn't make much sense. Please try again but using the GUI version. Don't forget to disable DTR and RTS in the Advanced Options. To turn on the debug mode press F1. To turn it off press F2.

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 12:25:16 PM
You got it.  Here is teh FMD that results from:

Double-check RTS disabled setting in FM
Put device in boot block
Click Read Device Signature
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 12:31:18 PM
Hmmm...same as before. FM sends a '?' and gets a NUL back.

When you tested with Hyperterminal did you use the same serial cable, same hardware and same baud rate?

Are you using a USB to RS232 cable?

Can you try the Hyperterminal test again, cycling the power on the board and using the buttons to place the device into ISP mode before trying?

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 12:43:46 PM

Hi Andy.

Same cable is in use no matter what I am doing.  I just change apps.
Its a DB-9 serial port on a laptop.
Hyperterm still reports Synchronized as soon as I hit ?

Please let me know what to do next.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 01:05:40 PM

I installed a port sniffer and reran my original command line
Attached is what the port sniffer reported as well as the FM debug file.

Let me know if that uncovers anything helpfull.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 01:09:32 PM
Was the entire data in the spreadsheet generated using Flash Magic?

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 01:10:54 PM

The shaded rows are FROM flash magic
The unshaded rows are from the NXP

Did I answer the right question?

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 01:12:13 PM
The debug file in this case matches the spreadsheet. I now see "Synchronized" coming back. It is weird that the problem keeps changing. Does the error message change? In the first case I would have though it would be something like "autobauding failed step 1" and in the second case I would expect something else like invalid command.

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 01:14:20 PM
The FlashMagic IDE gives me failed at step 1.

The command line gives me invalid command

Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 01:16:50 PM
If you run the test repeatedly on the command line do you see the same thing from the port sniffer that was in the spreadsheet?

If you run the test repeatedly from the GUI do you see something different in the port sniffer output?

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 01:27:01 PM

The command line gets as far as sending 12000 (clock setting from the device line) and having it echoed back.  Then the port gets closed and reopened.  I did this three times, with a power cycle between each time.

This is weird.  Since installing the sniffer, the FM GUI now gets to trying to erase block 0 before it fails.

If we have to pick on, I need the command line to work much more than I need the GUI to work.

I attached fmd files for both GUI operation and Command Line operation.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 01:29:04 PM
Are you putting all the command line directives on one line, or all of them in a file and running witn fm.exe @filename?

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 01:33:22 PM

All on one line.  I broke them up in email for readability
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 01:52:48 PM
Please send me your hex file. If you don't want to make it public, please send to support @ esacademy . com. I will try your command line here. Thanks.

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 23, 2007, 01:57:02 PM

I just emailed it to you.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 23, 2007, 03:46:57 PM
Unfortunately I can't seem to reproduce the problem. Here is dirs.txt:

QUIET(FMOutput.txt)
COM(1, 9600)
DEBUG
DEVICE(LPC2129, 12.000000)
ERASEUSED(NewHex.hex, PROTECTISP)
HEXFILE(NewHex.hex, NOCHECKSUMS,NOFILL,PROTECTISP)
VERIFY(NewHex.hex, NOCHECKSUMS)


Here are the contents of FMOutput.txt:

Connected
Device selected
Erase complete (USED)
Hex file programming complete (NewHex.hex)
Verify passed (NewHex.hex)


The only change I made was to use an LPC2129. I am using a Keil MCB2100 v2 board, a Dell C640 Latitude laptop running Windows XP and a serial cable. I also used Flash Magic 3.69.242. The MCB2100 was configured to use the buttons to manually place the device into ISP mode.

I ran this three times without a problem, cycling the power to the board inbetween.

The only thing I can suggest is:

  - try putting the directives into a file like I did

  - try a different PC with the same cable, hardware and version of Flash Magic

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 24, 2007, 10:39:49 AM
It works perfectly on 3 other PCs. 

OK, I can deal with that.  Just can't test with my laptop.

Can I tack no a second question?

It works fine at 19.2, but higher baud rates seem to fail more often than we would like.  Is this the nature of the beast, or is there steps to take to allow highspeed programming.  We are using an LPC2378.  The clock specified in the device command is 12 MHZ incase that matters.

THanks so much, you have been very helpfull and responsive.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 24, 2007, 12:20:56 PM
I'm sorry it doesn't work on your laptop for some reason. It was a bit strange that the port sniffer changed the behavior. There must be something specific to that PC that causes problems for serial comms. If you come across any clues please let me know.

The autobauding routine measures the bit time of the bits in the '?'. This introduces errors, so it is hard to say what works for a specific clock speed. I typically use 19.2k at 12MHz. However Flash Magic has a "high speed communications" mode, which negotiates with the device after autobauding to use a faster rate. This is achieved by programming the baud rate generator in the device, resulting in more accurate timing, and therefore higher speeds are possible.

To enable high speed comms turn it on in Options -> Advanced options. The baudrate used will be shown at the top of the Flash Magic window during ISP operations.

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 24, 2007, 12:37:45 PM

I will let you know if I find something with the laptop.  The sniffer i installed is interesting in that you have to load a driver for it and it puts its software between the windows calls and the physical com port, so there is no cabling, its a soft sniffer.

For the highspeed command, what does the "clocks per cycle" mean?  The manual says it can be 6 or 12.  I am not sure what its asking for.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 24, 2007, 12:50:49 PM
Are you looking at Options -> Advanced Options -> Communications Tab? If so when an LPC2xxx device is selected the 6 clock/12 clock option shouldn't be shown as they are not relevant.

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 24, 2007, 12:51:53 PM
Sorry, forgot you are using the command line. Use zero as it doesn't apply.

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 24, 2007, 12:52:37 PM
I am writing for the command line interface.  But your answer gives me what I need.  For the LPC2378, the option is unused and sent as a 0.

Thanks yet again.

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 24, 2007, 01:56:40 PM

Hi Andy.

Don't hate me yet.

I tried highspeed mode (in the GUI) and recorded these results.  I get a failed to read device signature when I try to program.  I answer NO when it asks if I want to continue.  I answered yes once but it still failed.

Is there anything in these files that would help you guide me to be able to use highspeed mode?

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 25, 2007, 10:03:07 AM
In both cases FM ends up using 38400 baud as the device cannot manage 57600 baud at 12MHz. Here FM sends the new baudrate:

tx> B 38400 1\d\a
rx> B 38400 1\d\a
rx> 0\d\a


The '0' means that the device accepted the command. FM then switches to 38400, but keeps getting corrupted data back from the device:

rx> ??38?9?077??

I'm not sure why this is happening. I would use a scope to measure the pulse widths at each end of the communication path (device TxD pin and PC com port).

Andy
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Shawn on October 25, 2007, 10:19:06 AM

Does the clock setting in the device command set the clock?  Is there a reason NOT to set it higher?

Shawn
Title: Re: FlashMagic from Dell Core Duo Laptop
Post by: Andy Ayre on October 25, 2007, 10:22:50 AM
Do you mean the crystal frequency you enter into Flash Magic? The device needs to know how fast it is running for the bootloader to function correctly. This must be accurate. If you are using 12MHz then enter 12.000.

Andy