EmbeddedRelated.com
Forums

LPC1768 - how to crosscompile libmodbus for lpc ?

Started by Fabian December 8, 2011
Hi everybody,

I need some help. How can I crosscompile the libmodbus (libmodbus.org) for the lpc1768 ?

Usually my code is wrote into CoIDE (from coocox) and compile with arm-none-eabi-gcc (with modification from Coocox). But I don't know how to do to have a static library usable.

Any people can explain to me ?

An Engineer's Guide to the LPC2100 Series

> I need some help. How can I crosscompile the libmodbus
> (libmodbus.org) for the lpc1768 ?

I am in no way familiar with libmodbus, but have just looked at the
front page of the link you sent, and it is stated as being a library for
Linux, Mac OS X, FreeBSD, QNX and Win32. It would therefore, at a very
slight glance, not seem to be targeting anything similar to a
microcontroller. You may not be even able to start using it, if if you
compile it. It is worth investigating before you put any time or effort
into it. There are other modbus libraries around that target
microcontrollers specifically.

> Usually my code is wrote into CoIDE (from coocox) and compile with
> arm-none-eabi-gcc (with modification from Coocox). But I don't know
> how to do to have a static library usable.

What is it you are trying to do? Build the code to a library, or
include a library in your application code? Both can be done quite
easily in GCC.

Regards,
Richard.
Hi

Can't help with libmodbus but the following Modbus module (serial RTU/ASCII/TCP with routing and gateway features - also allows MODBUS over USB on the LPC) works with the LPC1768:
http://www.utasker.com/modbus.html
Full user's guide: http://www.utasker.com/docs/MODBUS/uTasker_MODBUS.PDF

Very low memory requirements, starting at about 5k for a full-featured RTU/ASCII slave.

Regards

Mark
Thanks Richard,

I'd like to make a communication in modbus between my lpc (slave) and a PC (master)

Usually, on linux, I use libmodbus so it was a simple starting point for me.
I think the best way is to extract the needed functions in the source of libmodbus.

Regards,

Fabian