cancel
Showing results for 
Search instead for 
Did you mean: 

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

SVerm.3
Associate III

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

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 */

}

 ////program continues....

7 REPLIES 7

Is the modem powered up?

Any code here reflecting data to a console?

I'd probably start with a pair of UART forwarding back and fo​rth so I could interact manually from a console.

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

Yes Modem powered up... Code reflecting to the STM32F407 Discovery board but not able to interface with modem...

I'd use the "\r\n" ordering

Something like "ATI4\r\n" reports Modem info

Are you sure sending "AT"every 500 ms is advisable?

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

I have changed "AT\r\n" to "Hello World\r\n" but same problem occured....

be careful, as Tesla DeLorean said, use \r\n, not /r/n. The proper slashes are important in C.

sorry its \r\n only.....

Even though you have enabled interrupts and set up DMA, you are transmitting using polling. Not a big deal really.

So you have your PC connected to the port instead of the radio module? You should be seeing AT<cr><lf> showing up every half second, but you're not.

I'd make sure that your converter chip is hooked up correctly. It's no use talking into your computer's mouth. (I can't assume how much you know about serial ports, so I'll just say that you can't hook your STM32 uart directly to your PC)

Take a look at https://embedded.fm/blog/2016/12/13/discovery-uarts-part-3-the-final-step.