2024-12-01 06:45 AM
Hello everyone,
I'm currently trying to send and receive SMS with the "Adafruit FONA GSM SIM800H" module and a Nucleo-L432KC board. Initially, I tested the module with an Arduino UNO as described in the Adafruit FONA documentation, and everything worked fine—I was able to send and receive SMS messages. However, now I want to use the STM32 board.
I created a new project using STM32CubeMX and configured HUART1 for the GSM module and HUART2 for serial print. The issue I'm facing is: when I send "AT\r\n" with HAL_UART_Transmit, my rx_buffer remains empty. I initially thought it could be a logic level issue, as the Arduino UNO operates at 5V and the STM32 board uses 3.3V, but even after adding a logic level converter, there is still no response to the AT command.
I have connected the module’s RX to D5 and TX to D4, and I've enabled interrupts for D4.
Does anyone have any ideas on what could be causing this issue or suggestions on what I could try?
2024-12-09 06:52 AM - edited 2024-12-09 07:05 AM
Hello @CeliaCJ ,
You need to check if the UART sends frame to SIM module on Tx pin correctly. Check that by probing Tx pin with an oscilloscope or Logic analyzer. If you don't have a such equipment try to find someone who have it.
PS: kindly, please don't share screenshots of your code but use </> button to paste it.
Thank you for your understanding.
2024-12-09 07:01 AM - edited 2024-12-09 07:04 AM
@CeliaCJ wrote:The issue I'm facing is: when I send "AT\r\n" with HAL_UART_Transmit, my rx_buffer remains empty.
So how do you know if your STM32 is actually transmitting anything at all ?
That's the first thing you need to test.
Some tips here on debugging serial comms:
BTW: The terminator for AT commands is just Carriage Return (CR, \r) - no need for a linefeed (LF, \n).
PS:
Pease see the Posting Tips for how to properly post source code - not as images:
2024-12-09 07:02 AM
@SofLit wrote:You need to check if the UART sends frame to SIM module on Tx pin correctly. Check that by probing Tx pin with an oscilloscope or Logic analyzer. If you don't have a such equipment try to find someone who have it.
Absolutely.
@CeliaCJ As a simple test, without needing a scope or analyser, just user a terminal app - as described here: