RAK3172 Trouble With Running Code

Hello,

I have a custom board designed with a RAK3172, an I2C ADC, and an I2C temperature and humidity sensor. I am having trouble getting them to work reliably after programming, power cycles, and sleep modes.

I noticed that when programming our RUI3 program it would typically work once after programming, then never do anything again after sleeping. I thought it might be code related, so I flashed the LoRa P2P.ino ping-pong sketch and I noticed that while it would work the first try, if I removed the battery and restarted it, it would no longer respond any other command. I had been using the STLINK to program these boards, so I purchased a Hiletgo CH340 breakout board to view the serial prints from the sketch and soldered it directly to the corresponding pads (RX_RAK->TX_CH, TX_RAK->RX_CH, GND->GND). I also tried flashing it using the Serial port instead, but that did not fix it. I then tried uploading the latest firmware file using the STLINK and that would infinitely loop as well.

Watching the Serial terminal, it spammed AT_COMMAND_NOT_FOUND even though I was not sending any commands. Sometimes it stays like that seemingly forever, and other times it gets to a weird state and stops responding to anything, including AT commands. This happens with the LoRa P2P.ino sketch and our own custom code equally. I am not sure if the error it spams is related to the board not working or is because of the breakout board attached to it, but if I unplugged it I can no longer see it do anything, although this does not fix the hang ups. A picture of the output is below.

Some board notes:

  • The board is powered at 3.5V with a 1/2AA lithium battery.
  • There is a single ceramic 10uF and a single ceramic 100nF for decoupling near the power pin of the RAK.
  • The RESET pin has the RC filter of a 10k resistor pulled high and a 100nF cap to ground.
  • The BOOT0 pin is pulled LOW with a 10k resistor.
  • The ADC and temp sensor have one 100nF decoupling capacitor each.
  • The I2C lines are pulled up with 10k resistors for BOM consolidation, however for each time the device has worked the I2C devices are recognized immediately.
  • I am using a TC-2050 cable and footprint to program.
  • We are only using LoRa P2P and I2C, no other peripherals or LoRaWAN.

I am very stumped as to why it is not working, and I would appreciate any help.

Serial Output:

If you would like the schematic and layout, I would prefer to share that privately.

Hello Dirk,

What RUI3 version are you using with your custom firmware?
Please share your schematics in private message with me.

Boot0 can be left open, the RAK3172 has an internal pull-down resistor already. But an additional resistor does not hurt.

If you just power up and let it run, do you get the same error after some time or does it only happen when you remove and reinsert the battery?

Bernd,

Thank you for responding so quick. I believe I am currently using whatever RUI version is bundled in the latest Arduino board, which appears to be 4.0.6. I also flashed the RAK3172 (.hex) file found at the bottom of this page during testing, which still exhibited the same results.

The AT_COMMAND_NOT_FOUND error appears to only happen on reboots, but I noticed when I do leave the boards running, after their first iteration of the loop it appears to be okay, but then if I am using sleep it will no longer work.

I will send copies of my schematic and board layout over PM after this message.

Thanks for taking a look.