STM32 serial communication

Note: The voice interaction module needs to be burned with factory firmware. If the voice chip has not been flashed with firmware after receiving it, it does not need to be burned

1. Experimental preparation

2. Wiring diagram

STM32Voice interaction module
PA9RX
PA10TX
GNDGND
5V5V

image-20250226150839940

3. Program download

image-20250226150902481

image-20250226151353428

image-20250226151414852

image-20250226151436978

image-20250226151332677

4.Achieve the effect

image-20250226151531524

image-20250226151617758

The first and second bytes AA FF represent the frame header of the protocol, the third byte FF represents the broadcast function, and the fourth is the ID of the broadcast content. Here you can see "I am ready" is 67 in hexadecimal, so the program sends 0x67 to register 0x03 to broadcast the corresponding content. The fifth byte is the end frame.

image-20250226151641256

image-20250226151652908

image-20250226152252813

image-20250226141429180

The first and second bytes AA FF represent the frame header of the protocol, the third byte represents the ID of the ten function words of the chip, and the fourth is the command word ID. Here you can see "close light" is hexadecimal 0A, so decimal will return 10. The fifth byte is the end frame.