hello I write blow code with STcubemx and arm keil. I want to send a string data from MCU TO GSM module for calls. but nothing happend, when programing the chip. my question is , when send serial data with printf command , which port that command is sent (I use STM32F103C8T6 that has 3 usart)
how can I reslove this problem?
char phoneNO[]="093XXXXXX"; int main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_USART2_UART_Init(); printf("AT"); HAL_Delay(1000); printf("ATD"); printf(phoneNO); HAL_Delay(8000); printf("ATH"); while (1) { }
.
>>my question is , when send serial data with printf command , which port that command is sent (I use STM32F103C8T6 that has 3 usart)
I will go to whatever port you've initialized and provided fputc() functionality for.
Not done that in your code? Then it's likely to go into some big sink-hole, or generate a software interrupt or break point.
If you code things right you can have the data come out the SWO pin rather than a USART at all.