sukanta
sukanta

Reputation: 541

Sending data from STM32F401 MCU to ESP8266 and getting response from ESP8266 to MCU

I am working on an STM32f401 Nucleo board and ESP8266 wifi module. I am using Eclipse gcc-arm tool chain and cubeMx to generate code. I can transfer and receive data perfectly with USART/UART DMA.

Now I am stuck with ESP8266. I cannot send data from MCU to ESP and I'm not getting response from ESP to MCU. I already tested the ESP module communication, I can connect TO THE wifi with AT commands through USB and can also receive data in web via socket connection.

I configured USART1_TX/USART1_RX with PA9/PA10

Thanks in advance.

Upvotes: 0

Views: 3031

Answers (2)

Michel Sanches
Michel Sanches

Reputation: 438

That's right at first check baud rate are matching

Then do you use dma for both tx/rx direction ? For dma rx note that the "completion" callback will be called only when the full buffer will be filled. If you neeed to "break" reception on ending "\n" "\n" then you might use the interrupt rx method oen hatr at a time and inspect it as it arrives in the callback that keep on asking one more byte until not done. Alternatively with dma keep on polling the dma count and analyzed current rx buffer for some \r \n. abort/Stop dma when done.

Upvotes: 0

rainbow
rainbow

Reputation: 255

I'm not an expert, but I try to help you.

Which baud rate are you using? Is it coherent with the ESP8266 documentation?

Check the power supply and the connections.

Therefore, remember that the AT commands are case sensitive (they must be written with capital letters only) and they must terminate with carriage return and line feed, so "/r/n".

Upvotes: 0

Related Questions