2020-11-01 04:25 AM
I have been trying hard to produce a output in TeraTerm & RealTerm using uart2 via GPIO A Pins PA2 & PA3 which are directly connected to St-Linkv2 on my STM2F407VG Disc-1 Board. It just fails to produce anything. I am using STM32Cube IDE and STM32 CubeMX.
Pls Can Anyone help me out of this. I recently did the firmware upgrade to ST-LinkV2.1 and yes I got all the drivers installed already. I also did try to write my own main.c , msp.c and it.c ; still no output on TeraTerm.
Even I was facing the same issue when i tried STM32Duino, the Arduino Ide did not show any Serial output. Well that's for later, I want a solution to Stm32Cube Ide.
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();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_I2C1_Init();
MX_I2S3_Init();
MX_SPI1_Init();
MX_USART2_UART_Init();
MX_USB_HOST_Init();
/* USER CODE BEGIN 2 */
char* buf = "STM CORTEX M4 \r\n" ;
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
MX_USB_HOST_Process();
HAL_UART_Transmit(&huart2, buf, strlen((char*)buf), HAL_MAX_DELAY);
HAL_Delay(100);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
2020-11-01 04:36 AM
The pins on the F4-DISCO are not wired to the VCP provided by the ST-LINK. You'd either need to wire them, or use a USB-To-CMOS Serial dongle