1. Configure the serial port in simulnik
2. Take the MCU to send data, and simulink to receive and analyze it as an example
Configure the serial port receiving module, as shown in the figure to receive 5 bytes
3. Use Protocol Decoder to parse the data
First, the microcontroller sends 'A' + four bytes of data
A is the header
test[0]='A';
HAL_UART_Transmit(&huart4,test,1,10);
HAL_UART_Transmit(&huart4,adc1data,2,10);
HAL_UART_Transmit(&huart4,adc2data,2,10);
The simulink settings are as follows:
4. Click to run, and use the display to observe the data