Hello everyone,
I’ll start with that I’m rather new to Platformio so please be nice to me. I’m as most of people here Arduino IDE user and have several years experience with Arduino stuffs such as ATtemaga- and ATtiny chips, but, totally new to STM32 chips and thought it would be a great opportunity to use an advance programming IDE as VS code and Platformio… enough talking and let me explain my problem.
I’m using blue pill board to interfacing a bluetooth module and using SWD method to upload my code to the STM32 IC and that why I need a serial monitor to see messages that I get from the other side which is my mobile phone so I used an FTDI programming board to get a monitor!
I used USART1 for the FTDI and USART2 for the bluetooth, but whatever I did, I could just get message from the bluetooth and read it on the monitor, but couldn’t send any AT command.
I tried and switched many USART ports (pins) but, without any luck!
Here’s my code and .ini file and hope someone with same issue maybe can help me and thanks in advanced.
Tommy
#include <Arduino.h>
HardwareSerial Serial2(PA3, PA2);
void setup() {
Serial.begin(9600);
Serial2.begin(9600);
}
void loop() {
while (Serial.available()) {
Serial2.write(Serial.read());
}
while (Serial2.available()) {
Serial.write(Serial2.read());
}
}
##########################platformio.ini######################
[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
upload_protocol = stlink
monitor_port = COM[4]
monitor_speed = 9600
monitor_flags =
--echo
--eol
CRLF
##############################################################
OBS! Can someone tell me how to post a code in better way?