Interfacing STM32F4 with SIMCOM 800L GSM module

Hello everyone,
I have succesfully used the SIMCOM 800L with Arduino UNO, but my project requirements state that I have to use as MCU the STM32F401RE programming it with ST library HAL. The problem that arises is that apparently I cannot receive any response from the GSM module to my AT commands. SIM800L is connected to the network, its LED blinks every 3 seconds, and is correctly suppllied with a 3.7V LiPo battery. I also made a voltage divider to reduce the input voltage to the RX pin of the GSM module as indicated in the product datasheet. Both polling and interrupt based receive function don’t get any answer from the module. I also set the UART to send messages in 8bits with no parity and 1 stop bit, as I found checking what Arduino does by default with SoftSerial.
Has anyone met my same problems and found a solution? If it needs I can also post some code, but it’s really silly basic to transmit “AT\r\n” and receive an answer.

No one able to give me some hints?

Before going to Arduino, Take a TLL USB UART converter and probe the UART lines of GSM modules first to see the module is responding or not and what baud rate you see the response?
Once you see some AT texts then proceed with Arduino.

Thanks for your reply,
I tested SIM800L with a converter, and responds to commands sent directly from PC terminal. My troubles are with STM32F401RE UART. The baud rate is 9600bps. As I said before no problems with Arduino, it works. I suspect that there is some issue in the voltage level of my STM UART, even if I followed the datasheet and used a voltage divider.

I have some news. I finally managed to connect to SIM800L with my STM board, and I can also exchange some messages. The problem was a faulty resistor that made my struggle with input voltage. However SIM800L seems a bit “capricious”. It has often difficulty to connect to network, and sometimes shuts down. As a classic of this component I suspect about the power supply, in my case a 3.7LiPo battery at 1500mAh. Is this the case? I am suspicious about this intuition because this issue is not continous, many sometimes I have no problems with network connection.


Modules do get stuck sometimes, we have to reboot them when they cant recover themself. But its very unlikely that they do that unless there is a power issue as you told. If there are power fluctuations, their software can enter unknown states. A PWRKEY or RESET pin activation would do it.

I am quite sure that is a power issue, because the on-board led flashes at 1Hz for a bit and then stops and restarts. Also if I connect to a serial monitor the module repeats “SMS ready Call ready” ecc. If my 1500mAh battery is fully charged it seems that there are no troubles, when it gets to about 70% SIM800L seems unable to work properly. Is it possible that this supply is not enough (I know I should be able to provide 2A but on the Internet many use a simple battery with even lower current than mine)?

I’ve got news for anyone who is facing my same problems. I attached SIM800L directly on a breadboard so to reduce the distance with the battery (connected with short wires) and I also added a 1000uF capacitor to boost current and now there are no problems of supply, the module works perfectly. Only one problem, signal is a bit weak (never more than 15 when checking with CSQ) so I have often troubles with HTTP commands (60x errors), but that’s it, 2G networks surely aren’t the faster with data transfers.

I have a further question: my module came out with the small helical antenna, and also another small printed antenna to attach on the module. I soldered the helical antenna, so I suppose that my module is using it even if I attach the other antenna (which should have better sensitivity). My question is if this is true, and if so my only chance to try the printed antenna is to remove the helical one?

1 Like

Normally the antennas are designed to present 50 ohm impedance. If you connect 2 antennas to the GSM antenna port it would not result in maximum power transfer to and from the antenna. I would suggest to use only one.

I am actually working on sim800l interfaced with stm32f401re.I m using platformio IDE. USART 6 RX and TX pins.
Using buffererserial communication. when i send at commands as array to sim800L . I am not receiving any reply like ok. But i tried pc usb to uart converter . iam getting ok. Could you please help me ?