PlatformIO Community

Blink-test not working for Autonomo (based on arduino Zero)

I’m trying to get rid of the arduino IDE; so I’m using atom.io with platform.io. I Really like the integration of both; but I’m running into a problem :slight_smile:

I have an Autonomo board, basically an Arduino Zero with a solar-charger on it.
When I’m using the arduino IDE and upload a simple sketch it works as expected. The integrated led on D13 wil blink; and in the Serial Monitor the small sentence will show up.

But the exact same ‘sketch’ won’t let the LED blink. The text will show up in the SM.

Any ideas on how to fix this? I must be missing something here :slight_smile:

#include <arduino.h>
// not used in arduino ide

void setup()
{
   SerialUSB.begin(9600);
   while ((!SerialUSB) && (millis() < 10000));

   SerialUSB.println(F("Just a test"));

   pinMode(13, OUTPUT);

}

void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

Thanks, I will look what I can do to help you, looks like the problem on our side.

That would be great!
If you want me to check or test something, please let me know.

Also some more complex sketches won’t work. (eg with TinyGPS++ library + adafruit GPS and/or the RN2483 LoRaWan device; both connected to the autonomo.)

Is it possible to add support for these boards of sodaq?
The boards of Sodaq are defined here http://downloads.sodaq.net/package_sodaq_index.json

Yes, it’s possible, but currently, we don’t add new platforms and boards to the PlatformIO 2.x branch, so the quick and easy way is to add these boards by yourself. Here is a simple manual how to create a custom board. Then you need to add board variants to the framework package in PlatformIO home directory. Looks like these boards use the same upload tools as Arduino, so uploading should work right away.
As an alternative, you can open an issue in our repo with this request and we will add these boards and update frameworks in PlatfromIO 3.0 later.

There is some difference between Zero and Autonomo boards, basically in the MCU type, thus this board requires updating framework package. I described above how to add minimal support for these boards.

I wonder if there has been any movement on this.
I’m trying to do the Blink test with the latest PlatformIo and doesn’t enumerate on USB.
When I build it and download PlatformiIo it Write 7164bytes
When I do it with the Arduino IDE it writes 13368 bytes to flash

Any help/direction appreciated.

Have you specified the right board type? The SODAQ Autonomo is listed as supported.

A simple ‘blink test’ is 12480 byes for me.

image

Hello thanks for the response.
I tried your program and doesn’t work with PlatformIO/VSCode but does with Arduino. So very puzzled.

So my context is that I can get download to work with theIDE Arduino 1.8.9
I manually ensure that the Autonomo SAMD21 is in boot by connecting D10 to GND, and press reset. Then release D10
On Win10 I get Device Manager
Serial Port "Boassa Porgram Port (COM18)"

On Arduino programing
It says Atmel SMART device 0x10010000 SAMD21J18A found
“Write 12840 bytes to flash”

image

and then the Green LED flashes.

The program, basic minimum
void setup()
{
pinMode(13, OUTPUT);
}

void loop()
{
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}

With Platformio - I Create new project Board: Sodaq Autonomo, Framework: Arduino

then press upload button


Linking .pioenvs\sodaq_autonomo\firmware.elf
c:/users/neilh77/.platformio/packages/toolchain-gccarmnoneeabi@1.40804.0/bin/…/lib/gcc/arm-none-eabi/4.8.4/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol Reset_Handler; defaulting to 00002000
Building .pioenvs\sodaq_autonomo\firmware.bin
Checking size .pioenvs\sodaq_autonomo\firmware.elf
Memory Usage → http://bit.ly/pio-memory-usage
DATA: [= ] 6.0% (used 1960 bytes from 32768 bytes)
PROGRAM: [ ] 2.7% (used 7164 bytes from 262144 bytes)
Configuring upload protocol…
AVAILABLE: atmel-ice, blackmagic, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
Looking for upload port…
Auto-detected: COM18
Forcing reset using 1200bps open/close on port COM18
Waiting for the new upload port…
Uploading .pioenvs\sodaq_autonomo\firmware.bin
Atmel SMART device 0x10010000 found
Erase flash
done in 17.953 seconds

Write 7164 bytes to flash (112 pages)
[==============================] 100% (112/112 pages)
done in 6.640 seconds

Verify 7164 bytes of flash
[==============================] 100% (112/112 pages)
Verify successful
done in 0.092 seconds
CPU reset.

Then nothing. No flashes.
The linker is a bit strange with “cannot find entry symbol Reset_Handler; defaulting to 00002000”
But I believe 2000 is correct

However … I’ve got the ran into some problems early on and thought I had blown the boot.
So’ve reporgrammed (I hope only) the boot with
Atmel-42366-SAM-BA-Bootloader-for-SAM-D21\samd21j18a\samd21_sam_ba_both_interfaces.hex

using a black sphere technologies “BMP 2.1”
$arm-none-eabi-gdb samd21_sam_ba_both_interfaces.hex

Initially I had platformio interface to BMP2.1 and I even found a bug with it - but then the Platformio interface wasn’t reliable, and so I’ve gone back to basics - like the blink.

So now I can program from the Arduino IDE, but not from PlatformIO ???
A bit stuck…
there are some differences between libs, but haven’t wanted to probe too much deeper without posting here…
Documents\ArduinoData\packages\SODAQ\hardware\samd\1.6.19\libraries
.platformio\packages\framework-arduinosam\libraries_cores_\samd

With PlatformIO I can build/download for the SAMD21 on the Adafruit Feather M0 - a different board.

appreciate any insight :slight_smile: .

I have got the basic blink & a blink that uses USB working.

I exited Platformio/VScode, I renamed the folder in my account .platformio and then started up PlatformIO - and left it to rebuild.
When completed ~1Gbyte - it now builds and runs sucessfully.

So not sure what happened - but I must have trampled on something at some point.

Many thanks for a place to think out aloud what I was doing. PlatformIO is a fascinating IDE!!!

1 Like

Glad you got it working in the end… I wouldn’t have been able to help much further than to offer a uninstall/reinstall advice as I don’t have any SAM devices handy (or do I… now that I think of it…:open_mouth: )… And yes, once you get out of the Arduino way of doing things… PlatformIO is really, really cool… and has a very helpful community! :smiley: