Hi everybody,
I'm new to the Teensy board, and I'm trying to learn more about it by tinkering with some Adafruit peripherals.
I was trying to build this in PlatformIO (moving functions to make it compile in C++): https://github.com/adafruit/Adafruit_SSD1327/blob/master/examples/ssd1327_test/ssd1327_test.ino
Without adding TeensyDebug it builds and works nicely, but just adding debug.begin(SerialUSB1); in the setup() function makes the board blink its led 7 times when uploading the binary.
The problem seems to be related if the constructor of Adafruit_SSD1327 is called, either globally or scoped in a function.
The same happens without adding TeensyDebug when I uncomment the define for PRINT_DEBUG_STUFF in packages/framework-arduinoteensy/cores/teensy4/debug/printf.h.
I'm using the latest Visual Studio Code with the latest PlatformIO.
The simplest way I've found to reproduce it on my board is to use the code below.
With the PRINT_DEBUG_STUFF macro not defined, it builds and run. I get seven blinks with the macro enabled.
Any idea what I may be doing wrong?
Code:
platformio.ini
I'm new to the Teensy board, and I'm trying to learn more about it by tinkering with some Adafruit peripherals.
I was trying to build this in PlatformIO (moving functions to make it compile in C++): https://github.com/adafruit/Adafruit_SSD1327/blob/master/examples/ssd1327_test/ssd1327_test.ino
Without adding TeensyDebug it builds and works nicely, but just adding debug.begin(SerialUSB1); in the setup() function makes the board blink its led 7 times when uploading the binary.
The problem seems to be related if the constructor of Adafruit_SSD1327 is called, either globally or scoped in a function.
The same happens without adding TeensyDebug when I uncomment the define for PRINT_DEBUG_STUFF in packages/framework-arduinoteensy/cores/teensy4/debug/printf.h.
I'm using the latest Visual Studio Code with the latest PlatformIO.
The simplest way I've found to reproduce it on my board is to use the code below.
With the PRINT_DEBUG_STUFF macro not defined, it builds and run. I get seven blinks with the macro enabled.
Any idea what I may be doing wrong?
Code:
Code:
#include <Arduino.h>
#include <TeensyDebug.h>
void setup() {
Serial.begin(115200);
debug.begin(SerialUSB1);
}
void loop() {
Serial.println("Alive and kicking");
delay(100);
}
platformio.ini
Code:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
upload_protocol = teensy-cli
lib_deps =
https://github.com/ftrias/TeensyDebug
build_type = debug
build_unflags = -DUSB_SERIAL
build_flags = -DUSB_DUAL_SERIAL
debug_port = /dev/cu.usbmodem145015603
debug_tool = custom
debug_load_mode = manual
debug_server =
debug_init_cmds =
target extended-remote $DEBUG_PORT
$INIT_BREAK
define pio_reset_run_target
interrupt
tbreak loop
continue
end
define pio_restart_target
echo Restart is undefined for now.
end
debug_init_break =