9 years, 12 months ago.

Can I minimize the UbloxUSBModem and HTTPClient libraries?

Hi everyone!! I'm here because I need a big help. I've been working on a project based on the U-blox C027 IoT. I would like to make a tracker GPS using the kit with the modem SARA G-35-0. The system consists of two threads: GPS_T and MODEM_T. The first thread selects the RMC NMEA sentence and picks date, time, latitude and longitude then stores them into a buffer shared with the second thread. The MODEM_T thread picks the data stored into the buffer, changes them into char array and finally sends them to a remote server. I've written almost the entire firmware but I've a big problem with the memory management.

Actually the entire system WITHOUT the MODEM_T thread just occupies 6.1 Kb (RAM mem) and RUNS PERFECTLY. As soon as I add the MODEM_T thread the code occupies 39.5 Kb (always RAM mem) and the firmwares doesn’t run.

I've also used the directive attribute((section("AHBSRAM0"))) to put some variable into the AHBSRAM0 memory section, but it didn't work.

So I’m wondering if there is a way to manage the memory much better than I’m doing. Especially I’d like to know if there is a way to strip down the libraries I’ve included for the HTTPClient and the modem interface. I just need of POST, connect and disconnect function for my project, but I don’t know how to exactly isolate these from the entire libraries.

Could be handy convert the HTTPClient and UbloxUSBModem libraries into HTTPClient.a and UbloxUSBModem.a to say the linker not to link every function into the binary, even if it’s not used?

Thanks, Emmanuele

Question relating to:

The u-blox-C027 is a complete starter kit that allows quick prototyping of a variety of applications for the Internet of Things. The application board has a MAX-M8Q GPS/GNSS receiver and …

1 Answer

9 years, 11 months ago.

Are you aware of the following program?

Import programC027_SupportTest

C027_Support library test

The driver is in this example is much less demanding compared to the mbed_offical CellularUSBModem

Thanks a lot!!! I used it to solve my problem!! now almost everything works fine. I said "almost" because of a problem with the multithread. I've noticed that during the MODEM_T thread execution , the GPS_T thread doesn't run. So appears a data losing problem. How do I make the execution of the two threads simultaneously as possible? Maybe I've set something wrong.

Thanks again, Emmanuele

posted by Emmanuele Polito 10 May 2014