Library Chaos

17 Nov 2012

I migrated from several other M3 vendor-specific IDEs to mbed cause the cloud community seems so productive. However, this also has its drawbacks!

My problem seems simple: read a GPS receiver binary data stream (several 1000 bytes per sec), do a minimal amount of parsing of the binary data to engineering units, and then write the data to a SD card. Reading the data was easy, setting up the SD card was easy, and debug across the USB serial link was easy.

However, when I cranked up the data rate above 2000 bytes per sec, I began to see the occurrence of missed bytes. So I switched to the MODSERIAL library to get some built-in buffering. There I first noticed that there were several MODSERIAL libraries that seemed to be off-shoots to do different things. It wasnt clear which to use. And also the MODSERIAL library requires the FATFileSystem Library that also has many versions. In fact, some combinations will not allow my code to compile. A bit of trial and error is required. So its a bit of a struggle to maintain a consistent development pattern. Right now I am at a dead end cause I just cant get the MODSERIAL to work. I have posted questions on how to procede there so hopefully I can get out of my current dead end.

I also know that I will require some threads to get the serial read and SD write to work correctly. So I moved to the mbed-rtos library. That is: libraries .. many of them. Again, a lot of trial and error to get things to compile. As of this moment, everytime I add the rtos library, my serial read functionality stops working. Posted questions there as well to see if I can sort this out.

Bottom line is that the crowd development is great. But there needs to be some way to vet the stuff that gets posted. For me, working with any new libraries is a scary proposition!

18 Nov 2012

MODSERIAL doesnt require FATFileSystem, it is your SD card that requires it. But more ontopic, I agree, it is a problem with the number of libraries with the same name that can be really confusing. Since a while forking/pulling forks back is included in the mbed environment, which hopefully will decrease the number of new ones made, but it will keep being a problem.

I hope an mbed developer reads this and can think of some ideas to decrease this issue. One easy to include solution that I think will really help is simply including the "number of times imported" in the import window in the compiler. 99% of the times the one imported most is simply the one you want to have.

18 Nov 2012

Thanks Erik .. I believe I have resolved most of my issues this morning with the MODSERIAL and the rtos. I noted that on the api pages for these libs, the original author allows importing their latest commit libs. Oddly, these latest commits were not on the "Import Button" archive accessible from the compiler bottons. So that would seem to be a good starting place for accessing new libs. ... J

19 Nov 2012

James,

Erik is quite right that looking at the import count is generally a good way to compare libraries, unless you have a specific requirement that is not met by the most popular library. Showing the import count in the compiler would definitely be useful and I've added it to our to-do list. Whether or not a library's dependencies are imported when you import a library depends on how the library author organised their code. In some cases you may be able to find example programs or a HelloWorld for a specific library which is likely to have all the dependencies you need.

We are looking at other ways that we can improve the process of finding dependencies, any comments or suggestions are welcome.

Steve