Не компилируется


#1

Такой скетч работает
#include <Arduino.h>

#define Led PC13
void setup()
{

Serial1.begin(9600);

pinMode(Led,OUTPUT);

}

void loop()
{
Serial1.println(“Test”);
digitalWrite(Led,!digitalRead(Led));
delay(500);
}

а если использовать Serial2 или Serial3 (плата Bluepill Stm32f103c8t6) то не компилируется

Processing bluepill_f103c8 (platform: ststm32; board: bluepill_f103c8; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/bluepill_f103c8.html
PLATFORM: ST STM32 > BluePill F103C8
HARDWARE: STM32F103C8T6 72MHz 20KB RAM (64KB Flash)
DEBUG: CURRENT(stlink) EXTERNAL(blackmagic, jlink, stlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 8 compatible libraries
Scanning dependencies…
No dependencies
Compiling .pioenvs\bluepill_f103c8\src\main.cpp.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduinoVariant\PeripheralPins.c.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduinoVariant\variant.cpp.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\IPAddress.cpp.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\Print.cpp.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\Stream.cpp.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\Tone.cpp.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\WInterrupts.cpp.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\board.c.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\main.cpp.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\pins_arduino.c.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\stm32\HAL\stm32yyxx_hal_can.c.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\stm32\HAL\stm32yyxx_hal_cec.c.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\stm32\HAL\stm32yyxx_hal_crc.c.o
Compiling .pioenvs\bluepill_f103c8\FrameworkArduino\stm32\HAL\stm32yyxx_hal_dac.c.o
Linking .pioenvs\bluepill_f103c8\firmware.elf
.pioenvs\bluepill_f103c8\src\main.cpp.o: In function setup': main.cpp:(.text.setup+0x1c): undefined reference toSerial2’
.pioenvs\bluepill_f103c8\src\main.cpp.o: In function loop': main.cpp:(.text.loop+0x2c): undefined reference toSerial2’
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\bluepill_f103c8\firmware.elf] Error 1
========================================================= [ERROR] Took 11.89 seconds =========================================================
The terminal process terminated with exit code: 1

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