This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sending AT commands to a GSM

Hello All, I am working with a pre-programed PCB; the main components of the are a nRF51822 chip, a GPS, and a GSM. I am using a J-link to communicate to the entire board through the SWD (SWDIO and SWDCLK) pins on the nRF51. I need to send AT commands to the GSM to test it for functionality. How do I do that? I have been told that I need to embed the AT commands in the nRF51's source code and re-flash it to the chip. However, I do not have the original source code. Is there any way to have the nRF51 send the GSM the AT commands without re-flashing the the source code? I would like to send the AT commands using serial (using a Putty or the like). Can this be done through the SWD pins? Thanks.

Parents
  • Hi!

    I think the only possibility would be to use the debugger interface to manually write to the UART0 registers. You need to set up the PSELTXD/PSELRXD, BAUDRATE and CONFIG registers, set ENABLE to 0x04 and enable the STARTTX task first. Then you should be able to write single bytes by writing 0 to EVENTS_TXDRDY, write your byte to the TXD buffer, and poll the EVENTS_TXDRDY area periodically until it is 1 again. Assuming that the firmware is not using the UART peripheral already, reseting your settings.

    This is of course terribly hacky, quite slow, and keeps the debugger interface enabled (which will likely break ongoing radio activity and keep the power consumption very high). But if you need to seldomly send a few commands, this could do the trick.

  • Hello Ulrich. When you say to use the debugger interface do you mean the J-Link RTT Viewer or the debugger in Keil? If you do mean Keil, how can the debugger be accessed without the source project. Thanks.

Reply Children
No Data
Related