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

#23
General / Debugging the Ethernet Bootloader
April 12, 2010, 09:29:11 AM
Here are some hints on how to debug problems when using Flash Magic with the Ethernet bootloader.

0. Run Flash Magic as Administrator

Right-click on FlashMagic.exe and choose "Run as Administrator".

1. Remove routers and switches from your network

Routers and switches can choose whether to forward packets from one part of the network to another depending on where they know devices to be connected. Because the Ethernet bootloader uses MAC addresses rather than IP addresses this can confuse these network devices.

A hub however forwards all messages.

2. Try a direct connection

Using an Ethernet cross-over cable connect your PC directly to your evaluation board. This is the simplest possible arrangement.

3. Debug the Ethernet Communications

Download and install Wireshark. Start it recording on your Ethernet interface and then try to use Flash Magic to communicate with the bootloader. Wait for the error message to appear in Flash Magic then stop recording.

The following is a screenshot from Wireshark showing a read of the device signature.



1. In the filter box enter "udp.srcport == 41825" then click on "Apply". This will remove the other packets and only show the communications between the PC and the bootloader.

2. Click on the first UDP message.

3. Click on the "+" for the Data field to expand it. Then click on the "Data: 3F0D0A" line.

4. Look at the highlighted area in the data. It should show "?.." which corresponds to "?<cr><lf>".

Note that the packet shows a destination (Dst) MAC address and IP address that matches the values entered into Flash Magic.

If you don't see any UDP messages then for some reason Flash Magic is not transmitting to the bootloader. Skip to the ARP Table section for more debugging steps.

Here is a screenshot showing the response packet from the bootloader containing "1<cr><lf>":



If you don't see a response then double-check the MAC address is correct and P2.7 is outputting a square wave (which indicates the bootloader is running).

4. ARP Table

The ARP table is a list of associations between MAC addresses and IP addresses held on your PC. In order to communicate with the bootloader it must have an entry in this table. Flash Magic does this automatically but we can double-check that it worked.

Start Flash Magic and attempt to connect to the bootloader. Then:

In XP: Go to Start -> Run, enter "cmd" and click on "OK".

In Vista/7: Go to Start, enter "cmd" into the search box and press Enter.

Enter "arp -a" to display the table. It should look something like:

Interface: 192.168.0.154 --- 0x4
  Internet Address       Physical Address         Type
  192.168.0.1             00-11-22-33-44-55     dynamic
  192.168.0.20            0c-1d-12-e0-1f-10     static


The interface IP address is the IP address of your PC. The entry 192.168.0.1 is your router/gateway, if one exists. The entry 192.168.0.20, marked as "static" is the bootloader. Note that the IP addresses may be different. What you are looking for is a static entry with the IP address and MAC (Physical) address of the bootloader as entered into Flash Magic.

If an entry for the bootloader does not exist or does not appear under the IP address for your PC then take a screenshot of your ARP table or cut and paste it into a text editor then try manually adding it with a command like:

arp -s 192.168.0.20 0c-1d-12-e0-1f-10

Replace the IP address with the one you actually want to use. Now look at the table again with "arp -a" to make sure it was added. Now try connecting in Flash Magic. If this worked then please send the screenshot or text from the ARP table as it was before to us for analysis.

If you have more than one Ethernet interface (for example if you have VPN clients installed they add virtual interfaces) then you can specify with the arp command which interface to add the entry to. For example:

arp -s 192.168.0.20 0c-1d-12-e0-1f-10 192.168.0.154

Depending on your operating system you might need to run an "elevated command prompt". Right-click on C:\Windows\system32\cmd.exe and choose "Run as Administrator...".
#25
Announcements / Blog
February 01, 2010, 10:04:14 AM
We now have a company-wide blog that we will use to post Flash Magic related news. Major and semi-major releases of Flash Magic will be announced on this blog. You can find it here:

  http://www.esacademy.com/blog/category/flashmagic/

An RSS feed can be found here:

  http://www.esacademy.com/blog/category/flashmagic/feed/

Andy
#26
P89V51Rx2/P89LV51Rx2 / Version 4 of the Bootloader
January 26, 2010, 11:21:36 AM
Version 4 of the bootloader in the P89V51Rx2 devices suffers from a couple of issues. To determine the version of your bootloader:


  • Choose ISP -> Read Device Signature...
  • The bootloader version will be displayed

Block 0 Erase

Version 4 of the bootloader has an issue with erasing block zero. The solution is to upgrade the bootloader.

Upgrading the Bootloader

Version 4 of the bootloader should be upgraded to version 5 first; see link (1). Follow the instructions. If it doesn't work then try a terminal program such as Hyperterminal to manually update the bootloader.

Once version 5 is installed it can be upgraded to version 7 using the functionality built into Flash Magic; see link (2).

Version 5 solves the block zero erase issue. Version 7 adds the option to use a pin to start the bootloader.

(1) http://ics.nxp.com/support/documents/microcontrollers/all/?scope=P89V51RD2
(2) http://www.flashmagictool.com/resources.html
#27
LPC9xx/LPC9xxx / MOVED: I2C Monitor
December 03, 2009, 08:10:08 AM
#28
This topic has been moved to Off-Topic because it is about firmware development.

http://forum.flashmagictool.com/index.php?topic=3717.0
#29
Announcements / Signatures
November 30, 2009, 11:10:57 AM
Signatures have been limited to one character, effectively disabling them. A new form of spam is to post something that looks useful but then have spam links in the signature. Sorry for any inconvenience.

Andy
#32
General / MOVED: Unable to connect
September 25, 2009, 09:22:12 AM
#38
General / My PC Doesn't Have a COM Port
July 10, 2009, 10:00:02 AM
It is becoming increasingly common for PCs to not be provided with a COM port, especially laptops/notebooks.

It is possible to buy cables that convert USB to a COM port. When connected these cables act as a virtual COM port and from the point of view of software running on the PC they are a real COM port.


  • Go to Control Panel -> System -> Hardware -> Device Manager
  • Expand the Ports list to see your COM ports
  • Connect the cable and see which new COM port appears
  • Use that COM port number in Flash Magic

However note that some of these cables don't appear to work well when used for reprogramming microcontrollers. The cause is unknown but is probably related to the timing of data on the USB side. It may be PC dependent or cable dependent. If you find that you can't program the device then try other cables.

In general we recommend using a PC with a built-in COM port or getting a PCI card with COM ports, until the situation with the USB to COM port cables improves.