PlatformIO core on Nvidia TX2

I managed to download PlatformIO core into my Nvidia TX2 board running ubuntu 16.04. I can compile the sample blink code but when I want to upload the code to the Arduino Uno connected to the board it fails!

Here is the output for “platofrmio run”

nvidia@tegra-ubuntu:~/Documents/pio_project$ platformio run

Processing uno (platform: atmelavr; board: uno; framework: arduino)

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

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

CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html

PLATFORM: Atmel AVR > Arduino Uno

HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)

Library Dependency Finder -> http://bit.ly/configure-pio-ldf

LDF MODES: FINDER(chain) COMPATIBILITY(soft)

Collected 5 compatible libraries

Scanning dependencies...

No dependencies

Checking size .pioenvs/uno/firmware.elf

Memory Usage -> http://bit.ly/pio-memory-usage

DATA: [ ] 0.4% (used 9 bytes from 2048 bytes)

PROGRAM: [ ] 2.9% (used 930 bytes from 32256 bytes)

========================================================================== [SUCCESS] Took 1.86 seconds ==========================================================================

This is the output for the upload command:

nvidia@tegra-ubuntu:~/Documents/pio_project$ platformio run -e uno -t upload  -v
Processing uno (platform: atmelavr; board: uno; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 5 compatible libraries
Scanning dependencies...
No dependencies
MethodWrapper(["checkprogsize"], [".pioenvs/uno/firmware.elf"])
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [          ]   0.4% (used 9 bytes from 2048 bytes)
PROGRAM: [          ]   2.9% (used 930 bytes from 32256 bytes)
.pioenvs/uno/firmware.elf  :
section                    size      addr
.data                         0   8388864
.text                       930         0
.bss                          9   8388864
.comment                     17         0
.note.gnu.avr.deviceinfo     64         0
.debug_aranges               64         0
.debug_info                1798         0
.debug_abbrev              1482         0
.debug_line                 258         0
.debug_str                  520         0
Total                      5142
<lambda>(["upload"], [".pioenvs/uno/firmware.hex"])
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
BeforeUpload(["upload"], [".pioenvs/uno/firmware.hex"])
Auto-detected: /dev/ttyACM0
*** [upload] Connection timed out
=========================================================================== [ERROR] Took 16.43 seconds ===========================================================================

Here is the configuration in the platformio.ini file:

[env:uno]

platform = atmelavr

framework = arduino

board = uno

I have tried the upload command without the “-e uno” option but it gives the same result.
Also I have copied the proper rule file(udev ) files to /etc/udev/rules.d/
Any idea what is wrong?

Using miniterm.py, can you open the serial port? Is it even the right port?

I am not sure about the miniterm.py. Never used it before. I have monitored /dev/ttyACM0 using screen command from BASH and I can see stuff being printed on the screen (uploaded a sample serial code to the arduino using a windows machine beforehand)

This is the output for the platformio device list command:

nvidia@tegra-ubuntu:~$ platformio device list

/dev/ttyACM0

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

Hardware ID: USB VID:PID=2341:0043 SER=75735303931351916120 LOCATION=1-1:1.0

Description: ttyACM0

And lsusb command :

nvidia@tegra-ubuntu:~$ lsusb 

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 002: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub