Main Content

Migrate SCI Block Usage to STM32 Processor Based Library Block

When you migrate SCI block usage in STMicroelectronics hardware board models from using Simulink Coder support package blocks to using Embedded Coder support package blocks, there is a workflow you should use. This table lists the blocks that should be migrated with this workflow.

Migrate Block Usage

Migrate from Blocks in Simulink Coder Support Package for STMicroelectronics Nucleo Boards Library

Migrate to Blocks in Embedded Coder Support Package for STMicroelectronics STM32 Processor Library

SCI Read

UART/USART Read

SCI Write

UART/USART Write

To migrate your model from using these blocks to using the corresponding blocks in an STM32Fxx Based Board block library, follow these steps. These example steps show the process for migrating usage from the Nucleo library SCI Read block and SCI Write block to the STM32 processor library UART/USART Read block and UART/USART Write block:

  1. Open the Simulink model in which you are migrating block usage.

  2. From Configuration Parameters > Hardware Implementation > Target hardware resources > Group, select the SCI0 (default) resource. Note the pin selections for the receive pin (D0) and transmit pin (D1) corresponds to external pin PB_8 and PB_9.

    Model configuration parameters for selecting SCI resource and pins on Nucleo board

  3. Change Hardware board selection to STM32F7xx Based. After the dialog box updates to match this selection, From Target hardware resources > Build options, use the Browse or Create buttons to select an STM32CubMX project file.

    Model configuration parameters for selecting SCI resource on STM32F7xx Based processor board

  4. In the Simulink model, replace the SCI Read block and SCI Write block from the Nucleo library with a UART/USART Read block and UART/USART Write block from the STM32F4xx Based Boards library or STM32F7xx Based Boards library.

  5. View the block configuration parameters. Confirm that the UART/USART module selection is configured for the default USART module which is USART1. This setting matches the pin mapping that you assigned in the CubeMX configuration IOC file.

    Block configuration parameters for USART block in STM32 library

  6. To open the STM32 CubeMX configuration software and configure pin selections, click the Launch button.

  7. In the STM32 CubeMX configuration software, configure the USART1 options.

    Protocol configuration for USART port in STM32 CubeMX configuration software

    More protocol configuration for USART port in STM32 CubeMX configuration software

  8. In the STM32 CubeMX configuration software, configure the USART1 port pin usage to PB8 and PB9.

    Pin map configuration for USART port and pins in STM32 CubeMX configuration software

See Also

Topics