Send data via UART from STM32 board under Embedded Coder

32 views (last 30 days)
Is there an example that shows that how to send data via UART from STM32 board under Embedded Coder?
I connected a uint8 constant, which supposed to be a valid input and the build failed with 'The parameter USART is not defined for selected hardware board'.
The UART block is not from the Nucleo library, but from the STM32 support package.
Does it mean that, ther are no UART communication blocks for Nucleo boards?
But oddly, even if I select an SMT32 H7, which has a library and I use the UART from that library (ioc file is also correct), I have the same error.
  2 Comments
Noman Nosher
Noman Nosher on 23 Jan 2024
To use USART, you should run the simulink model on Embedded Coder Support Package of your relavent processor series. This will also required to configure IOC file first.
Further, you can create host and target configurations to send and receive data to and from the simulink model.
Zoltan NAGY
Zoltan NAGY on 8 Feb 2024
Unfortunately, Embedded Coder is quite inconsistent, hence confusing first.
It seems, if you use a defined board, like Nucleo boards, the IOC is specified automatically and you cannot modify it, which is understandable.
Embedded Coder Support Package was added to MATLAB, as well as Nucleo support package.
The error was generated by that, I used STM32H7xx library, as my board had STM32H7xx chip, but for Nucleo boards, there is a separate library, in which the UART is SCI.

Sign in to comment.

Accepted Answer

Vikky Patil
Vikky Patil on 3 Aug 2023
For the set hardware board you need to use the SCI Write block from Simulink Coder Support Package for STMicroelectronics Nucleo Board -> Common

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!