Important changes to forums

We’re making some changes to the Mbed forums. From 10th December 2019 all new discussions will take place on our new forum site. You can continue to reply to existing threads for the next two weeks. After that we will archive this forum so you can return to useful posts in the future.

Ethernet PHY

26 Mar 2012

Very interesting! You could try sending a key press from your terminal program to my version of the program to see if it responds. My instrumentation hooks the UART0 interrupt so in theory it should respond unless it is actually hanging in a global constructor but I did switch the ethernet related objects to be dynamically allocated at the beginning of main() instead of being globals so that I could init my instrumentation first.

26 Mar 2012

sorry, no response,

I have also shorted TXD & RXD (with jumper) Just to check <echo>

does wok,

nothing back from you'r code.


26 Mar 2012

Wow, it must be dying pretty early or pretty hard (infinite loop at priority level 0) :)

Are you able to build simple apps with the online compiler that do nothing but say printf("Hello World"); to UART0 and have it work on your board?

I see that the sample from Thanassis which worked was a .hex file. Could it be that something in the process of flashing the part with a large .bin file from the online compiler is going wrong?


26 Mar 2012

Yes I am using the board,

Normal I/O - fine,

Serial, (230400 K Baud - Flash Magic programming)

HID interface very reliable,

Must admit not tryed I2C, but 99% sure that is bair metal

will eventualy get round to testing I2C on my Frankinstein board

u-SD works,

So I did not mess up that mutch :}


26 Mar 2012

Definitely sounds like the board is accepting programs!

The only other thing I can think of is to try this version.


26 Mar 2012

Still dead,

finaly got round to fitting 50R resistors to second board, both dead,

Ceri :(

26 Mar 2012

That's too bad. I was really hoping that the .hex file found within that .zip archive in my last post would have worked.

What is the actual process that you use to program your device? One thing I am suspicious of is that many of the things that you mentioned which have worked on your board probably don't require very large binaries. In particular they would be less than 64k. However, networking related binaries will be larger than 64k and some of the bin2hex utilities don't support binaries that are larger than 64k.

26 Mar 2012

My bad, i think I flashed the wrong file,

Ethernet example working :)

Dont know what I did wrong.

got: $T020c:fb030000;0d:887f0010;0e:d51c0000;0f:981c0000;#47

from the 'ANY' key.

What did you do ???????????????????????


26 Mar 2012

just attempted to make a BIG .HEX with bin2hex,

bin file 104K,

hex file 249K,

Bin2Hex did not complain and was supprisingly fast,

although no longer have that hardware to test it anymore.


info: a 'bitmap' copied twice.


26 Mar 2012

ceri clatworthy wrote:

What did you do ???????????????????????

That is the same program that I originally sent you as a .bin file except I used the GNU objcopy tool to do the conversion.

You can download the GNU tools from

The command line to use for converting bin files to hex files with this tool is:

arm-none-eabi-objcopy -I binary -O ihex HTTPServerHelloWorld_LPC1768.bin HTTPServerHelloWorld_LPC1768.hex

Hope that helps,


26 Mar 2012

I am away from my PC, for a while, But do you think the bin 2 hex program is responsible for Ethernet success ?

I assume the link is for Bin2Hex.



26 Mar 2012

I think that using objcopy instead of bin2hex is responsible for creating a proper hex file. The link I gave is for the Code Sourcery GCC tool chain which includes the objcopy utility that I used for doing the conversion.

Intel hex files use 16-bit addresses and should contain special records to change segments or use 32-bit linear addressing. My guess is that the output from bin2hex is missing these records so the data for addresses above 64k end up overwriting the first 64k of code.

If you look at the hex file I generated, you can search it for the record that starts with :10FFF0. The record after it should contain:


This record signals that the start of the next chunk of records should be at address 0x10000 I don't see where you have posted one of your hex files so I can't dump it to see if it is missing a record like this but I suspect that it is.

More info on hex files can be found on wikipedia

The version of bin2hex found here even mentions in its description that it only supports 64k files.


27 Mar 2012

So , the problem was the (ht-lab ) bin2hex utility used for converting bin to hex for making hex file , for use with flashmagic ?

Is Keil bin2hex utility suitable for files larger than 64K , then ?

or just the Keil compiler bypasses the problem , as it has internal support for hex output ? - Christos

27 Mar 2012

IT Lives !!!!!

Thanks to all of you that helped,

GCC's Bin2Hex works,

Will do some more tests later, just to make sure it was not a fluke !

once again thanks to Adam Green, Giuseppe Zangari and Thanassis Mavrogeorgiadis



27 Mar 2012

I'm so happy! Great!!!

So GCC is free?

27 Mar 2012

This is nice to hear, do You all plan to make some notebook page about ethernet on custom PCB?

27 Mar 2012
  • Giuseppe Zangari: Yes, I only buy free stuff !!!!
  • Little llumpu: that sounds like a good idea :)

Thanks again.


27 Mar 2012

Thank You Ceri,

this is far above my skills to get it working by myslef. Thank You for Your hard work.

11 Jun 2012

@Ceri Nice , you found the problem was at the bin2hex utility ! Today , I went over a very old post mentioning the same problem !!! Too bad it was "buried " inside the forum long time ago and we couldn't spot it earlier !!! Christos

TimExton-McGuinness wrote:

  1. 17 Dec 2010

Oh what a beautiful day. Found my problem, not hardware at all, it was BIN2HEX. Simple in the end, Flash Magic needs a .hex file and I've been converting the compiler .bin file with a very old (Intel8048 era) bin2hex utility. Even the simplest 'Hello World' application with the Ethernet libs fills 75K of code. So if anyone else is using In-System programming (ISP) and FlashMagic then the advice is, get an uptodate BIN2HEX and use the /4 option for either 24 or 32bit addressing range, not the standard 16bit range. Example 'bin2hex /4 test.bin test.hex'. And thank you everyone who reponded here.


You need to log in to post a reply