New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run a simple blink led on Arduino Due (build upload but doesn't run on target) #710

Closed
akira215 opened this Issue Jul 2, 2016 · 10 comments

Comments

Projects
None yet
3 participants
@akira215

akira215 commented Jul 2, 2016

I successfully ran lots of project on Arduino Due using PlatformIO.
Since the last update, I'm unable to run any app on this board. Build and upload seems to works fine, but nothing happen after board reset. The same app (simple blink led) works fine with Arduino IDE.
I tried the USB Native port, it doesn't work also.
In the other hand, everything works fine with PlatformIO on Arduino Leonardo board.
I can't figure out what's happening.

Any help appreciated.

Regards


Configuration

Ubuntu 16.04:

PlatformIO, version 2.11.0

BOSSA CLI version: 1.10601.0

Description of problem

Steps to Reproduce

  1. Build & upload any simple project on Arduino due

Actual Results

Nothing happen after board reset

Expected Results

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:due]
platform = atmelsam
framework = arduino
board = due

Source file to reproduce issue:

#include <Arduino.h>

void setup() 
{  
  pinMode(13, OUTPUT);
}

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

}

Additional info

@akira215

This comment has been minimized.

akira215 commented Jul 2, 2016

Ok, working around this problem, my understanding is :

  • The .bin file generated by the building toolchain works fine.
  • The command for bossac seems to be incorrect, the --boot option should be enable to boot from FLASh (instead of ROM)
    So basically, if I upload the firmware.bin file generated by platformIO build chain with :
    bossac --info --port "ttyACM0" -e -w -v -b -U false .pioenvs/due/firmware.bin -R
    it works !!
    The command generated by plaformIO-IDE is :
    bossac --info --port "ttyACM0" --erase --write --verify --reset --debug -U false .pioenvs/due/firmware.bin
    As you can see the only difference is the -b parameter (--boot option)
    I'll finally try to find where this command is generated inside the platformIO-IDE to hack this.

Regards

@akira215

This comment has been minimized.

akira215 commented Jul 2, 2016

I finally make it work by adding the --boot option in platformio/builder/scripts/atmelsam.py at line 169.
Not sure that it will work for all Atmel SAM processor, but I think there is a mistake in this file.
Could you please check this for the future releases ?

Regards

@akira215

This comment has been minimized.

akira215 commented Jul 2, 2016

The complete path of the file for linux user is :
~/.atom/packages/platformio-ide/penv/local/lib/python2.7/site-packages/platformio/builder/scripts

Regards

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jul 3, 2016

@valeros is this issue caused by 486529b ?

@valeros valeros added this to the 2.11.1 milestone Jul 4, 2016

@valeros valeros added bug and removed help wanted labels Jul 4, 2016

@akira215

This comment has been minimized.

akira215 commented Jul 4, 2016

Hi Ivan,
I don't think so because its on Arduino Due platform. The file to be changed is the following : /platformio/builder/scripts/atmelsam.py
On my computer --boot option is not set. On the repository, the file has this lines:
if "sam3x8e" in BOARD_OPTIONS.get("build", {}).get("mcu", ""): env.Append(UPLOADERFLAGS=["--boot"])
It has been corrected by #710 issue
https://github.com/platformio/platformio/commit/241ad8174fd767dd17fb86a3e8b86cd121685095

Thanks for help anyway

Regards

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jul 4, 2016

@akira215 this is a bug. Thanks a lot that reported it. We will release a new version as soon as possible.

Please test the latest development version where this issue is fixed http://docs.platformio.org/en/latest/installation.html#development-version

@ivankravets ivankravets closed this Jul 4, 2016

ivankravets added a commit that referenced this issue Jul 4, 2016

* Fix missed ``--boot`` flag for the firmware uploader for ATSAM3X8E …
…Cortex-M3 MCU based boards (Arduino Due, etc) // Resolve #710
@akira215

This comment has been minimized.

akira215 commented Jul 5, 2016

Hi Ivan,

Ok, I will try it by the end of this week. Regards
Le 4 juil. 2016 19:25, "Ivan Kravets" notifications@github.com a écrit :

@akira215 https://github.com/akira215 this is a bug. Thanks a lot that
reported it. We will release a new version as soon as possible.

Please test the latest development version where this issue is fixed
http://docs.platformio.org/en/latest/installation.html#development-version


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#710 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ALKWPA3mV2gAdZmI0ImCuWob922V5w8Jks5qSUIHgaJpZM4JDp2r
.

ivankravets added a commit that referenced this issue Jul 6, 2016

Merge branch 'develop' into feature/platformio-30
* develop: (27 commits)
  Update boards list
  Add Arduino M0 as a separate board
  Update history
  Update microchippic32 platform and boards
  Fix PyLint warning
  Keep user changes for ".gitignore" file when re-generate/update project data
  Documented uploading of EEPROM data
  Push 2.11.1.dev1
  Automatically install dependent upload tools // Issue #472
  Split source files to HEADERS and SOURCES when generate project for Qt Creator IDE // Resolve #713
  Improve project generator for CLion IDE
  Fix missing trailing ``\`` for the source files list when generate project for Qt Creator IDE // Resolve #711
  * Fix missed ``--boot`` flag for the firmware uploader for ATSAM3X8E Cortex-M3 MCU based boards (Arduino Due, etc) // Resolve #710
  Initial support for Arduino M0/Tian boards // Issue #472
  Update project template for Qt Creator // Issue #711
  Fix missed --boot flag for sam3x uploader // Issue # 710
  Auto-remove project cache when PlatformIO is upgraded
  Version bump to 2.11.0 (issues #472, #520, #614, #620, #685, #698, #699)
  Update history
  Update espressif platform according to the new framework version
@akira215

This comment has been minimized.

akira215 commented Jul 10, 2016

Hi Ivan,

I installed the lastest development version (version 2.11.1.dev2) : The
bug has been fixed, everything works fine.
I ll continue to developp using pio for SAMx µC, so I will be a good
tester !

Thanks.

Regards

Le 04/07/2016 21:25, Ivan Kravets a écrit :

@akira215 https://github.com/akira215 this is a bug. Thanks a lot
that reported it. We will release a new version as soon as possible.

Please test the latest development version where this issue is fixed
http://docs.platformio.org/en/latest/installation.html#development-version


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#710 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ALKWPA3mV2gAdZmI0ImCuWob922V5w8Jks5qSUIHgaJpZM4JDp2r.

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jul 10, 2016

Happy Coding with PlatformIO! 😄

@akira215

This comment has been minimized.

akira215 commented Jul 10, 2016

Thanks.

I may add an extra filter in the Serial Port Monitor, I can't fine my
happiness in the 6 existings !

Regards

Le 10/07/2016 12:10, Ivan Kravets a écrit :

Happy Coding with PlatformIO! 😄


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#710 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ALKWPAFOcCTLc0t-UtKz8iEIhTQzAATgks5qUKj9gaJpZM4JDp2r.

ivankravets added a commit that referenced this issue Jul 12, 2016

@ivankravets ivankravets referenced this issue Jul 12, 2016

Closed

platformio 2.11.1 #2936

4 of 4 tasks complete

ivankravets added a commit that referenced this issue Jul 18, 2016

Merge branch 'develop' into feature/platformio-30
* develop:
  Update docs for Teensy USB Features // Issue #722
  Implement Teensy 2.0 USB functionality (HID, SERIAL_HID, DISK, MIDI, etc.) // Resolve #722
  Add support for Pinoccio Scout board // Resolve #52
  Fix broken LD Script for Element14 chipKIT Pi board // Resolve #725  Resolve #726
  Fix USB flags processing for teensy platform // Issue #722
  Add Pinoccio board // Issue #52
  Minor improvements for CLion docs
  Improved docs for integration with CLion IDE
  Version bump to 2.11.1 (issues #472, #629, #710, #711, #712, #713, #718)
  Typo fix
  Add "udev" rules for OpenOCD CMSIS-DAP adapters // Resolve #718
  Update history
  Ignore "[platformio]" section from custom project configuration CI
  Bump to 2.11.1b1
  Add Arduino M0 Pro and Tian to the examples // Issue #472
  Fix issue when `pioenvs` folder doesn't exist
  Add more info about `.pioenvs` directory
  Improve CMSIS selection for SAMD21 boards
  Improve support for SAMD21 based boards
  Add contributing guidelines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment