We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I am using HC-05 bluetooth module and STM32F407. I have to enter AT Command Mode and send some AT Commands. Normally, i do it pressing button on the module. But i have to enter AT Command Mode using only software. I can enter AT Command Mode, but i can't send any AT Commands to module. I tried to change the name of the module but it didn't work.
Here is my try. Where is my mistake?
/* USER CODE BEGIN PV */ uint8_t data[50]; /* USER CODE END PV */ static void MX_USART3_UART_Init(void) { sprintf(data,"AT+NAME=charles \n\r"); HAL_UART_Transmit(&huart3, (uint8_t *)data, strlen(data), 2000); }
This has nothing to do with Keil!
AT commands are just about sending & receiving serial data.
So the first thing to do is to get your basic serial comms working.
Once you have basic serial comms working, then it's just a matter of creating the required strings, and sending them; receiving the responses, and parsing them.
But before you do anything in code, practice sending commands to your device manually using a terminal, and observe the responses that you get.
Note that none of this is new - AT commands were long-established and widely-used long before Cortex was even a glint in ARM's eye.
In fact, long before ARM even existed!
eg,
https://www.avrfreaks.net/comment/2209136#comment-2209136
https://www.avrfreaks.net/comment/2783946#comment-2783946
https://www.avrfreaks.net/comment/2212161#comment-2212161