This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UART1 visualise in Debug

Hello,

First of all I need to mention I'm new within the STM and Keil environment. Have plenty experience in Arduino and Pic (C++).
So still in a learning curve, don't "kill" me. (I already went true a lot of documentation)

I understand that STM & Keil is quite different then Arduino, but gives much more insight and functionality for the programmer. GREAT.

"Blinky" works fine.
But now I took the next step "Hello" on Uart1. Configured all settings with STMCUBE (great tool).
Then added this code in the main part. (See below).
I expected that in Debug mode (I use J-Link Segger) when I opened the serial window and selected "Uart1", I would see "Hello" on the screen.....

But "NO".... Perhaps something is wrong in the code, but I'm more afraid there is something I don't get about the "setup" or functionality of the debugger. Because I never used a "Debugger" before.
I also read some documents about "printf", and the "viewer", but I have to admit, I don't fully understand (fputc.....). Seems also need some configurations....
And if the debugger cant show the Uart1 data in the serial terminal, what is then the use of this functionality.....?

Sorry if this a too "simple" question, but probably the Arduino messed up my "thinking".
Would like to get much more understanding of these STM controllers.

Thankx
YB

Setup:
Keil-Lite (can this be the reason for my problem???)
STM32F103VC
J-Link Segger debugger

Program:

int main(void)
{ /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* 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_TIM1_Init(); MX_USART1_UART_Init();

/* USER CODE BEGIN 2 */ char *msg = "Hello"; HAL_UART_Transmit(&huart1, (uint8_t*)msg, 6, 0xFFFF); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1)