Coder Social home page Coder Social logo

platformio / platform-atmelsam Goto Github PK

View Code? Open in Web Editor NEW
79.0 8.0 107.0 19.83 MB

Atmel SAM: development platform for PlatformIO

Home Page: https://registry.platformio.org/platforms/platformio/atmelsam

License: Apache License 2.0

Python 100.00%
atmel-sam platformio embedded hardware microcontroller samd arduino mbed simba platformio-platform

platform-atmelsam's Introduction

PlatformIO Core

CI Build for PlatformIO Core CI Build for Docs CI Build for dev-platform examples CI Build for the Community Projects Latest Version PlatformIO Labs

Quick Links: Homepage | PlatformIO IDE | Registry | Project Examples | Docs | Donate | Contact Us

Social: LinkedIn | Twitter | Facebook | Community Forums

https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-ide-laptop.png

PlatformIO: Your Gateway to Embedded Software Development Excellence.

Unlock the true potential of embedded software development with PlatformIO's collaborative ecosystem, embracing declarative principles, test-driven methodologies, and modern toolchains for unrivaled success.

  • Open source, maximum permissive Apache 2.0 license
  • Cross-platform IDE and Unified Debugger
  • Static Code Analyzer and Remote Unit Testing
  • Multi-platform and Multi-architecture Build System
  • Firmware File Explorer and Memory Inspection

Get Started

Solutions

Advanced

Registry

Contributing

See contributing guidelines.

Telemetry / Privacy Policy

Share minimal diagnostics and usage information to help us make PlatformIO better. It is enabled by default. For more information see:

License

Copyright (c) 2014-present PlatformIO <[email protected]>

The PlatformIO is licensed under the permissive Apache 2.0 license, so you can use it in both commercial and personal projects with confidence.

SWUbanner

platform-atmelsam's People

Contributors

ansonhex avatar balbinus avatar beldroththegold avatar dangerousfish avatar eerimoq avatar ivankravets avatar maxgerhardt avatar mivr avatar prices avatar samiralavi avatar smarpug avatar valeros avatar yannicked avatar zeroisnan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platform-atmelsam's Issues

Some analog ports missing on atmelsam (adafruit_feather_m0_usb)

What kind of issue is this?

  • Bug report. If you’ve found a bug, please provide information below.

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system:

Blakes-MacBook:~ blake$ uname -a
Darwin Blakes-MacBook 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
Blakes-MacBook:~ blake$ sw_vers -productVersion
10.11.6

PlatformIO Version (platformio --version):

Blakes-MacBook:~ blake$ platformio --version
PlatformIO, version 2.11.2

Description of problem

There appear to be some special analog input ports that are not defined in the PlatformIO environment, but are defined in the Adafruit boards for the Arduino IDE. I am specifically using the Adafruit Feather M0 Bluefruit LE and the desired pin is analog pin 7 which is defined in the Arduino IDE as A7.

The Adafruit boards I installed were from https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

Steps to Reproduce

  1. Attempt to access analog pin A7. For instance, analogRead(A7);

Actual Results

src/main.cpp:69:16: error: 'A7' was not declared in this scope
[ ERROR ] Took 6.95 seconds

Expected Results

[SUCCESS] Took 7.87 seconds

If problems with PlatformIO Build System:

The content of platformio.ini:

#
# PlatformIO Project Configuration File
#
# Please make sure to read documentation with examples first
# http://docs.platformio.org/en/stable/projectconf.html
#
[env:adafruit_feather_m0_usb]
platform = atmelsam
framework = arduino
board = adafruit_feather_m0_usb

Source file to reproduce issue:

void setup() {
  // put your setup code here, to run once:
  analogRead(A7);
}

void loop() {
  // put your main code here, to run repeatedly:

}

Additional info

Adafruit Feather M0 Bluefruit LE tutorial

No wire.h for sodaq one board

When trying to use platform.io for a sodaq one board (see https://github.com/jwillemsen/Sodaq_UBlox_GPS/tree/jwi-travis) I get an error that Wire.h is not available, don't have this problem when just compiling with ardion

$ pio update
********************************************************************************
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for IoT development > http://platformio.org/platformio-ide
********************************************************************************

Platform Manager
================

Library Manager
===============

$ platformio ci --lib="./src" $PLATFORMIO_CI_EXTRA_ARGS
The next files/directories have been created in /tmp/tmpg8ZiDv
platformio.ini - Project Configuration File
src - Put your source files here
lib - Put here project specific (private) libraries

Project has been successfully initialized!
Useful commands:
`platformio run` - process/build project from the current directory
`platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board
`platformio run --target clean` - clean project (remove compiled files)
`platformio run --help` - additional information
[Wed Feb 15 12:19:50 2017] Processing sodaq_one (platform: atmelsam, board: sodaq_one, framework: arduino)
--------------------------------------------------------------------------------
PlatformManager: Installing atmelsam
Downloading...
Unpacking...
atmelsam @ 1.7.0 has been successfully installed!
The platform 'atmelsam' has been successfully installed!
The rest of packages will be installed automatically depending on your build environment.
PackageManager: Installing toolchain-gccarmnoneeabi @ >=1.40803.0,<1.40805.0
Downloading...
Unpacking...
toolchain-gccarmnoneeabi @ 1.40804.0 has been successfully installed!
PackageManager: Installing framework-arduinosam @ ~2.10611.0
Downloading...
Unpacking...
framework-arduinosam @ 2.10611.0 has been successfully installed!
PackageManager: Installing tool-scons @ ~3.20501.2
Downloading...
Unpacking...
tool-scons @ 3.20501.2 has been successfully installed!
Verbose mode can be enabled via `-v, --verbose` option
Converting test_ublox_gps.ino
Collected 6 compatible libraries
Looking for dependencies...
Library Dependency Graph
|-- <src>
Compiling .pioenvs/sodaq_one/src/test_ublox_gps.ino.o
Compiling .pioenvs/sodaq_one/FrameworkArduinoVariant/variant.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/IPAddress.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/Print.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/Reset.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/RingBuffer.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/SERCOM.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/Stream.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/Tone.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/USB/CDC.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/USB/PluggableUSB.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/USB/USBCore.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/USB/samd21_host.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/Uart.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/WInterrupts.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/WMath.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/WString.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/abi.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/avr/dtostrf.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/cortex_handlers.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/delay.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/hooks.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/itoa.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/main.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/new.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/pulse.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/pulse_asm.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/startup.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/wiring.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/wiring_analog.o
/home/travis/.platformio/packages/framework-arduinosam/cores/sodaq/wiring.c: In function 'init':
/home/travis/.platformio/packages/framework-arduinosam/cores/sodaq/wiring.c:60:12: warning: unused variable 'ul' [-Wunused-variable]
uint32_t ul ;
^
Compiling .pioenvs/sodaq_one/FrameworkArduino/wiring_digital.o
Compiling .pioenvs/sodaq_one/FrameworkArduino/wiring_private.o
Archiving .pioenvs/sodaq_one/libFrameworkArduinoVariant.a
Indexing .pioenvs/sodaq_one/libFrameworkArduinoVariant.a
Compiling .pioenvs/sodaq_one/FrameworkArduino/wiring_shift.o
Compiling .pioenvs/sodaq_one/lib/src/Sodaq_UBlox_GPS.o
Archiving .pioenvs/sodaq_one/libFrameworkArduino.a
Indexing .pioenvs/sodaq_one/libFrameworkArduino.a
lib/src/Sodaq_UBlox_GPS.cpp:21:18: fatal error: Wire.h: No such file or directory
#include <Wire.h>
^
compilation terminated.
*** [.pioenvs/sodaq_one/lib/src/Sodaq_UBlox_GPS.o] Error 1
========================== [ERROR] Took 34.49 seconds ==========================


The command "platformio ci --lib="./src" $PLATFORMIO_CI_EXTRA_ARGS" exited with 1.
store build cache

changes detected, packing new archive
.
.
.
.
.
uploading archive


Done. Your build exited with 1.

Add support for "Adafruit Metro M4 Express AirLift (WiFi) - Lite"

Feature Request:

This is a request to support Adafruit Metro M4 Express AirLift (WiFi) - Lite.
Adafruit just released a new board with Cortex M4 and an ESP32.

Read more about the board at https://www.adafruit.com/product/4000
But here is some data to get you intrested:

  • Cortex M4 core running at 120 MHz
  • Floating point support with Cortex M4 DSP instructions
  • 512 KB flash, 192 KB RAM
  • 32-bit, 3.3V logic and power
  • Dual 1 MSPS DAC (A0 and A1)
  • Dual 1 MSPS ADC (8 analog pins)
  • 6 x hardware SERCOM (I2C, SPI or UART)
  • 22 x PWM outputs
  • Stereo I2S input/output with MCK pin
  • 10-bit Parallel capture controller (for camera/video in)
  • Built in crypto engines with AES (256 bit), true RNG, Pubkey controller
  • 64 QFN

Feature Request: Handy port finder for recovering after botched upload

The Arduino IDE allows a port search/reset mid-upload to recover the serial port after uploading a botched sketch. This feature is super handy and would be nice to have in PIO.

Here's a description in Adafruit's FAQ: https://learn.adafruit.com/adafruit-feather-32u4-adalogger/faq#faq-3

The same functionality applies to the 32u4 and SAMD21/M0 (and I assume other boards with separate programming port numbers).


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

upgrade to Atmel SAM 3.50 (from 3.4.2) changed M0 (A0) output voltage

I upgraded from 3.4.2 to 3.5.0 and i noticed this:

hw: adafruit itsybitsy M0 (samd21)

with 3.4.2

  • A0 output went from 0 to 3.3v using 0 to 255
  • no build warning

with 3.5.0

  • A0 output went from 0 to 3.3v using 0 to 1024
  • the following build warning started showing up:
    ".platformio\packages\framework-arduinosam\cores\adafruit\wiring_analog.c:35:12: warning: '_dacResolution' defined but not used [-Wunused-variable] static int _dacResolution = 10;"

questions

  • was this intentional?

observations

  • arduino docs say
    "analogWriteResolution() sets the resolution of the analogWrite() function. It defaults to 8 bits (values between 0-255) for backward compatibility with AVR based boards."
  • it was a bit confusing at first
  • change not noted in changelog
  • going to trip up newbies

thanks

  • visual code with platformio is awesome, thank you.

add custom board ATSAML21E15B

Hello,

Help understand the ideology of the PlatformIO.
I want to add my board ATSAML21E15B I use mbed.
It is enough to create in the directory of boards saml21e15b.json?
Or I need to create platform to.

Thank you.
Andrew.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

cannot find Seeeduino LoRaWAN

Hey all,
I am trying to find Seeeduino LoRaWAN on the Board Explorer. But it seems that it is not available yet.
Please let me know if you guys can help me?
Thank You.

Support for Flutter Boards

Moved from platformio/platformio-core#871

Please add support for Flutter Wireless http://flutterwireless.com boards.
These are ARM based and arduino compatible devices.

http://flutterwireless.com/index.php?route=product/product&path=59&product_id=42

Software Compatibility Arduino & GCC
Memory
Storage 64KB
RAM 16KB
Processor
Clockspeed 64mhz
Physical Pins 10 Digital + 5 Analog / Digital


Useful links:

/cc @kevinfoote

Unable to upload to saml21_xpro_b

After compilation and upload I have the following:

Linking .pioenvs/saml21_xpro_b/firmware.elf
Checking program size
text       data     bss     dec     hex filename
1028         36   32584   33648    8370 .pioenvs/saml21_xpro_b/firmware.elf
Building .pioenvs/saml21_xpro_b/firmware.bin
Configuring upload protocol...
AVAILABLE: atmel-ice, blackmagic, cmsis-dap, jlink
CURRENT: upload_protocol = cmsis-dap
Uploading .pioenvs/saml21_xpro_b/firmware.bin
GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00392-gbe9ef0b0 (2018-01-12-14:56)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
little
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 03.25.01B6
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91saml21j18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000854 msp: 0x20002048
** Programming Started **
auto erase enabled
Info : SWD DPIDR 0x0bc11477
Error: Failed to read memory at 0x400e0420
Error: Cannot read SAM3 register: CKGR_MOR @ 0x400e0420, Err: -4
Error: Cannot read SAM3 register: CKGR_MOR @ 0x400e0420, Error: -4
Error: auto_probe failed
embedded:startup.tcl:476: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 532
at file "embedded:startup.tcl", line 476
*** [upload] Error 1

My platformio.ini is:

[env:saml21_xpro_b]
platform = atmelsam
framework = mbed
board = saml21_xpro_b

I'm using Ubuntu 14.04 and PlatformIO: Home 0.9.5 Core 3.5.3b1

Brand new SAML21 board, on AtmelStudio7 (Windows 7) upload works perfectly.

SODAQ_SARA building problem: pin definitions not declared

Hello!

First of all, thank you for adding SODAQ SARA board, I've waited for it a lot :)

Anyway, I have problems with building my code for SODAQ_SARA. I would like to use this example:
https://github.com/SodaqMoja/Sodaq_nbIOT/tree/master/examples/nbIOT_test_udp
With Arduino IDE it works fine, but when I try to build it with PlatformIO, I get errors like this:

src\main.cpp:18:19: error: 'SARA_TX_ENABLE' was not declared in this scope #define enablePin SARA_TX_ENABLE ^ src\main.cpp:70:40: note: in expansion of macro 'enablePin' nbiot.init(MODEM_STREAM, powerPin, enablePin, SARA_R4XX_TOGGLE, cid); // init() ^

I know, that pin name definitions are in variant.h, and I've updated PlatformIO, so the SODAQ_SARA variant is in ...platformio\packages\framework-arduinosam\variants

What am I doing wrong?

'RingBuffer' does not name a type

I hope this is the correct repository for this (I'm new to platformIO).

When trying to compile for the Arduino Due I get the following error.

In file included from C:\Users\[user]\.platformio\packages\framework-arduinosam\cores\sam/Arduino.h:222:0,
from C:\Users\[user]\.platformio\packages\framework-arduinosam\variants\arduino_due_x/variant.h:36,

from C:\Users\[user]\.platformio\packages\framework-arduinosam\libraries\__cores__\sam\Wire\src/Wire.h:28,
from src\radiometerLoggerDue.cpp:1:
C:\Users\[user]\.platformio\packages\framework-arduinosam\cores\sam/USB/USBAPI.h:50:2: error: 'RingBuffer' does
 not name a type
RingBuffer *_cdc_rx_buffer;
^

I'm on Windows 10 64-bit. Here's the dependency graph of include files:

Dependency Graph
|-- <TinyGPSPlus> 1.0.0
|-- <RTClib> 1.2.0
|   |-- <Wire> 1.0

|-- <Wire> 1.0
|-- <SPI> 1.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <SD>
|   |-- <SPI> 1.0

Atmel ASF3 as alternative framework?

I'm interested in using PlatformIO to develop for the SAMD21 series, using the Atmel Software Framework. To achieve this, I need to set up ASF as a framework correct? Like framework-arduinosam, but it would be "framework-asf" or something like that.

Where should I look to get an idea of how to achieve this? Is there any relevant documentation? For the short term i'm just looking to port SAM21G18A, but I could expand that to more of the ASF later on.

I'm new to PIO, so any help would be greatly appreciated!

Industruino support

This should be rather easy, but it has some pitfalls. First, it uses modified bossac-0x4000 tool (different bootloader size). Should be easier with this sorted out:
shumatech/BOSSA#33
Also, needs to be added to https://github.com/platformio/platformio-core/blob/develop/scripts/99-platformio-udev.rules

# Industruino
ATTRS{idVendor}=="2e78", ATTRS{idProduct}=="004d", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="2e78", ATTRS{idProduct}=="004d", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e78", ATTRS{idProduct}=="004d", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="2e78", ATTRS{idProduct}=="004d", MODE:="0666"

failing to run remote tests on Adafruit Feather M0

I am running a remote agent on Ubuntu with an Adafruit Feather M0 attached. I am trying to run tests remotely from a Mac. It seems to connect and to accept the test request. It appears to upload the code, but then variously either freezes or throws an error as shown below.

The sequence I see on the remote agent is:
Remote command received: psync
Remote command received: test

And the M0 LED seems to indicate the code is being uploaded.

Things I have tried:

  • copied udev rules to both /etc/udev/rules.d and /lib/udev/rules.d
  • added this to my udev rules: ATTR{idProduct}=="239A", ATTR{idVendor}=="800B", MODE="666"
  • restarted udev
  • sudo usermod -a -G dialout $USER
  • sudo usermod -a -G plugdev $USER
  • verified these tests still work locally

The full transcript from my attempted test run:

scott@scotts-mbp-2:~/Projects/knightlab/SensorGrid$ pio remote device list
Agent ThinkPad
==============
/dev/ttyS4
----------
Hardware ID: WACf008
Description: ttyS4

/dev/ttyS0
----------
Hardware ID: PNP0501
Description: ttyS0

/dev/ttyACM0
------------
Hardware ID: USB VID:PID=239A:800B SER=60DB1ED9514D503535202020FF162933 LOCATION=1-6.4:1.0
Description: Adafruit Feather M0

scott@scotts-mbp-2:~/Projects/knightlab/SensorGrid$ pio remote test -v
Building project locally
Verbose mode can be enabled via `-v, --verbose` option
Collected 1 items

========================================== [test/test_common] Building... (1/3) ==========================================
Processing adafruit_feather_m0 (framework: arduino; platform: atmelsam; board: adafruit_feather_m0)
--------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/adafruit_feather_m0.html
PLATFORM: Atmel SAM > Adafruit Feather M0
HARDWARE: SAMD21G18A 48MHz 32KB RAM (256KB Flash)
DEBUG: CURRENT(atmel-ice) EXTERNAL(atmel-ice, blackmagic, jlink)
Converting SensorGridPM.ino
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 78 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <RadioHead> 1.82
|   |-- <RadioHead.1.8.2>
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|-- <RTCZero> 1.5.2
|-- <RTClib> 1.2.1
|   |-- <Wire> 1.0
|-- <SdFat> 1.0.5
|   |-- <SPI> 1.0
|-- <ArduinoJson> 5.13.1
|-- <Adafruit SSD1306> 1.1.2
|   |-- <Wire> 1.0
|   |-- <Adafruit GFX Library> 1.2.3
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|-- <Adafruit GFX Library> 1.2.3
|   |-- <SPI> 1.0
|-- <Adafruit Feather OLED> 1
|   |-- <Wire> 1.0
|   |-- <Adafruit GFX Library> 1.2.3
|   |   |-- <SPI> 1.0
|   |-- <Adafruit SSD1306> 1.1.2
|   |   |-- <Wire> 1.0
|   |   |-- <Adafruit GFX Library> 1.2.3
|   |   |   |-- <SPI> 1.0
|   |   |-- <SPI> 1.0
|-- <Adafruit Si7021 Library> 1.1.0
|   |-- <Wire> 1.0
|-- <TaskScheduler> 2.6.1
|   |-- <RTClib> 1.2.1
|   |   |-- <Wire> 1.0
|   |-- <SdFat> 1.0.5
|   |   |-- <SPI> 1.0
|   |-- <RTCZero> 1.5.2
|-- <KnightLab_SDConfig> 1.0
|   |-- <SdFat> 1.0.5
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|-- <KnightLab_GPS> 1.0
|   |-- <Adafruit GPS Library> 1.0.2
|-- <KnightLab_Sensors> 1.0
|   |-- <ArduinoJson> 5.13.1
|   |-- <KnightLab_ArduinoUtils> 1.0
|   |   |-- <RTCZero> 1.5.2
|   |-- <Adafruit Si7021 Library> 1.1.0
|   |   |-- <Wire> 1.0
|-- <KnightLab_LoRaUtils> 1.0
|   |-- <KnightLab_ArduinoUtils> 1.0
|   |   |-- <RTCZero> 1.5.2
|   |-- <RadioHead.1.8.2>
|   |   |-- <SPI> 1.0
|-- <KnightLab_FeatherUtils> 1.0
|-- <test>
|   |-- <KnightLab_ArduinoUtils> 1.0
|   |   |-- <RTCZero> 1.5.2
|   |-- <KnightLab_LoRaUtils> 1.0
|   |   |-- <KnightLab_ArduinoUtils> 1.0
|   |   |   |-- <RTCZero> 1.5.2
|   |   |-- <RadioHead.1.8.2>
|   |   |   |-- <SPI> 1.0
|-- <KnightLab_ArduinoUtils> 1.0
|   |-- <RTCZero> 1.5.2
Compiling .pioenvs/adafruit_feather_m0/src/SensorGridPM.ino.cpp.o
Checking size .pioenvs/adafruit_feather_m0/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [==        ]  23.6% (used 7736 bytes from 32768 bytes)
PROGRAM: [==        ]  19.4% (used 50896 bytes from 262144 bytes)
Testing project remotely
Verbose mode can be enabled via `-v, --verbose` option
Collected 1 items

==================== [test/test_common] Uploading... (2/3) ====================
Processing adafruit_feather_m0 (framework: arduino; platform: atmelsam; board: adafruit_feather_m0)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Configuring upload protocol...
AVAILABLE: atmel-ice, blackmagic, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
Looking for upload port...
Auto-detected: /dev/ttyACM0
Forcing reset using 1200bps open/close on port /dev/ttyACM0
Waiting for the new upload port...
Uploading .pioenvs/adafruit_feather_m0/firmware.bin
Erase flash

Done in 0.818 seconds
Write 50896 bytes to flash (796 pages)
[==============================] 100% (796/796 pages)
Done in 0.319 seconds
Verify 50896 bytes of flash
[==============================] 100% (796/796 pages)
Verify successful
Done in 0.623 seconds

===================== [test/test_common] Testing... (3/3) =====================
If you don't see any output for the first 10 secs, please reset board (press reset button)

Error: Traceback (most recent call last):
  File "<string>", line 70, in main
  File "/home/scott/tmp/pio/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/scott/tmp/pio/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/home/scott/tmp/pio/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/scott/tmp/pio/local/lib/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/scott/tmp/pio/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/scott/tmp/pio/local/lib/python2.7/site-packages/click/decorators.py", line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "<string>", line 61, in cli
  File "<string>", line 175, in process
  File "<string>", line 184, in run
  File "/home/scott/tmp/pio/local/lib/python2.7/site-packages/serial/serialposix.py", line 286, in open
    self._update_dtr_state()
  File "/home/scott/tmp/pio/local/lib/python2.7/site-packages/serial/serialposix.py", line 636, in _update_dtr_state
    fcntl.ioctl(self.fd, TIOCMBIC, TIOCM_DTR_str)
IOError: [Errno 32] Broken pipe

============================================================
An unexpected error occurred. Further steps:
* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command
* Try to find answer in FAQ Troubleshooting section
  http://docs.platformio.org/page/faq.html
* Report this problem to [email protected]
============================================================

Code built for Feather M0 does not run

PlatformIO 3.5.0a4 built Blinky sample fails on Feather M0. Same code built with Arduino IDE 1.8.1 runs fine.

PlatformIO env settings are:

platform = atmelsam
board = adafruit_feather_m0
framework = arduino

The code uploads but crashes. (Indication of crash is standard for Feather - the USB port disappears. And of course the LED does not blink.)

Add -u to avrdude for arduino.org M0

I've been trying recently to use a (clone) arduino.org M0, which avrdude has had a hard time uploading to, at least outside of the IDE. This isn't just my problem, as a forum post at http://www.arduino.org/forums/zero?p=5683 mentioned it, but nothing I've found has an archive of it, and I only found it because of DuckDuckGo's cached search results. I played around with it, and it appears that avrdude in the Arduino IDE doesn't read the fuses, but it does outside of the IDE. For PlatformIO to successfully upload to the M0, the -u argument needs to be added to avrdude. I'm running PlatformIO 3.4.1 on MacOS 10.12.4.

Compiling error in USB_device.h

When compiling a simple sketch in platformio with
#include <Arduino.h>
the following error comes up:

[...]\toolchain-gccarmnoneeabi\arm-none-eabi\include\c++\4.8.4\bits\basic_string.h: In member function 'int std::basic_string<_CharT, _Traits, _Alloc>::compare(const std::basic_string<_CharT, _Traits, _Alloc>&) const':
[...]\framework-arduinosam\system\sam\libsam/include/USB_device.h:364:25: error: expected unqualified-id before '(' token

#define Min(a, b)       (((a) < (b)) ?  (a) : (b))
^

The macro seems perfect and I never use it in my code, so what could have gone wrong?

Unable to upload to samd21_xpro

I am unable to program my Atmel SAM D21 Xplained Pro. I have run pip install -U platformio and pip install -U https://github.com/platformio/platformio-core/archive/develop.zip on Ubuntu 16.04 and had the same results (ignoring the "Obsolete PIO Core warning...):

platformio run -t upload -v
**************************************************************************************************************************
Obsolete PIO Core v3.5.1 is used (previous was 3.5.2a6)
Please remove multiple PIO Cores from a system:
http://docs.platformio.org/page/faq.html#multiple-pio-cores-in-a-system
**************************************************************************************************************************
[Tue Jan 30 09:42:01 2018] Processing samd21_xpro (platform: atmelsam; board: samd21_xpro; framework: mbed)
--------------------------------------------------------------------------------------------------------------------------
Collected 22 compatible libraries
Scanning dependencies...
No dependencies
"openocd" -s /home/user/.platformio/packages/tool-openocd/scripts -f atmel_samd21_xplained_pro.cfg -c "telnet_port disabled; program {{.pioenvs/samd21_xpro/firmware.bin}} verify reset ; shutdown"
Open On-Chip Debugger 0.9.0-g932ec70 (2017-02-15-11:32)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Runtime Error: embedded:startup.tcl:60: Can't find atmel_samd21_xplained_pro.cfg
in procedure 'script'
at file "embedded:startup.tcl", line 60
*** [upload] Error 1
=============================================== [ERROR] Took 1.14 seconds ===============================================

It seems that openocd is being told to look for atmel_samd21_xplained_pro.cfg in the wrong place. That config file is in /home/user/.platformio/packages/tool-openocd/scripts/board/atmel_samd21_xplained_pro.cfg, not /home/user/.platformio/packages/tool-openocd/scripts.

Version 3.4.0 : my code is not working anymore

I can compile and upload various codes but they don’t run like usual (rotary not working anymore / I2C display not working …)
I have a second machine still on 3.2.0 and it works fine when I compile and upload the same code (shared via Dropbox)
I reverted to 3.2.0 using pio platform install [email protected] and my codes run again

maybe you are making too much modification in one go ?
could you split the update like
3.2.1 : Update Adafruit Core to 1.2.3
3 2.2 : Update Arduino Core to 1.6.19

etc …
to let us find where to look ?

here is my platformio.ini

Warning on wiring.c for the sodaq boards

I am trying to enable travis-ci support using pipeline for the sodaq boards. We want our code to be warning free so use -Werror as option, but it seems there is a warning in the sodaq one support code. Probably an easy fix, but can't find where this code is coming from.

Project has been successfully initialized!

Useful commands:

`platformio run` - process/build project from the current directory

`platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board

`platformio run --target clean` - clean project (remove compiled files)

`platformio run --help` - additional information

[Thu Feb  2 20:03:34 2017] Processing sodaq_autonomo (platform: atmelsam, board: sodaq_autonomo, framework: arduino)

--------------------------------------------------------------------------------

PackageManager: Installing framework-arduinosam @ ~2.10611.0

Downloading...

Unpacking...

framework-arduinosam @ 2.10611.0 has been successfully installed!

Verbose mode can be enabled via `-v, --verbose` option

Converting SodaqAutonomo-basic.ino

Collected 6 compatible libraries

Looking for dependencies...

Library Dependency Graph

|-- <src>

Compiling .pioenvs/sodaq_autonomo/src/SodaqAutonomo-basic.ino.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduinoVariant/variant.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/IPAddress.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/Print.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/Reset.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/RingBuffer.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/SERCOM.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/Stream.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/Tone.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/USB/CDC.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/USB/PluggableUSB.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/USB/USBCore.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/USB/samd21_host.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/Uart.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/WInterrupts.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/WMath.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/WString.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/abi.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/avr/dtostrf.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/cortex_handlers.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/delay.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/hooks.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/itoa.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/main.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/new.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/pulse.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/pulse_asm.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/startup.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/wiring.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/wiring_analog.o

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/wiring_digital.o

/home/travis/.platformio/packages/framework-arduinosam/cores/sodaq/wiring.c: In function 'init':

/home/travis/.platformio/packages/framework-arduinosam/cores/sodaq/wiring.c:60:12: error: unused variable 'ul' [-Werror=unused-variable]

uint32_t ul ;

^

cc1: all warnings being treated as errors

Compiling .pioenvs/sodaq_autonomo/FrameworkArduino/wiring_private.o

*** [.pioenvs/sodaq_autonomo/FrameworkArduino/wiring.o] Error 1

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Upload Error on sodaq_autonomo : SAM-BA operation failed

Hi, I'm trying to upload a program to my sodaq_autonomo but unfortunatly it fails.

The build is fine, but when i'm trying to upload the program:

Looking for upload port...
Auto-detected: COM7
Forcing reset using 1200bps open/close on port COM7
Waiting for the new upload port...
Uploading .pioenvs\sodaq_autonomo\firmware.bin
 
SAM-BA operation failed
Atmel SMART device 0x10010000 found
*** [upload] Error 1
 [ERROR] Took 27.73 seconds

I saw a similar error have been reported here: https://community.platformio.org/t/unable-to-load-to-mkrzero/1502

For the record, here is the output with the Arduino IDE (I need to press the reset button to start the upload):

Atmel SMART device 0x10010000 found
Device       : ATSAMD21J18A
Chip ID      : 10010000
Version      : v2.0 [Arduino:XYZ] May  9 2016 16:06:46
Address      : 8192
Pages        : 3968
Page Size    : 64 bytes
Total Size   : 248KB
Planes       : 1
Lock Regions : 16
Locked       : none
Security     : false
Boot Flash   : true
BOD          : true
BOR          : true
Arduino      : FAST_CHIP_ERASE
Arduino      : FAST_MULTI_PAGE_WRITE
Arduino      : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.844 seconds

Write 14376 bytes to flash (225 pages)

[========                      ] 28% (64/225 pages)
[=================             ] 56% (128/225 pages)
[=========================     ] 85% (192/225 pages)
[==============================] 100% (225/225 pages)
done in 0.089 seconds

Verify 14376 bytes of flash with checksum.
Verify successful
done in 0.018 seconds
CPU reset.

Regards.

[FR] Support to SAM4E8E

Hello, I see there is no support for soc in title. Is there any idea to support it in the future?

bossa source code?

Hi,

tool-bossa package.json says:

    "description": "Basic Open Source SAM-BA Application (BOSSA)",
    "name": "tool-bossac",
    "system": "linux_x86_64",
    "url": "https://github.com/shumatech/BOSSA",
    "version": "1.10700.0"

I cannot find in the shumatech/BOSSA reference to "1.10700.0" (no result via google except platformio :) ), where can I find the source code and build options used to produce the bossac binary (URL below) provided by tool-bossac?

https://bintray.com/platformio/dl-packages/tool-bossac#files

Thanks!

fatal error: variant.h: No such file or directory

I am trying to enable travis-ci for an arduino related effort. Created a travis-ci yml file at https://github.com/jwillemsen/RN2483-Arduino-Library/blob/master/.travis.yml and enabled it on travis-ci. This now results in

Setting up build cache

$ export CASHER_DIR=$HOME/.casher

0.03s$ Installing caching utilities

0.00s

1.71sattempting to download cache archive

fetching master/cache-linux-precise-8b38933858bcbc861bcd2286a72dd89c26b411e0527c0350b7ca7ca4748667b7--python-2.7.tgz

found cache

0.00s

5.79sadding /home/travis/.platformio to cache

creating directory /home/travis/.platformio

$ python --version

Python 2.7.9

$ pip --version

pip 6.0.7 from /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages (python 2.7)
install

3.06s$ pip install -U platformio

Collecting platformio

  Downloading platformio-3.2.1-py27-none-any.whl (120kB)

    100% |################################| 122kB 3.5MB/s 

Collecting bottle<0.13 (from platformio)

  Downloading bottle-0.12.13.tar.gz (70kB)

    100% |################################| 73kB 5.5MB/s 

Collecting requests<3,>=2.4.0 (from platformio)

  Downloading requests-2.13.0-py2.py3-none-any.whl (584kB)

    100% |################################| 585kB 886kB/s 

Collecting pyserial<4,>=3 (from platformio)

  Downloading pyserial-3.2.1-py2.py3-none-any.whl (189kB)

    15% |####          100% |################################| 192kB 2.7MB/s 

Collecting semantic-version>=2.5.0 (from platformio)

  Downloading semantic_version-2.6.0.tar.gz

Collecting colorama (from platformio)

  Downloading colorama-0.3.7-py2.py3-none-any.whl

Collecting click<6,>=5 (from platformio)

  Downloading click-5.1-py2.py3-none-any.whl (65kB)

    100% |################################| 65kB 6.3MB/s 

Collecting lockfile<0.13,>=0.9.1 (from platformio)

  Downloading lockfile-0.12.2-py2.py3-none-any.whl

Installing collected packages: lockfile, click, colorama, semantic-version, pyserial, requests, bottle, platformio

  Running setup.py install for semantic-version

  Running setup.py install for bottle

    changing mode of build/scripts-2.7/bottle.py from 644 to 755

    changing mode of /home/travis/virtualenv/python2.7.9/bin/bottle.py to 755

Successfully installed bottle-0.12.13 click-5.1 colorama-0.3.7 lockfile-0.12.2 platformio-3.2.1 pyserial-3.2.1 requests-2.13.0 semantic-version-2.6.0

2.82s$ platformio ci $PLATFORMIO_CI_EXTRA_ARGS

The next files/directories have been created in /tmp/tmp2GHx1h

platformio.ini - Project Configuration File

src - Put your source files here

lib - Put here project specific (private) libraries

Project has been successfully initialized!

Useful commands:

`platformio run` - process/build project from the current directory

`platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board

`platformio run --target clean` - clean project (remove compiled files)

`platformio run --help` - additional information

[Wed Feb  1 12:15:11 2017] Processing sodaq_one (platform: atmelsam, board: sodaq_one, framework: arduino)

--------------------------------------------------------------------------------

Verbose mode can be enabled via `-v, --verbose` option

Converting SodaqOne-TTN-Mapper-ascii.ino

Collected 6 compatible libraries

Looking for dependencies...

Library Dependency Graph

|-- <Wire> v1.0

Compiling .pioenvs/sodaq_one/src/SodaqOne-TTN-Mapper-ascii.ino.o

Archiving .pioenvs/sodaq_one/libFrameworkArduinoVariant.a

Compiling .pioenvs/sodaq_one/src/Sodaq_UBlox_GPS.o

In file included from /home/travis/.platformio/packages/framework-arduinosam/cores/arduino_samd/Arduino.h:81:0,

from /tmp/tmpf1IhZw:1:

/home/travis/.platformio/packages/framework-arduinosam/cores/arduino_samd/delay.h:27:21: fatal error: variant.h: No such file or directory

#include "variant.h"

^

compilation terminated.

Deadlock in SERCOM::startTransmissionWIRE()

In SERCOM.cpp the startTransmissionWIRE() function does some setup, transmits the slave address, and waits on completion. In the current GitHub version (cf28026aef2f65e2ddc5c631d2b01a144ff0a068), this is on line 529. There are circumstances in which the MB flag will never be set, in particular when the bus is in an "unknown" state. I've run across the case where startTransmissionWIRE() deadlocks on the MB flag when addressing an SMBUS device on a SAMD21G18 MCU.

A temporary fix for me was to add a check for sercom->I2CM.INTFLAG.bit.ERROR and return false if that is set while waiting on MB. I didn't want to mod the code and do a pull request since I don't have a good way of verifying that my changes work in all circumstances and on all supported variants.

Unable to build for feather_m0

Copy/paste from forum
A few days ago when recompiling a project from within the atom ide, it updated platforms. Since then I have been getting:

/home/vaelen/Arduino/feather_m0_ble_test/src/feather_m0_ble_test.ino:31:17: error: 'A7' was not declared in this scope
#define VBATPIN A7
^

from platformio run and within the ide.

platformio project https://github.com/eiginn/ble_animation_test
full run output https://gist.github.com/99dbfa171206a8807d7ead2cb7e5629d

Platform Manager
================
Platform atmelsam
--------
Updating atmelsam @ 1.6.0:      [Up-to-date]
Updating framework-arduinosam @ 1.10611.0:      [Up-to-date]
Updating toolchain-gccarmnoneeabi @ 1.40804.0:  [Up-to-date]

Not sure what would have changed to do this

Configuration

Linux (Ubuntu 16.04)
PlatformIO, version 3.2.1

Steps to Reproduce

  1. git clone https://github.com/eiginn/ble_animation_test.git && cd ble_animation_test
  2. platformio run -v

Workaround

was suggested to downgrade atmelsam platform and this did work via:

[env:adafruit_feather_m0_usb]
platform = [email protected]

No load on Arduino MkrZero

Unable to load the basic Blink program to an Arduino MkrZero, Compile completes OK, then I get the following messages :

Looking for upload port…
Auto-detected: COM6
Forcing reset using 1200bps open/close on port COM6
Uploading .pioenvs\mkrzero\firmware.bin
Atmel SMART device 0x100110005 found
SAM-BA operation failed
*** [upload] error 1
[ERROR] took 46.3 seconds

PIO doesn't wait long enough for port open/close (SAMD21G)

What kind of issue is this?

[*] PlatformIO Core. If you’ve found a bug, please provide an information below.

You can erase any parts of this template not applicable to your Issue.
Configuration

Operating system: Windows 7 SP1

PlatformIO Version (platformio --version): v3.4.0b2 (within Atom: 2.0.0b.3)
Description of problem

When attempting to upload to an SAMD21 board (Adafruit Feather M0), the upload force closes the port, but does not wait long enough for Windows to actually close and re-open the serial port and so the upload fails. Sometimes Windows is speedy enough with the ports, but other times it misses.
Steps to Reproduce

Create sketch for Adafruit Feather M0
Upload using standard upload button in Atom (pio run --target upload)

Actual Results

Sometimes works without error
Other times, the port is forced closed, but before Windows has close the port, the uploader detects the old port as if it was the new port and attempts to upload to just as it is closing, causing a failure
Expected Results

Successful upload
Additional info

The Arduino IDE does not seem to have trouble with the port open/close and the speed of the port open/close on my system seems to depend some on what code the M0 had been running.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Please add new Board "ultratronics"

Would be nice to see this Board in PlattformIO.
It is very similar to a Arduino DUE.
Please can you add this board?

Here is the Json of the Board:
[(https://github.com/brupje/arduino-board-index/blob/master/package_rrw_index.json)]

PIO ignores upload_port = setting

What kind of issue is this?

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

Configuration

Operating system: macOS 10.14.4

PlatformIO Version (platformio --version):3.6.6

Description of problem

The Upload command apparently ignores upload_port = XXXX in platformio.ini, though output suggests it's being respected. In my case, I'm trying to build hardware UART bootloader support for a SAMD21 using the UF2 bootloader. Upload via an FT232 fails with native USB unplugged, but succeeds with USB plugged in, despite setting upload_port = <FTDI device>. I'm certain PIO is using the native USB UART because unplugging the FTDI physically results in a successful upload, even though debug output is correct.

Steps to Reproduce

  1. Get a Trinket M0 and install a UF2 bootloader modified such that both hardware UART and native USB Serial are enabled.
    ALTERNATELY Presumably it would work to reproduce the issue that you simply have an FT232 adapter plugged in, with some way to monitor the TX/RX lines, while also having plugged in a stock USB serial arduino such as any Adafruit SAMD board. Serial upload won't work over the FT232, of course, but you'll be able to see which device PIO uses.
  2. Put together a quick arduino sketch in PIO, configured for your board. Verify it uploads normally with only the native USB port in play.
  3. Configure platformio.ini to use a hard-coded serial port. For instance, on my machine, /dev/cu.usbmodem143201 is the trinket M0 USB serial, and /dev/cu.usbserial-A4016VJ0 is my FT232 adapter. So I set upload_port = /dev/cu.usbserial-A4016VJ0
  4. Upload code to the device.

Actual Results

Software will upload. Please see in-line note below.

Processing my-env (framework: arduino; platform: atmelsam; board: my-board)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/my-board.html
PLATFORM: Atmel SAM > Adafruit Trinket M0
HARDWARE: SAMD21E18A 48MHz 32KB RAM (256KB Flash)
DEBUG: CURRENT(jlink) EXTERNAL(atmel-ice, blackmagic, jlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 13 compatible libraries
Scanning dependencies...
No dependencies
Checking size .pioenvs/my-env/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=         ]   6.8% (used 2216 bytes from 32768 bytes)
PROGRAM: [          ]   3.8% (used 10088 bytes from 262144 bytes)
Configuring upload protocol...
AVAILABLE: atmel-ice, blackmagic, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
Looking for upload port...
Use manually specified: /dev/cu.usbserial-A4016VJ0
Forcing reset using 1200bps open/close on port /dev/cu.usbserial-A4016VJ0

NOTE: At this point, I have to manually reset my board by double-tapping a reset button. My board doesn't have a high-pass between FT232 DTR and RST, so this is necessary for UART upload. I'm not sure why it's necessary for native USB UART upload, but it appears to be, still.

Waiting for the new upload port...
Uploading .pioenvs/my-env/firmware.bin
Erase flash

Done in 0.819 seconds
Write 10088 bytes to flash (158 pages)
[==============================] 100% (158/158 pages)
Done in 0.068 seconds
Verify 10088 bytes of flash
[==============================] 100% (158/158 pages)
Verify successful
Done in 0.668 seconds
========================================================================= [SUCCESS] Took 7.68 seconds =========================================================================

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

Expected Results

Failure, because the specified port is an FT232 connected to nothing (or a logic analyzer or such). Note in the log above that my disconnected FT232 is apparently being used, yet upload succeeds when it shouldn't be possible, if that's actually the case.

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:my-env]
platform = atmelsam
board = my-board
framework = arduino

debug_init_break = tbreak setup

;debug_tool = atmel-ice
;upload_protocol = atmel-ice

debug_tool = jlink
;upload_protocol = jlink
upload_protocol = sam-ba
upload_port = /dev/cu.usbserial-A4016VJ0

Source file to reproduce issue:

Any example you like, e.g. Blinky.

Additional info

Blink example doesn't run on Arduino Zero after upload

In eclipse I imported a Platformio project of the zero.
Initialize platformio project using: platformio init --ide eclipse --board zero

mzeropro is working on my .org arduino m0 pro. (Bootloader_D21)
But the zero doesn't work for me with the .cc Arduino Zero. (Bootloader SAM-BA)

After I upload a simple blink sketch, my board looks dead.
After this programming in the Arduino IDE doesn't work either... No errors are shown... But no leds toggle.
I have to burn the bootloader again in the Arduino IDE, and the board can be used again.

In the console everything looks fine (blink.cpp in Platformio zero project):

Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x41000000 pc: 0x00000614 msp: 0x20007ffc
** Programming Started **
auto erase enabled
Info : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)
wrote 16384 bytes from file .pioenvs/zero/firmware.bin in 1.925072s (8.311 KiB/s)
** Programming Finished **
** Verify Started **
verified 9760 bytes in 0.823946s (11.568 KiB/s)
** Verified OK **
** Resetting Target **
shutdown command invoked

Serial USB not working

Hi,

Problem observed:

  • Serial USB output is not working with platformio. With Arduino IDE it is working as expected.

Test setup:

  • Board: Adafruit Feather M0 (atmelsam)
  • Platformio:
    IDE 1.7.1 | Core 3.2.1 under MacOS and Linux
Platform atmelsam
--------
Updating atmelsam @ 1.6.0: 	[Up-to-date]
Updating framework-arduinosam @ 1.10611.0: 	[Up-to-date]
Updating toolchain-gccarmnoneeabi @ 1.40804.0: 	[Up-to-date]
Updating tool-bossac @ 1.10601.0: 	[Up-to-date]

Simple test sketch:

#include <Arduino.h>
int n=0;

void setup()
{
   Serial.begin(9600);
}

void loop()
{
   Serial.println(n++);
}

Compiling and uploading this sketch using the Arduino GUI yields the expected result (fast running list of numbers) in the serial console.

Compiling and uploading using platformio in general works as well:

pio run -t upload
[Sat Jan 28 20:00:07 2017] Processing adafruit_feather_m0_usb (platform: atmelsam, board: adafruit_feather_m0_usb, framework: arduino)
--------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Collected 6 compatible libraries
Looking for dependencies...
Project does not have dependencies
Linking .pioenvs/adafruit_feather_m0_usb/firmware.elf
Checking program size
text	   data	    bss	    dec	    hex	filename
9712	    256	   1784	  11752	   2de8	.pioenvs/adafruit_feather_m0_usb/firmware.elf
Looking for upload port...
Auto-detected: /dev/cu.usbmodem1D1151
Forcing reset using 1200bps open/close on port /dev/cu.usbmodem1D1151
Waiting for the new upload port...
Uploading .pioenvs/adafruit_feather_m0_usb/firmware.bin
Atmel SMART device 0x10010005 found
Erase flash
done in 0.627 seconds

Write 9968 bytes to flash (156 pages)
[==============================] 100% (156/156 pages)
done in 0.067 seconds

Verify 9968 bytes of flash with checksum.
Verify successful
done in 0.007 seconds
CPU reset.
=========================================== [SUCCESS] Took 5.42 seconds ===========================================

But: Theres no output in the serial console.

Everything else seems to work fine if I upload code which does other things like blinking a LED.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.