RAK3172 LORA NOT GOING INTO BOOTMODE ANYMORE

I am using an RAK3172 module and this is not going into bootmode anymore.

This is the problem:
When it starts it give a packet confirmed but thats all. (See below). Also its not responding to the AT commands, i measured this with the scope and can see that the messages arriving at the microcontroller. This all started when i tried to flash new software into the microcontroller but i couldn’t flash is.

(17:17:11.221) RAKwireless LoRaWan ABP Example
(17:17:11.235) ------------------------------------------------------
(17:17:12.048) Duty cycle is ON
(17:17:12.063) Packet is CONFIRMED
(17:17:16.534) AT
(17:17:19.788) AT
(17:21:03.416) AT

Has anyone an idea what i can do about it?
Thank you very much!

Welcome to RAK forum @Marnick ,

I am not exactly sure what firmware you uploaded (buy maybe a modified ABP example?). Also I have no idea on the hardware as well. Is the UART2 connected to an external MCU or you are using the RAK3172 as the microcontroller itself? Where you able to try to force boot loader mode via AT+BOOT? Also, can you share the RUI3 version you use via AT+VER=?

Thankyou for the reply Carlrowan,

I forgot to say that i’am using the RAK nanodap V2.3 as bootloader and wired with the UART2 of the RAK3172.
Further i use the ABP example from arduino examples, i added some adjustments because i wasn’t able to send data to the gateway. I only got a confirmed uplink but not a succesfully send. That problem is still not solved but that is for later.

I use the RAK3172 as microcontroller itself.
The RAK3172 didn’t reply to any AT command. I tried to send “AT”
so that the microcontroller has to give “OK” back but doesn’t respond. Also the AT+BOOT command
is not working, no response at all. Tomorrow i can share the RUI3 version. now i’am not able to do that.

Thank you very much for your help!

Hi @Marnick ,

Another possibility is that your device is already in bootloader mode, you can try to execute at+run and AT+RUN (please try both).

If you can share both the RUI3 version you use in your IDE and the modified ABP example, that will be helpful so I can try.

I am not sure why you are using ABP but you have to disable the frame counters on the network server to keep on successful uplinks even when the device reset/restart.

We have no way at the moment in RUI3 firmware to store the frame counts both on uplink and downlink. If you don’t disable it, you will not get to continuous uplinks.

I tried to send AT+VER=? but i don’t get any response, even when i try to send AT (also no response). See below. So i cannot get my RUI version of the RAK3172. I only know the firmware version, this is (RAK3172_v1.0.4_App_20220218)

RAKwireless LoRaWan ABP Example

Duty cycle is ON
Packet is CONFIRMED
AT+VER=?
AT+VER=?
AT
AT
AT

The modified ABP example. I couldn't add the library's which arduino ABP example is using. If you 
find the example in arduino then you can replace this code and you have the right library's.


#define ABP_PERIOD   (10000)
/*************************************

   LoRaWAN band setting:
     RAK_REGION_EU433
     RAK_REGION_CN470
     RAK_REGION_RU864
     RAK_REGION_IN865
     RAK_REGION_EU868
     RAK_REGION_US915
     RAK_REGION_AU915
     RAK_REGION_KR920
     RAK_REGION_AS923

 *************************************/
#define ABP_BAND     (RAK_REGION_AU915)
#define ABP_DEVADDR  {0x26, 0x0C, 0x1A, 0x71}
#define ABP_APPSKEY  {0x39, 0xCA, 0x25, 0x2D, 0x8D, 0x02, 0x89, 0xC4, 0x9B, 0xA0, 0x37, 0xE7, 0xB2, 0x9A, 0x48, 0xE6}
#define ABP_NWKSKEY  {0xC0,0xD3,0xE1,0x2C,0xFA,0x7A,0x2E,0x12,0x23,0x0C,0xE8,0x0C,0x1E,0x6B,0x51,0x8C}

/** Packet buffer for sending */
uint8_t collected_data[64] = { 0 };

void recvCallback(SERVICE_LORA_RECEIVE_T * data)
{
  if (data->BufferSize > 0) {
    Serial.println("Something received!");
    for (int i = 0; i < data->BufferSize; i++) {
      Serial.printf("%x", data->Buffer[i]);
    }
    Serial.print("\r\n");
  }
}

void joinCallback(int32_t status)
{
  Serial.printf("Join status: %d\r\n", status);
}

void sendCallback(int32_t status)
{
  if (status == 0) {
    Serial.println("Successfully sent");
  } else {
    Serial.println("Sending failed");
  }
}

void setup()
{

  
  Serial.begin(115200, RAK_AT_MODE);

  Serial.println("RAKwireless LoRaWan ABP Example");
  Serial.println("------------------------------------------------------");

  // ABP Device Address MSB first
  uint8_t node_dev_addr[4] = ABP_DEVADDR;
  // ABP Application Session Key
  uint8_t node_app_skey[16] = ABP_APPSKEY;
  // ABP Network Session Key
  uint8_t node_nwk_skey[16] = ABP_NWKSKEY;

  


  if (!api.lorawan.daddr.set(node_dev_addr, 4)) {
    Serial.printf("LoRaWan ABP - set device addr is incorrect! \r\n");
    return;
  }
  if (!api.lorawan.appskey.set(node_app_skey, 16)) {
    Serial.printf
	("LoRaWan ABP - set application session key is incorrect! \r\n");
    return;
  }
  if (!api.lorawan.nwkskey.set(node_nwk_skey, 16)) {
    Serial.printf
	("LoRaWan ABP - set network session key is incorrect! \r\n");
    return;
  }
  if (!api.lorawan.band.set(ABP_BAND)) {
    Serial.printf("LoRaWan ABP - set band is incorrect! \r\n");
    return;
  }
  if (!api.lorawan.deviceClass.set(RAK_LORA_CLASS_A)) {
    Serial.printf("LoRaWan ABP - set device class is incorrect! \r\n");
    return;
  }
  if (!api.lorawan.njm.set(RAK_LORA_ABP))	// Set the network join mode to ABP
  {
  
	Serial.printf("LoRaWan ABP - set network join mode is incorrect! \r\n");
    return;
  }


  if (!api.lorawan.adr.set(true)) {
    Serial.printf("LoRaWan ABP - set adaptive data rate is incorrect! \r\n");
    return;
  }
  if (!api.lorawan.rety.set(1)) {
    Serial.printf("LoRaWan ABP - set retry times is incorrect! \r\n");
    return;
  }
  if (!api.lorawan.cfm.set(1)) {
    Serial.printf("LoRaWan ABP - set confirm mode is incorrect! \r\n");
    return;
  }

  if (!api.lorawan.join()) {
     Serial.printf("LoRaWan OTAA - join fail! \r\n");
    return;
  }

   /** Wait for Join success */
  while (api.lorawan.njs.get() == 0) {
    Serial.print("Wait for LoRaWAN join...");
    api.lorawan.join();
    delay(10000);
  }




 // /** Check LoRaWan Status*/
  Serial.printf("Duty cycle is %s\r\n", api.lorawan.dcs.get()? "ON" : "OFF");	// Check Duty Cycle status
  Serial.printf("Packet is %s\r\n", api.lorawan.cfm.get()? "CONFIRMED" : "UNCONFIRMED");	// Check Confirm status
  uint8_t assigned_dev_addr[4] = { 0 };
  api.lorawan.daddr.get(assigned_dev_addr, 4);
  Serial.printf("Device Address is %02X%02X%02X%02X\r\n", assigned_dev_addr[0], assigned_dev_addr[1], assigned_dev_addr[2], assigned_dev_addr[3]);	// Check Device Address
  Serial.printf("Uplink period is %ums\r\n", ABP_PERIOD);
  Serial.println("");
  api.lorawan.registerRecvCallback(recvCallback);
  api.lorawan.registerJoinCallback(joinCallback);
  api.lorawan.registerSendCallback(sendCallback);
  api.lorawan.jn1dl.set(5000);
  api.lorawan.jn2dl.set(6000);
  api.lorawan.txp.set(5);
  api.lorawan.rx1dl.set(1000);
  api.lorawan.rx2dl.set(2000);
  api.lorawan.rx2fq.set(923300000);
  api.lorawan.nwm.set(1);
  api.lorawan.rety.set(1);
  api.lorawan.cfm.set(1);
  api.lorawan.dr.set(5);
}



void uplink_routine()
{
  
  /** Payload of Uplink */
  uint8_t data_len = 0;
  collected_data[data_len++] = (uint8_t) 't';
  collected_data[data_len++] = (uint8_t) 'e';
  collected_data[data_len++] = (uint8_t) 's';
  collected_data[data_len++] = (uint8_t) 't';

  Serial.println("Data Packet:");
  for (int i = 0; i < data_len; i++) {
    Serial.printf("0x%02X ", collected_data[i]);
  }
  Serial.println("");

  /** Send the data package */
  if (api.lorawan.send(data_len, (uint8_t *) & collected_data, 2, true, 1)) {
    Serial.println("Sending is requested");
      Serial.println("Hij probeert te senden");
  } else {
    Serial.println("Sending failed");
  }
}

void loop()
{
   
 
 
  static uint64_t last = 0;
  static uint64_t elapsed;

  if ((elapsed = millis() - last) > ABP_PERIOD) {
    uplink_routine();

    last = millis();
  }
  //Serial.printf("Try sleep %ums..", ABP_PERIOD);
  api.system.sleep.all(ABP_PERIOD);
  //Serial.println("Wakeup..");
  //Serial.println( !api.lorawan.txp.get());
  Serial.printf("The transmit power is %d\r\n", api.lorawan.txp.get());
  delay(500);
  
}

Hi @Marnick ,

I did check the RUI3 ABP example for RAK3172 and it works ok on my test. As you see here, the code continues without hanging.

image

Here’s the TTN logs.

My suggestion is to reupload the .hex file on the device using STM32CubeProgrammer then try again the ABP example. However, you do not need to put this on the code since this is already handled by the RUI3 firmware itself when you select the region.

image

Hello @carlrowan. Thank you for your help last time. With the STM programmer i was able to program the module and could send some AT commands again. But not for long. Now i’am not able to send AT commands again and the STM programmer said " unable to get core ID". Do you have any idea what problem of this can be? see image below for the errors

Kinds regards,
Marnick

Hi @Marnick ,

I rarely use STLINK these days unless I need a realtime debugger with STM32CubeIDE.

The UART Bootloader of STM32WL chip is quite stable and that’s what I use whenever I am using STM32CubeProgrammer.

Regarding your issue, my suggestions are:

  1. Double check the connections of wires. Try to continuity just for sanity check.
  2. Try to use different reset methods.

image

Btw, what firmware are you trying to upload? RUI3 4.0.0?

Hello @carlrowan, i tried to do several resets. But the strange thing i saw later, is that when i connect with the ST-link programmer and flash the new software in the module and start program after flash, iam able to do at commands. But when i disconnect the st-link and uart, and try to connect again with the uart, the program is not running. So it looks like the program is only running after doing a new flash and " start after flash" command.

Things i tried

  • the boot0 pin to 3v3
  • 2x reset pin to gnd

iam using the latest firmware.
https://downloads.rakwireless.com/LoRa/RAK3172/Firmware/RAK3172_Latest_Firmware.zip

I am not sure exactly what happen.

Maybe you can try UART connection instead of STLINK?

Btw, you are using RAK3172 Legacy FW. Is there a particular reason why?

iam using UART connection, first i flash the code with ST-link and then debugging with UART. But its not automatic starting the code via UART and i cannot flash the code with UART. So thats the reason why iam using ST-link for flashing and starting the code.

No, this was the firmware on the RAK site. you suggest this is the wrong firmware ?

hello @carlrowan.

iam configuring the RAK3172 module with AT commands and when iam trying to
send ATD or +++, its not recognizing the commando. I want to leave AT mode for a while and go
back into AT command with +++ .

Firmware is RAK3172_v1.0.4_App_20220218

Do you have a thought about the problem?
Kind regards

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.