ANROT Tutorial

STM32 Serial Reading Tutorial

Use Keil and an STM32F103 board to validate ANROT UART data as a first-step MCU integration workflow.

Updated Jan 1, 2025 Products 3
  • stm32
  • mcu
  • uart
  • tutorial

STM32 example

Protocol Support

Protocol / frameSupportHow this example handles it
0x91 IMUSOLSupportedDecodes a single-device float frame into receive_imusol and prints it from dump_data_packet().
0x62 GWSOLSupportedDecodes gateway float collection frames and iterates receive_gwsol.receive_imusol[].
0x63 GWSOL CompactNot supportedThe STM32 decoder has no compact gateway branch.
0x90, 0xA0, 0xB0, 0xB1, 0xC0, 0xD0, 0xD1SupportedParses loose single-field output modes.
0xF0 PressureSkippedThe code advances past the pressure item and does not store or print pressure.

Source code (download and unzip): demo-stm32-en.zip

This example provides C language example code, users receive Hi226/Hi229 and Hi221 data.

  • Test environment: Windows10_x64 operating system

  • Compiler: keil_V5.28

  • Development board: Punctual Atom-Battleship V3 STM32F103ZET6

  • Test equipment: Hi226/Hi229

Hardware connection

Insert the Hi226/Hi229 into the SuperCore debug board correctly.

Supercore Debug BoardPunctual Atomic Development Board
RXDPA2(TXD)
TXDPA3(RXD)
3.3V3V3
GNDGND

Connect the corresponding pins in the table above with DuPont wires.

Plug the USB cable into the USB_232 socket of the development board, and plug the other end into the computer.

Watch the output

Open the serial port debugging assistant, open the serial port number corresponding to the development board, and observe the data output