PlatformIO Community

Mbed funny issues : ArduinoJson, CMSIS-core and others


#1

Hello,

I came across a very funny and random issue while working with platformio and mbed.
Board : Ublox C027 with LISA U200 module
IDE : VSCode
Framework : Mbed

These are the present contents of my platformio.ini file

; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:ubloxc027]
platform = nxplpc
board = ubloxc027
framework = mbed
lib_deps = ArduinoJson
lib_archive = false
build_flags = -std=gnu++11

And these are the contents of the main.cpp file.

#include <mbed.h>
#include “ArduinoJson.h”

Serial PC(USBTX,USBRX);
Serial Windsonic(P4_28, P4_29);
char *p_DeviceID, *p_WindSpeedPolar,*p_WindDirectionPolar,*p_Units,*p_StatusCode,*p_Checksum;
char p_bufferString[256];
char p_Buffer[100];
char serialNumber[16];

int main()
{

Windsonic.baud(9600);
PC.printf(“Initialized PC comms\n”);
PC.printf(“Initialized Windsonic comms\n”);
PC.printf(“Entering Configuration Mode\n”);
Windsonic.puts("*");
while(Windsonic.readable())
{
PC.putc(Windsonic.getc());
}
PC.printf(“Checking Default Configuration\n”);
Windsonic.puts(“D3\r”);
while (Windsonic.readable())
{
PC.putc(Windsonic.getc());
}
PC.printf(“Setting output format to UV, Continuous\n”);
Windsonic.puts(“M2\r”);
while (Windsonic.readable())
{
PC.putc(Windsonic.getc());
}
Windsonic.puts(“Q\r”);

while(1)
{
if(Windsonic.readable())
{
Windsonic.scanf("%s",p_Buffer);
PC.printf("%s\n",p_Buffer);
}

PC.printf("\n");
PC.printf("\n");

if(p_Buffer[2] == p_Buffer[3])
{
p_DeviceID = strtok(p_Buffer, “,”);
p_WindSpeedPolar = strtok(NULL, “,”);
p_Units = strtok(NULL, “,”);
p_StatusCode = strtok(NULL, “,”);
p_Checksum = strtok(NULL, “,”);
p_WindDirectionPolar = “0”;

}
else{
p_DeviceID = strtok(p_Buffer, “,”);
p_WindDirectionPolar = strtok(NULL, “,”);
p_WindSpeedPolar = strtok(NULL, “,”);
p_Units = strtok(NULL, “,”);
p_StatusCode = strtok(NULL, “,”);
p_Checksum = strtok(NULL, “,”);
}

#ifdef DEBUG
PC.printf("\n");
PC.printf(“Device ID: %s\n”,p_DeviceID);
PC.printf(“Wind Direction: %s\n”, p_WindDirectionPolar);
PC.printf(“Wind Speed: %s\n”, p_WindSpeedPolar);
PC.printf(“Units: %s\n”, p_Units);
PC.printf(“Status Code: %s\n”, p_StatusCode);
#endif
// wait(1);

DynamicJsonBuffer postBuffer(128);
JsonObject &root = postBuffer.createObject();
root[“board_id”]=“12345”;
root[“id”]=“12345”;
root[“type”] = “report”;
JsonObject &data = root.createNestedObject(“data”);
data[“event”]=“periodic”;
data[“Direction”]=p_WindDirectionPolar;
data[“WindSpeed”]=p_WindSpeedPolar;
data[“Units”]=p_Units;

root.prettyPrintTo(p_bufferString);
PC.printf(p_bufferString);

}

return 0;
}

As you can see, I am only using the ArduinoJson library to construct a json object
However, building the project gives this error.

My piolibdeps contains the ArduinoJson library. and contrary to the name the library can be used for other platforms. It is only a header file. I read somewhere else on the web (maybe their own forums) that since it is a header only library I needed to add the lib_archive = false options to the platformio.ini file to ensure that the compiler does not try to search for a .cpp file for the header. but apparently that is not making any difference either.

Any suggestions on what I can do to fix it??
There are a couple of other issues with this, but I would like to address one issues at a time.

@ivankravets @bblanchon

Thank you in advance!! :slight_smile:


#2

Can you show the full build log in text? What maybe happens is that PIO detects that you’re trying to use an Arduino Library on mbed and blocks the inclusion, causing it to fail to find the header later.

You might be able to resolve this by disabling the compatibility checks (docs, lib_compat_mode = off ). You might also be able to make a local copy of the library into your lib folder and give it a different folder-name and change the options library.json file (to a different framework, name, etc.)


#3

Thank you for the prompt reply @maxgerhardt :slight_smile:

Here is the complete log output

Executing task: platformio run <

[Wed May 9 10:46:54 2018] Processing ubloxc027 (platform: nxplpc; board: ubloxc027; framework: mbed)

Verbose mode can be enabled via -v, --verbose option
PLATFORM: NXP LPC > u-blox C027
SYSTEM: LPC1768 96MHz 64KB RAM (512KB Flash)
DEBUG: CURRENT(cmsis-dap) ON-BOARD(cmsis-dap) EXTERNAL(blackmagic, jlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(light)
Collected 15 compatible libraries
Scanning dependencies…
No dependencies
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/AnalogIn.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/BusIn.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/BusInOut.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/BusOut.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/CAN.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Ethernet.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/FlashIAP.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/I2C.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/I2CSlave.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/InterruptIn.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/InterruptManager.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/MbedCRC.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/RawSerial.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/SPI.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/SPISlave.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Serial.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/SerialBase.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/TableCRC.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Ticker.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Timeout.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Timer.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/TimerEvent.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/UARTSerial.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_critical_section_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_flash_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_gpio.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_itm_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_lp_ticker_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_pinmap_common.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_sleep_manager.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_ticker_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_us_ticker_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/ATCmdParser.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/CallChain.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FileBase.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FileHandle.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FilePath.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FileSystemHandle.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/LocalFileSystem.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/Stream.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_alloc_wrappers.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_application.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_assert.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_board.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_critical.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_error.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_interface.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_mem_trace.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_mktime.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_poll.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_retarget.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_rtc_time.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_sdk_boot.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_semihost_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_stats.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_wait_api_no_rtos.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_wait_api_rtos.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/mbed_overrides.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/onboard_modem_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/ublox_low_level_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/analogin_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/analogout_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/can_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/CRP.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_GCC_ARM/startup_LPC17xx.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/flash_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/system_LPC17xx.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/ethernet_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/gpio_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/gpio_irq_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/i2c_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/pinmap.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/port_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/pwmout_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/rtc_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/serial_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/sleep.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/spi_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/us_ticker.o
Compiling .pioenvs/ubloxc027/src/main.o
Generating LD script .pioenvs/ubloxc027/LPC1768.ld.link_script.ld
src/main.cpp:2:10: fatal error: ArduinoJson.h: No such file or directory



#include “ArduinoJson.h”
^~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/ubloxc027/src/main.o] Error 1
============================================================= [ERROR] Took 8.28 seconds =============================================================
The terminal process terminated with exit code: 1

I ll give the lib_compat_mode = off a try and get back to you :slight_smile:
Thank you again!!


#4

@maxgerhardt Thank you!! :slight_smile:

That worked a treat!!. Now for the further issues with mbed.

Edit:

Ok. The next issue is that of using the mbed C027 support libs for modem interfacing.
They are present in a C027_Support library.
And I added that as well, to the platformio.ini file.
Compiling the project I get this error.


Now, the C027_Support needs another library “mbed-os” for an “c027_api.h” header file.
So I added that as well to the platformio.ini file and compiled.
And this is the error I get.

A post here on the forums suggested that I add the “-DPIO_FRAMEWORK_MBED_RTOS_PRESENT” flag to get rid of the error.
So I added that flag as well.
And that leads to this error.

And this is where I am stuck now!!

Thanks in advance!!


#5

And adding the “greentea-client” library to the list gives this error

And thats where my Google fu stopped… No useful results on how to go beyond this point!! :slight_smile:


#6

Looks like it tried to compile stuff from the “TESTS” folder which it isn’t supposed to compile. Actually, you should not need the “library” mbed-os and definitely not those test firmwares. mbed and mbed-rtos are already the main mbed system. Can you add lib_ignore = mbed-os to force exclusion of that “mbed-os” library? Maybe play with lib_ldf_mode set to deep+? (docs). Otherwise I’d need a zip of your project to reproduce this accurately.


#7

Well, removing mbed-os from the lib_deps, and specifically adding mbed-os to the lib_ignore option gives the same error. “C027_api.h” not found

This is the complete build log.

Executing task: platformio run <

[Wed May 9 12:55:27 2018] Processing ubloxc027 (platform: nxplpc; board: ubloxc027; framework: mbed)

Verbose mode can be enabled via -v, --verbose option
PLATFORM: NXP LPC > u-blox C027
SYSTEM: LPC1768 96MHz 64KB RAM (512KB Flash)
DEBUG: CURRENT(cmsis-dap) ON-BOARD(cmsis-dap) EXTERNAL(blackmagic, jlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(deep+) COMPATIBILITY(off)
Collected 21 compatible libraries
Scanning dependencies…
Dependency Graph
|-- v5.13.1
|-- <C027_Support>
|--
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/AnalogIn.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/BusIn.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/BusInOut.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/BusOut.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/CAN.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Ethernet.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/FlashIAP.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/I2C.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/I2CSlave.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/InterruptIn.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/InterruptManager.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/MbedCRC.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/RawSerial.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/SPI.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/SPISlave.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Serial.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/SerialBase.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/TableCRC.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Ticker.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Timeout.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Timer.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/TimerEvent.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/UARTSerial.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_critical_section_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_flash_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_gpio.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_itm_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_lp_ticker_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_pinmap_common.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_sleep_manager.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_ticker_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_us_ticker_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/ATCmdParser.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/CallChain.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FileBase.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FileHandle.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FilePath.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FileSystemHandle.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/LocalFileSystem.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/Stream.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_alloc_wrappers.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_application.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_assert.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_board.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_critical.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_error.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_interface.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_mem_trace.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_mktime.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_poll.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_retarget.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_rtc_time.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_sdk_boot.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_semihost_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_stats.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_wait_api_no_rtos.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_wait_api_rtos.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/mbed_overrides.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/onboard_modem_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/ublox_low_level_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/analogin_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/analogout_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/can_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/CRP.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_GCC_ARM/startup_LPC17xx.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/flash_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/system_LPC17xx.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/ethernet_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/gpio_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/gpio_irq_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/i2c_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/pinmap.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/port_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/pwmout_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/rtc_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/serial_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/sleep.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/spi_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/us_ticker.o
Compiling .pioenvs/ubloxc027/lib378/C027_Support_ID2216/GPS.o
Compiling .pioenvs/ubloxc027/lib378/C027_Support_ID2216/MDM.o
Compiling .pioenvs/ubloxc027/lib378/C027_Support_ID2216/SerialPipe.o
.piolibdeps/C027_Support_ID2216/GPS.cpp:5:11: fatal error: C027_api.h: No such file or directory



#include “C027_api.h”
^~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/ubloxc027/lib378/C027_Support_ID2216/GPS.o] Error 1
Compiling .pioenvs/ubloxc027/lib551/rtos/ConditionVariable.o
.piolibdeps/C027_Support_ID2216/MDM.cpp:4:11: fatal error: C027_api.h: No such file or directory



#include “C027_api.h”
^~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/ubloxc027/lib378/C027_Support_ID2216/MDM.o] Error 1
.piolibdeps/C027_Support_ID2216/SerialPipe.cpp: In constructor ‘SerialPipe::SerialPipe(PinName, PinName, int, int, int)’:
.piolibdeps/C027_Support_ID2216/SerialPipe.cpp:9:50: warning: ‘void mbed::SerialBase::attach(T*, void (T::)(), mbed::SerialBase::IrqType) [with T = SerialPipe]’ is deprecated: The attach function does not support cv-qualifiers. Replaced by attach(callback(obj, method), type). [since mbed-os-5.1] [-Wdeprecated-declarations]
attach(this, &SerialPipe::rxIrqBuf, RxIrq);
^
In file included from /Users/srikrishnachaitanyanarumanchi/.platformio/packages/framework-mbed/drivers/Serial.h:24:0,
from /Users/srikrishnachaitanyanarumanchi/.platformio/packages/framework-mbed/mbed.h:80,
from .piolibdeps/C027_Support_ID2216/SerialPipe.h:3,
from .piolibdeps/C027_Support_ID2216/SerialPipe.cpp:1:
/Users/srikrishnachaitanyanarumanchi/.platformio/packages/framework-mbed/drivers/SerialBase.h:117:10: note: declared here
void attach(T obj, void (T::*method)(), IrqType type=RxIrq) {
^~~~~~
.piolibdeps/C027_Support_ID2216/SerialPipe.cpp: In member function ‘void SerialPipe::txStart()’:
.piolibdeps/C027_Support_ID2216/SerialPipe.cpp:78:50: warning: 'void mbed::SerialBase::attach(T
, void (T::
)(), mbed::SerialBase::IrqType) [with T =SerialPipe]’ is deprecated: The attach function does not support cv-qualifiers. Replaced by attach(callback(obj, method), type). [since mbed-os-5.1] [-Wdeprecated-declarations]
attach(this, &SerialPipe::txIrqBuf, TxIrq);
^
In file included from /Users/srikrishnachaitanyanarumanchi/.platformio/packages/framework-mbed/drivers/Serial.h:24:0,
from /Users/srikrishnachaitanyanarumanchi/.platformio/packages/framework-mbed/mbed.h:80,
from .piolibdeps/C027_Support_ID2216/SerialPipe.h:3,
from .piolibdeps/C027_Support_ID2216/SerialPipe.cpp:1:
/Users/srikrishnachaitanyanarumanchi/.platformio/packages/framework-mbed/drivers/SerialBase.h:117:10: note: declared here
void attach(T obj, void (T::*method)(), IrqType type=RxIrq) {
^~~~~~
.piolibdeps/C027_Support_ID2216/SerialPipe.cpp: In member function ‘void SerialPipe::rxIrqBuf()’:
.piolibdeps/C027_Support_ID2216/SerialPipe.cpp:107:27: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
/
overflow */;
^
============================================================= [ERROR] Took 10.85 seconds =============================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

And removing the lib_ignore section gives this same “green tea” error.

Here is the log.

Executing task: platformio run <

[Wed May 9 12:59:21 2018] Processing ubloxc027 (platform: nxplpc; board: ubloxc027; framework: mbed)

Verbose mode can be enabled via -v, --verbose option
PLATFORM: NXP LPC > u-blox C027
SYSTEM: LPC1768 96MHz 64KB RAM (512KB Flash)
DEBUG: CURRENT(cmsis-dap) ON-BOARD(cmsis-dap) EXTERNAL(blackmagic, jlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(deep+) COMPATIBILITY(off)
Collected 22 compatible libraries
Scanning dependencies…
Dependency Graph
|-- v5.13.1
|-- <C027_Support>
| |--
| | |--
| | |-- v1.1.0
| | |--
| | | |--
| | | |--
| | | |--
| | |-- <mbed-COMMON_PAL>
| | |--
| | |--
| | |--
| | |--
| | |--
| | |--
| | |--
| | |--
| | | |-- <mbed-COMMON_PAL>
| | |--
| | | |--
| | |--
| | |--
| | | |--
| | |--
|--
|--
| |--
| |-- v1.1.0
| |--
| | |--
| | |--
| | |--
| |-- <mbed-COMMON_PAL>
| |--
| |--
| |--
| |--
| |--
| |--
| |--
| |--
| | |-- <mbed-COMMON_PAL>
| |--
| | |--
| |--
| |--
| | |--
| |--
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/AnalogIn.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/BusIn.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/BusInOut.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/BusOut.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/CAN.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Ethernet.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/FlashIAP.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/I2C.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/I2CSlave.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/InterruptIn.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/InterruptManager.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/MbedCRC.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/RawSerial.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/SPI.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/SPISlave.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Serial.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/SerialBase.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/TableCRC.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Ticker.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Timeout.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/Timer.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/TimerEvent.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/drivers/UARTSerial.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_critical_section_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_flash_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_gpio.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_itm_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_lp_ticker_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_pinmap_common.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_sleep_manager.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_ticker_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/hal/mbed_us_ticker_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/ATCmdParser.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/CallChain.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FileBase.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FileHandle.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FilePath.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/FileSystemHandle.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/LocalFileSystem.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/Stream.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_alloc_wrappers.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_application.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_assert.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_board.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_critical.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_error.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_interface.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_mem_trace.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_mktime.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_poll.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_retarget.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_rtc_time.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_sdk_boot.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_semihost_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_stats.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_wait_api_no_rtos.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/platform/mbed_wait_api_rtos.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/mbed_overrides.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/onboard_modem_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/ublox_low_level_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/analogin_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/analogout_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/can_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/CRP.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_GCC_ARM/startup_LPC17xx.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/flash_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/device/system_LPC17xx.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/ethernet_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/gpio_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/gpio_irq_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/i2c_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/pinmap.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/port_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/pwmout_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/rtc_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/serial_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/sleep.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/spi_api.o
Compiling .pioenvs/ubloxc027/FrameworkMbedCore/targets/TARGET_NXP/TARGET_LPC176X/us_ticker.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBAudio/USBAudio.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBDevice/USBDevice.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBHID/USBHID.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBHID/USBKeyboard.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBHID/USBMouse.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBHID/USBMouseKeyboard.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBMIDI/USBMIDI.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBMSD/USBMSD.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBSerial/USBCDC.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/USBSerial/USBSerial.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/targets/TARGET_NXP/USBHAL_LPC11U.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/targets/TARGET_NXP/USBHAL_LPC17.o
Compiling .pioenvs/ubloxc027/lib6a4/USBDevice/targets/TARGET_NXP/USBHAL_LPC40.o
Compiling .pioenvs/ubloxc027/lib4ce/greentea-client_ID963/test_env.o
.piolibdeps/greentea-client_ID963/source/test_env.cpp: In function ‘void greentea_notify_version()’:
.piolibdeps/greentea-client_ID963/source/test_env.cpp:355:59: error: ‘YOTTA_GREENTEA_CLIENT_VERSION_STRING’ was not declared in this scope
greentea_send_kv(GREENTEA_TEST_ENV_HOST_TEST_VERSION, YOTTA_GREENTEA_CLIENT_VERSION_STRING);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.piolibdeps/greentea-client_ID963/source/test_env.cpp:355:59: note: suggested alternative: 'GREENTEA_CLIENT_TEST_ENV_H_'
greentea_send_kv(GREENTEA_TEST_ENV_HOST_TEST_VERSION, YOTTA_GREENTEA_CLIENT_VERSION_STRING);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GREENTEA_CLIENT_TEST_ENV_H_
Compiling .pioenvs/ubloxc027/lib5d0/events/EventQueue.o
*** [.pioenvs/ubloxc027/lib4ce/greentea-client_ID963/test_env.o] Error 1
============================================================ [ERROR] Took 253.85 seconds ============================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

I am unable to attach a zip file as an attachment. I ll try to see if I can send it to you as a PM.

EDIT:
No dice sending the zip file even as a message!! Can you suggest any way I can get the files across to you??

Thank you @maxgerhardt !! :slight_smile:


#8

I understood the issue.

In the “C027_Support” library, it wants to include a device-specific header

#ifdef TARGET_UBLOX_C027
 #include "C027_api.h"
#endif

The C027_api.h is however extremely outdated (refrence from mbedos from 2014 that has this file). In recent mbed versions, this file is now called ublox_low_level.h with a few changed function names (recent file here)

So the way to fix it is to:

  • change C027_api.h to ublox_low_level_api.h
  • change all occurences of old function names to new function names ( e.g. c027_mdm_powerOn -> ublox_mdm_powerOn et cetera)

I just made copy of the library, fixed the errors and put it into the lib/ folder as C027_Support_Fixed and adapted the platformio.ini to include C027_Support_Fixed and ignore C027_Support.

Once this is done you are greeted with

PLATFORM: NXP LPC > u-blox C027
SYSTEM: LPC1768 96MHz 64KB RAM (512KB Flash)
DEBUG: CURRENT(cmsis-dap) ON-BOARD(cmsis-dap) EXTERNAL(blackmagic, jlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(deep+) COMPATIBILITY(off)
Collected 18 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ArduinoJson> v5.13.1 (C:\Users\Maxi\Desktop\Archive\.piolibdeps\ArduinoJson_ID64)
|-- <mbed-rtos> (C:\Users\Maxi\.platformio\packages\framework-mbed\rtos)
|-- <C027_Support> (C:\Users\Maxi\Desktop\Archive\lib\C027_Support_Fixed)
[...]
arm-none-eabi-g++ -o .pioenvs\ubloxc027\firmware.elf -mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,-T".pioenvs\ubloxc027\LPC1768.ld.link_script.ld" @"C:\Users\Maxi\Desktop\Archive\.pioenvs\ubloxc027\longcmd-821c015bc5c99077d7577c4b19b46060" -L.pioenvs\ubloxc027 -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -lc -lstdc++ -Wl,--end-group
arm-none-eabi-size -B -d .pioenvs\ubloxc027\firmware.elf
arm-none-eabi-objcopy -O binary .pioenvs\ubloxc027\firmware.elf .pioenvs\ubloxc027\firmware.bin
text	   data	    bss	    dec	    hex	filename
69288	   3156	   7265	  79709	  1375d	.pioenvs\ubloxc027\firmware.elf
 [SUCCESS] Took 25.59 seconds 

#9

:slight_smile:
Thank you so much @maxgerhardt!

It works now!! You are a lifesaver!!

It does lead to another thought. The Ublox_low_level.h already exists in the frameworks folder.
Is there something we can do to make sure that it is fixed in the platformio repo of c027_support library.

Maybe a PR or something?
@ivankravets
Can we implement this change in the existing library as a PR?
It might save someone else some time in the future.

Again,. I cannot thank you enough @maxgerhardt for the help!! :slight_smile:


#10

Thanks for the feedback. You might open a pull request on https://os.mbed.com/teams/ublox/code/C027_Support/pull-requests/, though the last activity there was more than one year ago. You could also try to reach the u-blox directly via mail or something.

Keep in mind that PIO is mostly an indexer for libraries. We ourselves usually don’t write or fix libraries, we can just point to the library authors.