MKR1400 GSM - Fail with PIO

The MKR1400 GSM boards don’t work when built under PIO. The same code will work in the Arduino IDE but in Platform IO the code fails to execute as expected.

This is a recent issue as they use to work without issue.

Please post your platformio.ini, the relevant code and the build output with the error message.

1 Like

Hi

It would be better if I can set up a screen share with someone. Its nothing todo with the PIO file but here it is:

[env:mkrgsm1400]
platform = atmelsam
board = mkrgsm1400
framework = arduino
debug_tool = jlink
upload_protocol = jlink
lib_deps =
arduino-libraries/Arduino_JSON@^0.1.0
arduino-libraries/ArduinoECCX08@^1.3.4
arduino/Arduino Cloud Provider Examples@^1.2.0
arduino-libraries/ArduinoMqttClient@^0.1.5
arduino-libraries/MKRGSM@1.5.0

The fundamental issue is that the code complies uploads but as it starts to run crashes and fails to load files that should have been part of the binary.

In a simple test we connect to the GSM Module and request the current time ( Were not connected to GSM so the time is not correct) The time is requested from the GSM module ( AT+CCLK) the module responds and the time should be stored in a var the result of this is Time Now.

Note in PIO the value is 0

Platform IO:

AT+CCLK?
+CCLK: “21/01/07,10:08:25+00”

OK
TIME NOW: 0


Note the time is correctly stored in the var and displayed when we print this.

Arduino IDE:

AT+CCLK?
+CCLK: “21/01/07,10:11:38+00”

OK
TIME NOW: 1610014298


This is just one of many mistakes PIO makes when compiling. Others included random crashes failure to load the security certificates.

It is simply unusable and this didn’t use to be the case.

This operation has been verified on 2 different machines and 4 different sets of hardware. The only constant failure point is PIO.

Jeremy

Note this issue is the same not matter if upload is via J-Link or USB. ( J-Link is just quicker)

If it runs with the Arduino IDE but not in PIO it usually boils down to a difference either in:

  • Arduino core version (not IDE version)
  • Libraries (different version of the same library or entirely different version)
  • Different build settings

To find the difference:

  • Compare the Arduino core versions (on PIO, it’s printed in the build output)
  • Remove all libraries from the Arduino libraries folder except the ones declared in platformio.ini. Then build again in the Arduino IDE to ensure it’s not picking up an additional library (or just a header file from another library).
  • Carefully compare the library version
  • Have a look at the build settings in the Arduino IDE (basically the settings in the Tools menu). Take a screenshot and post it here.

Hi

Thanks for this. I have spoken with the development team and it is an issue with the Arduino Core bundled with PIO. They are releasing a fix.

If any one else has this issue it should be fixed later today