-
This project uses FreeRTOS.
-
To add functions, first make changes in FreeRTOS_USB_USART_Echo.ioc using STM32CubeMX, i.e. add a task (FreeRTOS terminology), then generate code using STM32CubeMX, edit the code in Keil uvision, compile and flash the development board.
-
Having only one dev board will work. You should see all the desired behaviour outline in the Commands You Can Play With & Observations section.
-
To work with two-board communication, you need two dev boards.
-
Compile the code.
-
Download the code to the development board(s).
-
Use a micro USB cable to connect the development board and your computer.
-
Optional: if you have two boards:
-
Connect one board to the computer via USB.
-
Connect the two board on their USART 6 ports. Note:
Pin on dev board A Pin on dev board B RX TX TX RX GND GND -
DO NOT CONNECT THE VCC PINS ON BOTH DEV BOARDS TOGETHER!
-
-
Identify the COM/serial port that identifies the development board. On Windows, you can use Device Manager.
-
Install Putty. Use the following pictures to change Putty settings.
Set the communication parameters:
Set the display parameters:
With 1 dev board
-
Any string starts with q. The response will be you typed q\r\n.
-
Any string starts with w. The response will be you typed w\r\n.
-
For any other strings, the response will repeat what you have sent over USB.
Only with 2 dev boards
Regardless of whether sening strings or not, or the content of the string, one green LED light will turn on and off every second on each board.
-
For modifying the behaviour when receiving data on the USB CDC interface, edit the CDC_Receive_FS function in usbd_cdc_if.c.
-
For sending data from the USB CDC interface, do
#include "usbd_cdc_if.h"
to include the necessary header, then do
uint8_t Buffer[] = ...; CDC_Transmit_FS(Buffer, sizeof(Buffer));
Buffer is the uint8_t array that holds the data for sending.
Happy hacking!