Send data via UART from STM32 board under Embedded Coder

36 次查看(过去 30 天)
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 个评论
Noman Nosher
Noman Nosher 2024-1-23
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 2024-2-8
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.

请先登录,再进行评论。

采纳的回答

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

更多回答(0 个)

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by