Skip to main content
Graduate
June 28, 2024
Solved

What hardware to use with STM32f4 so I can practice AT commands?

  • June 28, 2024
  • 2 replies
  • 1881 views

Hello everyone, I am a student who is fairly new to these concepts so I wanted to pick your brains for a bit if you'll allow me to. I have done some research and found that STM32F4 is compatible with AT commands if we use external hardware. However, I am stuck on what to use. ESP8266 and ESP32 seem like fairly popular choices. I also researched and found that good alternatives for those are: nRF52840, C3200, CC3220. Then I found out about SoCs (system on chip) but I think that is a bit too advanced for a beginner, I'll try those out when I have grown more familiar with this. Thank you for any and all of your help, as well as for your time!

    This topic has been closed for replies.
    Best answer by Andrew Neil

    The best way to practice AT Commands is to do it manually with a terminal.

    Type the commands at the keyboard, and see the responses on the screen

    Adding an STM32 (or any other microcontroller) at this point just confuses the issue.

    There are loads of devices which provide an AT Command interface - just choose something you can get easily and be sure that it comes with full documentation of its AT commands.

    ESP8266, ESP32, nRF52840, C3200, CC3220, et al are all just microcontrollers - it's the firmware loaded into them which provides the AT Commands.

     

    Addendum:

    V.250 is the ITU Standard which formalises the "syntax" of AT commands: 

      https://www.itu.int/rec/T-REC-V.250/en

     

    27.007 is the 3GPP standard for cellular AT Commands:

      https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1515 

     

    27.005 is the 3GPP standard for SMS AT Commands:

      https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1514 

    2 replies

    Super User
    June 28, 2024

    The best way to practice AT Commands is to do it manually with a terminal.

    Type the commands at the keyboard, and see the responses on the screen

    Adding an STM32 (or any other microcontroller) at this point just confuses the issue.

    There are loads of devices which provide an AT Command interface - just choose something you can get easily and be sure that it comes with full documentation of its AT commands.

    ESP8266, ESP32, nRF52840, C3200, CC3220, et al are all just microcontrollers - it's the firmware loaded into them which provides the AT Commands.

     

    Addendum:

    V.250 is the ITU Standard which formalises the "syntax" of AT commands: 

      https://www.itu.int/rec/T-REC-V.250/en

     

    27.007 is the 3GPP standard for cellular AT Commands:

      https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1515 

     

    27.005 is the 3GPP standard for SMS AT Commands:

      https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1514 

    detaAuthor
    Graduate
    June 28, 2024

    Thank you for your kind reply and resources. I have done research with your words in mind and have come across SIM800L, SIM900L and SIM7600. Are these the types of devices that you have mentioned? (I apologize for being ignorant, I am very lost). I tried to get my modem's general info using a terminal (by using PuTTy) just to have SOME idea of what to do. However, I need the right USB cable for it so I cannot do that--will try that one tomorrow. 

     

    Thank you, again, for your time and help.

    Super User
    June 28, 2024

    Yes, SIM800L, SIM900L (both 2G) and SIM7600 (4G) are all cellular "modems" - they will support AT commands in accordance with 27.007 and 27.005, plus some SIMCOM proprietary commands.

    The AT Command manuals should be widely available for these.

    (make sure you have the correct version of manual to match the firmware version in your device)

    Super User
    June 28, 2024

    If you want to test AT command on a device connected to a STM32 you can connect another UART of STM32 to a terminal on a PC, via the debugger VCP. Then type commands on the terminal and observe output of the device.

     

    extern UART_HandleTypeDef huart5;
    extern UART_HandleTypeDef huart2;
    
    int uarts_loop()
    {
     USART_TypeDef *UW = huart5.Instance; // Ext. Device
     USART_TypeDef *UT = huart2.Instance; // Terminal
     for(;;)
     {
     if (LL_USART_IsActiveFlag_RXNE(UW)) {
     if (LL_USART_IsActiveFlag_TXE(UT)) {
     LL_USART_TransmitData8(UT, LL_USART_ReceiveData8(UW));
     }
     }
    
     if (LL_USART_IsActiveFlag_RXNE(UT)) {
     if (LL_USART_IsActiveFlag_TXE(UW)) {
     // Stop on ^C
     uint8_t ch = LL_USART_ReceiveData8(UT);
     if (ch == 3) {
     break;
     }
     if (ch == '\n') {
     ch = '\r';
     }
     while (!LL_USART_IsActiveFlag_TXE(UT)) {}
     LL_USART_TransmitData8(UT, ch); // echo
     LL_USART_TransmitData8(UW, ch);
     }
     }
     }
     return 0;
    }