modtronix.com

MicroX and Presto Range (8-Bit PIC board, mixed 3.3/5V) => MicroX Modules and SBC Boards => Ethernet Boards (8-bit) => Topic started by: roylefamily on November 25, 2011, 02:57:21 AM

Title: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: roylefamily on November 25, 2011, 02:57:21 AM
Hi,

I had a SBC65EC V3.01 communicating with the web browser and netloader over the utp cable. I then loaded the wrong web server. The one with no boot loader :|

The board comes alive in safe mode with the led flashing but will not communicate on any of 10.1.0.1, 192.168.1.1, 192.168.0.1

Occasionally I do get a windows 7 pop up complaining of two devices on the network with the same ip.

"The system detected an address conflict for IP address 192.168.1.1 with the system having network hardware address 00-04-A3-00-00-00. Network operations on this system may be disrupted as a result."

Any thoughts?
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: gr on November 25, 2011, 08:48:49 AM
Sounds like you already have a device at 192.168.1.1.  Probably your router.  If from your computer in cmd window you type "ipconfig" what is the address of your gateway and what is the ip address of your computer?  I'm going to guess that the gateway (router) is 192.168.1.1 and your computer is 192.168.1.X  where X is something else such as 101.

You have 3 choices: Change the ip address of the mxboard, change the ip address of the router (royal pain if you have many devices in your house) or don't use the router (use a crossover cable).   It is probably in safemode which means it should respond to 10.1.0.1, 192.168.1.1 or 192.168.0.1.  If it isn't you can force safemode with the safemode jumper and power cycle it.  If you don't know what I'm talking about you should do some more reading of what you bought.  Or google sbc65ec safemode.

But the problem is if your network is 192.168.1.* then if you try to connect to say 10.1.0.1 then your computer thinks the mxboard is on a different network and will try to go through your router.  But your router has told all devices that they are on 192.168.1.* so it probably assumes 10.1.0.1 is out on the internet and will send your requests off to the internet instead of the mxboard.  So really - you should either buy a $10 crossover cable, or if you have an old network hub sitting around (not a full blown NAT translation cable modem or wifi router, but simply a 4 port hub that doesn't need it's own address) then hook your computer and the mxboard into *that*.  Reinstall the proper software, setup the ip address to something reasonable that doesn't collide with other devices, say 192.168.1.13.  Then go back to your original network wiring.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: Rick314 on November 25, 2011, 02:00:59 PM
...or don't use the router (use a crossover cable).   It is probably in safemode which means it should respond to 10.1.0.1, 192.168.1.1 or 192.168.0.1.  If it isn't you can force safemode with the safemode jumper and power cycle it.

I agree, and think this is your best path forward.  But I doubt that the crossover cable is required, making this approach even simpler.  See http://en.wikipedia.org/wiki/Medium_dependent_interface#Auto-MDIX that explains how most modern computers (like yours I would guess, since it has Windows 7) will recognize that a normal LAN cable is being used where a crossover cable should be, and compensate for it automatically.  My old 2004 Windows XP laptop works fine direct-connected to an SBC65EC using a normal (not crossover) LAN cable.  It won't hurt any hardware, so just try this network topology:

PC <-> normal LAN cable <-> SBC65EC

That's all, nothing else on your PC's ethernet port.  You have to be sure the PC network connection is configured to be able to communicate with the SBC65EC.  See http://forum.modtronix.com/index.php?topic=1512.msg4666#msg4666 for how to do this using Windows XP.  I don't have a Windows 7 machine available so don't know exactly how to configure PC IP address in Windows 7.  If this works, great.  If not, then I would invest in a crossover LAN cable and try again.

There is one other option -- The SBC65EC RS-232 interface allows seeing and setting the IP address.  It is more complicated, requiring PC/SBC65EC RS-232 cabling, a PC terminal emulator like Windows Hyperterminal (COM1, 57600 baud, 8 data bits, no parity, 1 stop bit, no flow control).  Power-on SBC and see "Press any key for Configuration menu......." and press Enter quick before the "....." ends.  Getting this working also opens the door to using the Modtronix Embedded Debugger with MPLAB software development, that allows configuring and seeing run-time print statement output from the SBC65EC.  Ask if you want more information about using the SBC65EC RS-232 port.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: roylefamily on November 25, 2011, 02:15:43 PM
Thanks for that.

Now have the SBC connected straight to the laptop with a crossover cable. Have the laptop as 192.168.0.100, 255.255.255.0

Netloader can't connect. I got the wireshark netsniffer going and looked at the ports. Three are visible, one being the wifi with traffic. Two others that show no activity when netloader is trying to connect. Netloader wouldn't go in windows 7 so run it in Win XP SP2 mode.

I'm disturbed that I see no UDP out.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: gr on November 25, 2011, 03:42:13 PM
Because you killed the normal program that runs on the SBC, you only have a 3 (or so) second window after you power cycle the SBC where the netloader can connect to it.  So start the bootloader and enter the ip address of your board (192.168.0.1, right?) and then click connect and then power cycle the SBC.

Personally I would turn off all other networks (especially wifi) during testing.  Otherwise the bootloader commands might get sent out the wrong interface (the wifi interface).

For some reason I thought wireshark had to be on a 3rd computer.  In other words I didn't think wireshark could monitor traffic that goes to or from the computer that wireshark is running on.  I'm probably wrong about this.  But maybe that is why it didn't see any udp packets?  The udp packets might be general broadcast.  If you are going to use wireshark, you should be logging all ethernet packets - not just ip packets.


Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: gr on November 25, 2011, 03:44:46 PM
By the way - I didn't have to run bootloader in win xp mode.  I was able to run it in win7 fine except there were permission issues so I moved the whole thing to a subfolder of my user folder and then it worked fine.  This is in another recent thread.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: roylefamily on November 25, 2011, 04:53:33 PM
Wow what a good forum. Thanks folks.

I have an interesting screen shot. I have wifi off and single crossover cable to the SBC, no other devices connected. For reasons unknown wireshark can now see traffic on the utp cable. It looks like the hardware layer is trying to do the right thing but netloader is still not connecting. I will be experimenting with the environment the netloader runs in.

Look at line 1186 and 87.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: gr on November 25, 2011, 07:30:59 PM
1186 and 1187 show that both your machine and the SBC has at least ARP working.

1188 looks like the bootloader trying to talk to the board.  So maybe you are wrong.  Maybe bootloader is working fine.  Did you remember to power cycle the SBC *after* hitting the "connect" button in bootloader?
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: roylefamily on November 25, 2011, 08:17:36 PM
Yes I start neloader "connect" and then power up the SBC. I think you are right. Netloader is doing its UDP thing. The SBC can only manage arp so it is broken. It seems that not every situation can be saved with netloader despite safe mode running on the SBC.

As an aside installing netloader to the documents folder has enabled it to run in windows 7 without using compatibility mode.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: gr on November 25, 2011, 08:44:15 PM
Very strange.  Don't give up just yet.  If all you did was install the wrong software you should be able to recover.  The problem is probably that you aren't connecting in the correct timeframe.  Perhaps you need to reboot SBC just *before* hitting connect button.  Also don't click the "update eeprom" button.  *only* click connect button.  Also uncheck "reset before connect".  That only works if the webserver is working which it isn't.  So this will probably cause more problems than it will fix.  Also read the documentation of how to connect to an SBC  when the main software is toast.  The bootloader can still connect but I forget the exact procedure.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: roylefamily on November 25, 2011, 09:52:44 PM
Tried all those things, no good. If I follow the instructions to the letter then I get a good arp exchange. Then the SBC can't manage to respond to the UDP from netloader.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: leifo on November 27, 2011, 02:42:08 AM
Have you tried disabling the Windows Firewall?
Could be that it's blocking responses.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: Rick314 on November 28, 2011, 11:55:05 AM
roylefamily: I suggest keeping things as simple as possible until you can communicate with the SBC.  Specifically, don't involve the Modtronix Netloader until you have a "ping" working or can browse to the SBC home web page using HTTP.  Have you followed the process I suggested at http://forum.modtronix.com/index.php?topic=1512.msg4666#msg4666 yet?  Or if you have everything working now, please let us know.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: roylefamily on November 28, 2011, 02:57:32 PM
Hi,

As things stand the led flashes. ARP is achived and the board reports its mac and ip however it ignores the udp packets. I have just tried serial comms but it fails to talk on the serial port. I have verified my serial setup is good with another working SBC.

I have followed
http://forum.modtronix.com/index.php?topic=1512.msg4666#msg4666
The SBC web page is not working.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: Rick314 on November 28, 2011, 07:02:03 PM
I have followed http://forum.modtronix.com/index.php?topic=1512.msg4666#msg4666.  The SBC web page is not working.
What happened after connecting the PC to SBC using a crossover cable, getting the PC at 10.1.0.2 and subnet 255.0.0.0, and at the Windows Command Prompt typing "ping 10.1.0.1"?  This uses Internet Control Message Protocol (ICMP) instead of User Datagram Protocol (UDP).  If this also didn't work, I think I am out of ideas.  But the fact that the SBC LED is blinking and Wireshark shows Address Resolution Protocol (ARP) works says to me that much of the SBC is alive and well.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: roylefamily on November 29, 2011, 02:08:18 AM
No go with the ping. Looks like we need to restore the EEPROM contents with a PIC programmer or return the board to have the loader restored to the board.

Thanks Rick you have been very helpful.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: gr on November 29, 2011, 07:02:19 AM
This seems crazy.  I have reprogrammed the SBC hundreds of times and I have accidentally put in infinite loops that keep the board from working at all but I've always been able to load a new program into it.  Modtronix does an amazing job of protecting the bootloader on the SBC from being hurt.  It's in a different eeprom than where the normal program is.

I'm thinking your pc is on a different ip range.  There are 3 ranges of ip addresses that should work.  Make sure your pc is on the same subnet (same first 3 numbers) otherwise the pic might be trying to use a gateway to respond to the pc.  TRY ALL 3 IP RANGES.  Maybe the SBC responds to ARP on all 3 but in reality only works on one of the ranges due to gateway confusion. Also a firewall could be blocking both bootloader and wireshark from seeing the SBC response.  So try an older XP machine and turn off the firewall.

The other thought is that the software you loaded onto the SBC is blinking the LED so it is "working" but it thinks *it* is supposed to be the bootloader (that's what the no loader version does) so once it starts running *that* code then the wrong code is doing the ARP and all but won't work because it's the wrong code - you need to catch the SBC in the first 3 seconds when it is running the built-in bootloader code *before* any LED starts blinking.  Once the LED starts blinking it is definitely too late and you need to power cycle the SBC so that it is running the "built in" loader.

I could be wrong in all this.  It might be that the "no loader" file has something so horrible in it that when you run it then it somehow clobbers your standard built in loader.  I thought this was impossible.  I thought you had to pull some pin on the eeprom to ground or something to change the built in loader.  But I'm not certain.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: roylefamily on November 29, 2011, 02:32:11 PM
You might be onto something gr. The led blinks as soon as power is applied. There is no time before the led starts.

Is it definitely the case that the loader does not blink the led while waiting for UDP?
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: gr on November 29, 2011, 03:20:00 PM
Mine takes 7 seconds before the red led starts blinking (the ethernet leds blink instantly).

Maybe you should *remove* the safe mode jumper?  Grasping at straw here.

Clearly some software is running a tcp/ip stack but it isn't the bootloader.  It's the "bad" software.  You need to catch it before the "bad" software starts up.  There should be at least a second or so when you can connect to the SBC before the red led goes into blink mode.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: leifo on November 30, 2011, 01:45:30 PM
When running in safe mode, the LED starts to blink immediately - and at a fast rate ie. several times per second.
It should remain in this mode until it's contacted by the Network Bootloader program.

I have taken a closer look at your Wireshark dump and it looks as if you PC's netmask is 255.255.255.0 where it should have been 255.0.0.0 (also mentioned in Ricks's previous post).

Once SBC and the Network Bootloader program is running, try to run the command "arp -a" from a command prompt on the PC. This should display a table of corresponding MAC and IP adresses - and should include the 10.1.0.1 address from the SBC. The table can be cleared using "arp -d" to make a fresh start.

Update: Just tried checking this on a spare board I have - and mine behaves like yours in safe mode ie. I get the ARP response and the Network Bootloader starts UDP'ing - but no response whatsoever from SBC. Have also tried the other two well-known safe adresses with same result :-( . Have also attached a serial cable and it will not output anything while in safe mode ie. like yours (ok in normal mode).
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: leifo on November 30, 2011, 10:39:24 PM
From above, I think your best chance would be to use a serial Hyperterm and boot in "normal" mode. You then have 3 seconds to interrupt the boot process and insert your own temporary IP address.
Note that you cannot be sure of the bps being used as this is taken from the config area ie. set a bps rate, power-cycle the SBC and continue until you see something usefull.
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: roylefamily on December 01, 2011, 02:42:01 PM
Serial does not work when I boot the SBC in normal mode.

However if your SBC is the same as mine HW 3.01, BLN 1.00, SW V3.1 is this a situation in wich some boards have been delivered with a broken safe mode?
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: leifo on December 02, 2011, 04:35:32 PM
The boards I have are stamped HW 3.01, BLN 1.00 and SW 3.06 i.e. same bootloader and hardware.
I have in the past managed to download non-working code and also effectively corrupted the config area on several occasions but have always  :-) managed to get up again by using a serial console in "normal" mode (which is also what gr suggests).

 
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: Kongress on February 14, 2012, 06:48:54 PM
Hey guys,

Has any resolution to this been reached? Does anyone else have any other ideas? I've run into the same problem myself, having loaded the "nobl" code on my SBC65EC. LED immediately blinks quickly in safemode and not at all in normal mode, can't see it on the network or directly connected to it (with my IP set to 10.x.x.x/8) and I see nothing on the serial interface (57600, 8, N, 1, checked cable continuity with my meter) in either safe or normal mode. I really don't want to have to pay and wait to ship this thing back to Australia. Thanks for any help!
Title: Re: Just downloaded the no loader hex file and clobbered the SBC65EC V3.01
Post by: Kongress on February 14, 2012, 07:23:17 PM
Looks like I jumped the gun a bit, I was able the get the bootloader to hook in, I just had to time it right.