what’s the trick to getting serial output in cpp form using platformio core?
if i compile through arduino or platformio ide i have no issues getting output.
i can even take the device once compiled through arduino or the pio ide and
get output. however if i compile through platformio core i do not. surely this
is something very easy that i am overlooking
i used the platformio core script
→ Redirecting...
i am using linux
→ Linux SAISUSE 4.4.62-18.6-default #1 SMP (84f9824) x86_64 x86_64 x86_64 GNU/Linux
; // platformio --version
; // PlatformIO, version 3.3.1
; // [ platformio.ini ]
; [env:uno]
; platform = atmelavr
; board = uno
; framework = arduino
; // [ src/main.cpp ]
; #include Arduino.h
; void setup()
; {
; Serial.begin(115200);
; }
; int main()
; {
; Serial.println(“test”);
; delay(1000);
; return 0;
; }
; // [ makefile ]
; #!/bin/bash
; BOARD=uno
; PORT=/dev/ttyACM0
; BAUD=115200
; p run --target clean
; p run
; p run --target upload
; p device monitor -b $BAUD -p $PORT
; // [ results ]
SAISUSE:~/_test # bash makefile
[Mon Jun 12 08:30:55 2017] Processing uno (platform: atmelavr, board: uno, framework: arduino)
Build environment is clean
============================================= [SUCCESS] Took 0.29 seconds =============================================
[Mon Jun 12 08:30:56 2017] Processing uno (platform: atmelavr, board: uno, framework: arduino)
Verbose mode can be enabled via -v, --verbose
option
Collected 28 compatible libraries
Looking for dependencies…
Project does not have dependencies
Compiling .pioenvs/uno/src/main.o
Archiving .pioenvs/uno/libFrameworkArduinoVariant.a
Indexing .pioenvs/uno/libFrameworkArduinoVariant.a
Compiling .pioenvs/uno/FrameworkArduino/CDC.o
Compiling .pioenvs/uno/FrameworkArduino/HardwareSerial.o
Compiling .pioenvs/uno/FrameworkArduino/HardwareSerial0.o
Compiling .pioenvs/uno/FrameworkArduino/HardwareSerial1.o
Compiling .pioenvs/uno/FrameworkArduino/HardwareSerial2.o
Compiling .pioenvs/uno/FrameworkArduino/HardwareSerial3.o
Compiling .pioenvs/uno/FrameworkArduino/IPAddress.o
Compiling .pioenvs/uno/FrameworkArduino/PluggableUSB.o
Compiling .pioenvs/uno/FrameworkArduino/Print.o
Compiling .pioenvs/uno/FrameworkArduino/Stream.o
Compiling .pioenvs/uno/FrameworkArduino/Tone.o
Compiling .pioenvs/uno/FrameworkArduino/USBCore.o
Compiling .pioenvs/uno/FrameworkArduino/WInterrupts.o
Compiling .pioenvs/uno/FrameworkArduino/WMath.o
Compiling .pioenvs/uno/FrameworkArduino/WString.o
Compiling .pioenvs/uno/FrameworkArduino/_wiring_pulse.o
Compiling .pioenvs/uno/FrameworkArduino/abi.o
Compiling .pioenvs/uno/FrameworkArduino/hooks.o
Compiling .pioenvs/uno/FrameworkArduino/main.o
Compiling .pioenvs/uno/FrameworkArduino/new.o
Compiling .pioenvs/uno/FrameworkArduino/wiring.o
Compiling .pioenvs/uno/FrameworkArduino/wiring_analog.o
Compiling .pioenvs/uno/FrameworkArduino/wiring_digital.o
Compiling .pioenvs/uno/FrameworkArduino/wiring_pulse.o
Compiling .pioenvs/uno/FrameworkArduino/wiring_shift.o
Archiving .pioenvs/uno/libFrameworkArduino.a
Indexing .pioenvs/uno/libFrameworkArduino.a
Linking .pioenvs/uno/firmware.elf
Calculating size .pioenvs/uno/firmware.elf
Building .pioenvs/uno/firmware.hex
AVR Memory Usage
Device: atmega328p
Program: 1334 bytes (4.1% Full)
(.text + .data + .bootloader)
Data: 190 bytes (9.3% Full)
(.data + .bss + .noinit)
============================================= [SUCCESS] Took 0.74 seconds =============================================
[Mon Jun 12 08:30:57 2017] Processing uno (platform: atmelavr, board: uno, framework: arduino)
Verbose mode can be enabled via -v, --verbose
option
Collected 28 compatible libraries
Looking for dependencies…
Project does not have dependencies
Linking .pioenvs/uno/firmware.elf
Checking program size
text data bss dec hex filename
1310 24 166 1500 5dc .pioenvs/uno/firmware.elf
Building .pioenvs/uno/firmware.hex
Looking for upload port…
Auto-detected: /dev/ttyACM0
Uploading .pioenvs/uno/firmware.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file “.pioenvs/uno/firmware.hex”
avrdude: writing flash (1334 bytes):
Writing | ################################################## | 100% 0.23s
avrdude: 1334 bytes of flash written
avrdude: verifying flash memory against .pioenvs/uno/firmware.hex:
avrdude: load data flash data from input file .pioenvs/uno/firmware.hex:
avrdude: input file .pioenvs/uno/firmware.hex contains 1334 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.18s
avrdude: verifying …
avrdude: 1334 bytes of flash verified
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
============================================= [SUCCESS] Took 3.97 seconds =============================================
— Miniterm on /dev/ttyACM0 115200,8,N,1 —
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H —