Using RT-Thread Studio To Control ESP32 With STM32F469 Disco - Hackster.io

2022-11-03 16:49:04 By : Mr. Wen Dan

Add the following snippet to your HTML:

Read up about this project on

Long before TED Talks became popular, there was a radio program that tells the story of how our culture is formed by human creativity. That radio program, Engines of Our Ingenuity, has been featured in one of my previous projects, If The Allegations Are Not Legit, You m. AWS. t EduKit. We wanted to make a device that plays episodes with more screen space to allow for user control and for that we used STM32F469 DISCOVERY board. We didn't just want random and forward/backward navigation, we wanted to be able to jump to specific episodes and see the title and description. Also, in this project we did not use AWS so we had to figure out how to make ESP32 load large pages without crashing. Lastly, the boards had to communicate over UART.

This project has also been published at: https://www.pcbway.com/project/shareproject/Using_RT_Thread_Studio_To_Control_ESP32_With_STM32F469_Disco_122226b1.html

Our mail carrier used my board as booster seat. Miraculously, board still in one piece. The I2S amplifier that I ordered weeks ago has not been delivered yet. For that reason we used code from Skydive Auto Reminder - Doing More With Less to produce a lower quality audio without I2S board.

We started by downloading and extracting https://github.com/RT-Thread/rt-thread/archive/refs/heads/master.zip to get the latest BSP. According to the User Manual, we have four USART ports and, four UART ports on that board, however, only USART3 is enabled by default. Using STM32 CubeMX, we opened %userprofile%\Downloads\rt-thread-master\rt-thread-master\bsp\stm32\stm32f469-st-disco\board\CubeMX_Config\CubeMX_Config.ioc

After clicking Continue, we expanded connectivity on the left pane and clicked USART6.

We replaced Disabled with Asynchronous in the Mode drop down menu. We then clicked Generate Code in the top right corner and closed the the application.

We located Kconfig (one folder up) and duplicated UART3 text then replaced with UART6. Now, it looks like this.

BSP is ready to be used after saving this file.

One minute into this tutorial shows how to import BSP that we just modified.

This is how our import looked.

We opened RT-Thread Settings from the left pane then clicked on the chevrons on the right.

We came here to Enable LVGL for LCD which will automatically trigger all the needed toggles.

We needed to also turn on UART6 we just enabled.

We had to increase Rx buffer size from 64 to 1024.

We deleted all files in applications folder then copied our files from Github.

To allow auto reset after code download we needed to make this change.

Please note that this tutorial is using LVGL v8.3.1 and if you have to look something up on their website, make sure you are looking at the correct version.

We used mrfaptastic/WiFiConnect Lite to connect ESP32 to Wi-Fi without hard coding credentials. We also used earlephilhower/ESP8266Audio to make the board translate mp3 files to audio. Our board was too old so we had to comment out the same three lines from AudioOutputI2S.cpp and AudioOutputSPDIF.cpp.

In the setup we connect to a Wi-Fi and hit the website for the first time to get the latest episode number to be used in generating a random number for initial play. In the loop we go to the episode page to retrieve the title and description then start playing the audio. If a user sends a request for a different episode, the loop will be interrupted and the new episode will play.

We used the standard UART connection to make the boards communicate. Tx of one board is connected to Rx of the other and vice versa. We are powering ESP32 with USB cable, and powering STM32F469 DISCOVERY from ESP32. NRST of STM32F469 DISCOVERY had to be connected to EN of ESP32 to keep the boards in synch. Finally, the audio output comes from D22 and we had to use a 0.01 uf (103K) Ceramic Disc Capacitor to remove some of the noise.

Hackster.io, an Avnet Community © 2022