Send data via UART from STM32 board under Embedded Coder

조회 수: 41 (최근 30일)
Zoltan Nagy
Zoltan Nagy 2023년 8월 2일
댓글: Zoltan NAGY 2024년 2월 8일
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