cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-MAT/TARGET. Tons Of Bugs: Partial declaration for the second and subsequent USART

Dima Sagalov
Associate II
Posted on February 26, 2018 at 04:14

Environment:

Windows10 (x64)

Matlab R2017a

STM32-MAT/TARGET-v4.4.2

STM32CubeMX-v4.0

STM32Cube MCU Package for STM32F0 Series -v1.9.0

STM32Cube MCU Package for STM32F3 Series -v1.9.0

SW4STM32-v2.4

TrueSTUDIO-v9.0.0

If you use only one of the UARTs (USART1, USART2, USART3, USART4, USART5), there is no problem!

If more than one USART interface is used (in our example we use everything from USART1 to USART5), the generator does not insert line in the file <project_name>_USART.c:

/* USART2 Receive data buffer index*/
uint16_t G_USART2_Rx_idx;
/* USART3 Receive data buffer index*/
uint16_t G_USART3_Rx_idx;
/* USART4 Receive data buffer index*/
uint16_t G_USART4_Rx_idx;
/* USART5 Receive data buffer index*/
uint16_t G_USART5_Rx_idx;
�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

in the file <project_name>_USART.h

void USART2_CopyDataFcn (uint8_t*, uint16_t , struct USART_TxDataLinkTypeDef* );
void USART2_SendDataFcn (struct USART_TxDataLinkTypeDef* );
void USART3_CopyDataFcn (uint8_t*, uint16_t , struct USART_TxDataLinkTypeDef* );
void USART3_SendDataFcn (struct USART_TxDataLinkTypeDef* );
void USART4_CopyDataFcn (uint8_t*, uint16_t , struct USART_TxDataLinkTypeDef* );
void USART4_SendDataFcn (struct USART_TxDataLinkTypeDef* );
void USART5_CopyDataFcn (uint8_t*, uint16_t , struct USART_TxDataLinkTypeDef* );
void USART5_SendDataFcn (struct USART_TxDataLinkTypeDef* );
�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

...

/* USART2 Receive data buffer index*/
extern uint16_t G_USART2_Rx_idx;
/* USART3 Receive data buffer index*/
extern uint16_t G_USART3_Rx_idx;
/* USART4 Receive data buffer index*/
extern uint16_t G_USART4_Rx_idx;
/* USART5 Receive data buffer index*/
extern uint16_t G_USART5_Rx_idx;
�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

#simulink #stm32-mat/target-matlab
4 REPLIES 4
Posted on February 26, 2018 at 12:52

the generator

What 'generator' ?

Dima Sagalov
Associate II
Posted on February 26, 2018 at 13:35

STM32-MAT/TARGET

Dima Sagalov
Associate II
Posted on February 26, 2018 at 13:58

http://www.st.com/en/development-tools/stm32-mat-target.html

 
Posted on February 26, 2018 at 13:45

So is that an ST thing, or a Matlab thing?