Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 10 months ago.
Serial Terminal and communication with ESP8266
I have been trying without success to get my mbed Nucleo 411 to talk to my ESP8266. I have a FTDI chip that works sometimes, but multiple framing errors make it difficult to use. My question is what serial pin's should I use to talk to my ESP8266 chip? I have tried the arduino compatle serial pins on the PIN Out map, but have heard that those will not be active unless I snip jumpers. Next I went to the other serial connections I could find on the board (PA_9 & PA_10) or (PA_7 & PA_15), but had no luck. I did read somewhere that the supported baud rate on some of the serial connections are lower on the some of the serial connections, but I am not sure if that is the same issue. https://developer.mbed.org/questions/6236/Nucleo-F411RE-USART2-stops-sending-under/
Any help is appreciated.
Here is the code I was trying to get working (new serial values added in below): https://developer.mbed.org/users/mbedAustin/code/SerialDeviceTerminal/
RawSerial pc(USBTX, USBRX); RawSerial dev(PA_9, PA_10); DigitalOut led1(LED1); DigitalOut led4(LED4);
void dev_recv() { led1 = !led1; while(dev.readable()) { pc.putc(dev.getc()); } }
void pc_recv() { led4 = !led4; while(pc.readable()) { dev.putc(pc.getc()); } }
int main() { pc.baud(115200); dev.baud(115200);
pc.attach(&pc_recv, Serial::RxIrq); dev.attach(&dev_recv, Serial::RxIrq);
while(1) { sleep(); } }
Question relating to:
2 Answers
8 years, 10 months ago.
Josh,
The Serial2 on these boards has problems sometimes, try using the Serial1 connections. I would reccomend trying PA_15 and PB_7. I successfully managed to get valid data to and from the ESP board using these pins.
All the best,
-Austin
8 years, 10 months ago.
You could try this first:
https://developer.mbed.org/users/star297/code/ESP8266-configuaration-baudrate/
This works well enough to test the serial connection to the ESP8266.
If it does work then you can try this application:
https://developer.mbed.org/users/star297/code/ESP8266-WEB-Mbed-Controller/
However I'm not sure if it works with the Nucleo boards, I gave up with these as half the API's do not work properly.