How to modify and recompile a library for the MBED

27 Feb 2012

Dear MBEDers, I have a question (please pardon me if it turns out to be silly). I recently bought the MBED board and started to try out the test programs. And it rocks!! I am having a great time trying out its various features!

My end goal however, is to use the USBMSD_SD interface (which subclasses USBMSD class) to access SD cards and make some changes to the MSD protocol itself. The same changes would be complemented by my driver which will run in the host PC.

For this to work, I need to be able to modify the USBMSD_SD or USBMSD classes. I can view and access their sources because they are published libraries. But how do I get them over the MBED IDE, modify their sources to support my MSD protocol changes ?

Thanks in advance for your help! Seemanta

29 Feb 2012

Right-click on the USBMSD_SD library in your project and click the "Edit Library..." option. This will pull the source code into your workspace.

Hope that helps,

Adam

29 Feb 2012

Hi Adam, I think I need to buy you a beer. Thanks A LOT! It was stupid of me to not try that before. Again, thanks a TON! This will help me a lot!

But this can't be done for the mbed libraries. Am I right ?

Seemanta

29 Feb 2012

Seemanta Dutta wrote:

But this can't be done for the mbed libraries. Am I right ?

That's true. This cannot be done for the "mbed" library.

29 Feb 2012

Thanks again, Adam. I LOOOOOVE the MBED!

03 Jun 2012

Hi all.

I need to do little modification to a class.

I followed the steps outlined by Adam, but I could only see the headers files (.h). How can I modify the definition of a method in the .cpp file, and recompile the library?

Thanks in advance for your help.

Darío

07 Jun 2012

I have a similar question to the original poster. I'm trying to edit a library (lwip) however the "Edit library" option is not available. Is it locked in some way?

If I right click on other libraries, e.g. TMP102, then I can see "Edit library" option.

I tried right clicking on LWIP and performing a "save as.." in the hope it would save a local copy which I could edit, but same issue, seems to be locked.

Reason for wanting to edit: to change the some DEFINES in lwiopts.h in to tune for my application (increase TCP_SND_BUF so I can create and send a larger webpage). I tried creating my own local copy of the lwiopts.h file but the libary itself is precompiled so it makes no changes to the binary.

I've also tried to import the libary from the trunk: http://mbed.org/projects/cookbook/svn/EMAC/lwip/trunk and also tried importing as files. Each time I get the pre-compiled libary.

Can anyone suggest how I can edit this library?

Thanks,

Neil.

07 Jun 2012

You could try removing the networking library that you currently have linked in and use this one instead:

It should have the same functionality but with bug fixes and I have successfully used the Edit library feature with it.

07 Jun 2012

The libraries in mbed are nowhere explained that I've found. Some are archived in ar binary form in a system independent of mbed. I've tried several times to find a consistent way to know where the source is for a certain library, where the MOST RECENT binary and source is, and which libraries don't publish the source (.cpp).

I wish there were an explanation. I often see people post notices of a newer version of a library but when you pull in that named library you get the old one.

This might be stupid-me, but it's not boldly obvious.