Skip to main content
SVerm.3
Associate III
January 22, 2021
Question

Problem in interfacing stm32f407 discovery board with Simcom A7670 via UART...

  • January 22, 2021
  • 1 reply
  • 727 views

I have connected Stm32f407 discovery board with Simcom A7670 via USART6 but in asynchronous mode, connecting UART Tx of A7670 with USART6 Rx of STM43f407 discovery board and UART Rx of A7670 with USART6 Tx of STM43f407 discovery board respectively.

I am using STM32CubeIDE, so I have enabled USART6 Global Interrupt in NVIC Serttings and added USART Rx with mode Circular in DMA Settings and using 115200 bits/s as default. Hence when I burn my program into my MCU, using Putty connected with PC with 115200 Serial connection, doesnt shows any thing into its screen. Here is my Code...

#include "main.h"

#include <string.h>

UART_HandleTypeDef huart6;

DMA_HandleTypeDef hdma_usart6_rx;

void SystemClock_Config(void);

static void MX_GPIO_Init(void);

static void MX_DMA_Init(void);

static void MX_USART6_UART_Init(void);

int main(void)

{

  HAL_Init();

 SystemClock_Config();

 MX_GPIO_Init();

 MX_DMA_Init();

 MX_USART6_UART_Init();

 /* USER CODE BEGIN 2 */

char myTxdata[30]= "AT\n\r";

 /* USER CODE END 2 */

 while (1)

 {

 HAL_UART_Transmit(&huart6, (uint8_t *)myTxdata, strlen(myTxdata), 10);

 HAL_Delay(500);

  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

 }

 /* USER CODE END 3 */

}

This topic has been closed for replies.

1 reply

Vangelis Fortounas
Associate II
February 6, 2021

Hello

The code should work if UART is properly initialized (HSE value)

Also A760 has 1.8V levels UART

Note that the code initializes UART in DMA mode but HAL_UART_Transmit(...) dont uses DMA or interrupts. Is the blocking version of transmit

0693W000007EE4IQAW.jpg