cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX unable to transmit over UART6/RS232

Ravi Ramesh
Associate
Posted on December 08, 2017 at 02:01

HI,

I have a STM32F07G-Disc1 board attached to a Embest BB board which provides an RS232 Interface. I started the STM32CubeMX, and activated the USART6 in Asynchronous mode and Generated the Default code. 

The following is my main function. I am trying 

to transmit a single character, in addition to blinking an LED. The Led Blinks just fine, but when i listen to the RS232 on a PC using putty @ baud 115200 (also configured in STM32CubeMx), i dont see any characters coming through. 

int main(void)

{

/* MCU Configuration----------------------------------------------------------*/

/* Reset of all peripherals, Initializes the Flash interface and the Systick. */

HAL_Init();

/* Configure the system clock */

SystemClock_Config();

/* Initialize all configured peripherals */

MX_GPIO_Init();

MX_I2C1_Init();

MX_USART6_UART_Init();

unsigned char ch = 'c';

/* Infinite loop */

while (1)

{

BlinkLedOnce(RED_LED);

HAL_UART_Transmit(&huart6, &ch, 1, 0xFFFF);

}

}

#usart-rs232 #usart6
1 REPLY 1
Posted on December 08, 2017 at 16:18

This is all very top level code providing no insight into how the pins, clocks and USART are actually configured, you should review the detail.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..