Power Conditions

Plugging the battery in or plugging a USB cable into the RAK5010 should automatically power up the unit w/o having to push the power button.

At least that is what happens with most of the boards I’ve tested.

However I do have some RAK5010 boards that when you plug the battery in, it does NOT power up automatically. The power button needs to be pushed, then it’ll boot up.

What should be the normal action when the battery is plugged into a board? Should it just boot up?

If I have a board that doesn’t, where should I look to resolve. Almost all my boards will power on, so I’m assuming that this is the norm and that a board that doesn’t power up could have an issue.

TIA.
Carlton

When you plugged in the battery, the 2 LEDs do not turn on automatically? Blue fixed and the Red blinking? If not, have you configured the device to send data automatically?

Correct. No LEDS turn on until I push the power button. These boards are flashed with a new firmware so I can develop a custom application in Arduino. Most my boards behave the correct way and will power on when I plug the battery in or when I apply power to the USB buss.

I’m trying to figure out why a small handful of boards have this power on issue.

I did discover by accident if I end up shorting out the battery the board will immediately turn off. In this state the board will NOT turn on by pressing the power button. I have to unplug the battery, plug it back in, then push the power button. I know it’s not proper to short out the power but after I accidently did so, I discovered this additional clue.

Even though I’ve put a new firmware on the board, could the board have been in a state that it wouldn’t come on immediately when powered?

For example, could the board have been setup NOT to send data automatically and even when I put the new firmware on, some registers could have been set to a prior value?

Are you using the RAK5010 Arduino port?

The RED and BLUE leds are directly connected to BG96.

If the BG96 is not setup correctly, the modem might not turn on. There is a note as well in the RAK5010 datasheet.

Btw, when you say didn’t power on, is the whole module not ON? Or just the modem? Can you try to blink the User LED to see if your FW loop() is activated?

I created a really simple program:

void setup()
{
DBG(">>>>>>>>>>>>>>>>>>>> RAK5010: SETUP <<<<<<<<<<<<<<<<<<<<");
bg96_init();

for (int k = 0; k < 20; k ++)
DelayBlink(1000, 50, 50);
return;
}

void bg96_init()
{
pinMode(PIN_RESET, OUTPUT);
pinMode(PIN_PWRKEY, OUTPUT);
pinMode(PIN_GPS_EN, OUTPUT);
pinMode(PIN_W_DISABLE, OUTPUT);
pinMode(PIN_LED_GREEN, OUTPUT);
pinMode(PIN_BG96_DTR, OUTPUT);

pinMode(PIN_STATUS, INPUT);
pinMode(PIN_CHG_DET, INPUT);
pinMode(PIN_BAT_SET, INPUT);

// Defaults
digitalWrite(PIN_RESET, 0);
digitalWrite(PIN_W_DISABLE, 0);
digitalWrite(PIN_BG96_DTR, 0);
}

Then in my loop:

void loop()
{
DelayBlink(5000, 250, 250);
return;
}

TESTING

After program loads onto the RAK5010, it does the fast flicker (Setup), then the slow blink (Loop).

I unplug the battery, plug the battery back in and nothing happens.

Pressing the RESET button does nothing. Pressing the POWER button kicks the BG96 on, then my Setup and Loop function execute and the Green LED blinks per my code.

NOTES

  • This happens only on some devices, not all. Most my RAK5010 devices power up immediately when power is applied.
  • I’ve reflashed the bootloader
  • If the device is shorted, it’ll turn off. Plugging USB power in does NOT fire it up. Pressing the Power button does after the USB cable is plugged in. If the USB cable is NOT plugged in, after shorting the device will NOT power up w/ the Power button.

I’d like to figure out what might be happening so I can have a solution for devices that may be in the field and then have this issue. I’m hoping that this is not an issue that should normally pop up and somehow these devices have a hardware failure?? Or a register is stuck and I need to do a factory reset??

It would be nice to have some sort of theory as I just purchased 50 more of these units for my clients project.

Can you try to change bg96_init() to

void bg96_init()
{
pinMode(PIN_RESET, OUTPUT);
pinMode(PIN_PWRKEY, OUTPUT);
pinMode(PIN_GPS_EN, OUTPUT);
pinMode(PIN_W_DISABLE, OUTPUT);
pinMode(PIN_LED_GREEN, OUTPUT);
pinMode(PIN_BG96_DTR, OUTPUT);

pinMode(PIN_STATUS, INPUT);
pinMode(PIN_CHG_DET, INPUT);
pinMode(PIN_BAT_SET, INPUT);

// Defaults
digitalWrite(PIN_PWRKEY,0);
digitalWrite(PIN_RESET, 0);
digitalWrite(PIN_W_DISABLE, 0);
digitalWrite(PIN_BG96_DTR, 0);

// Configure PWRKEY
digitalWrite(PIN_PWRKEY,1);
delay(250);
digitalWrite(PIN_PWRKEY,0);
}

Adding the Power On sequence in code does result in the intended behaviour.

It’s behaving like the boot sequence isn’t kicking off when power is applied. Once the device is off, the only way to turn it is on w/ the power button. Plugging power in doesn’t result in what my other boards are doing.

Long term my goal is to add a physical power button on the battery so that I can completely turn off the battery. (for storage). Then the client just turns the power button on which engages the battery which should automatically start the boot sequence.

As this device has failed, my concern is that other devices may do the same and I’m just searching for a reason why this happened.

Does the PWRKEY input pulse added in the code solves the issue?

PWRKEY pulse does NOT turn the device on. I don’t think my code is getting executed. Plugging the battery or USB cable in, is NOT triggering the bootloader to execute code.

That’s strange. Have you checked if there are related intermittent issues on the repo of the bootloader. Also, how did you upload the bootloader?

I use J-Flash with J-Link to upload the bootloader.

Why would this happen to a few boards and not all. Most my boards work as expected. This board plus a few more exhibit this power issue.

What is the firmware that should be put on the device? The one from AdaFruit?

GitHub - adafruit/Adafruit_nRF52_Arduino: Adafruit code for the Nordic nRF52 BLE SoC on Arduino

Which one should I be using?

I’m currently using: feather_nrf52840_express_bootloader-0.2.13_s140_6.1.1.hex

You can probably try to update it to 6.2.0 and see if there can be improvement. The NRF52 bootloader is created by the Adafruit so creating an issue ticket in their repo might be helpful as well.

I am not sure if you make the device work on our default FW, if it is working on our FW and not on Adafruit, then there could be a bug in bootloader. Else, if our FW on those problematic boards are not working as well, then we can check the possibility that it is related to hardware.

The Adafruit Bootloader has two button pins defined to force the module into bootloader mode. The GPIO’s defined are 34 and 10.
On the RAK5010, GPIO34 is the pin IO3 on the J4 header. Do you have anything connected to that pin?

Excellent idea - can you point me to the default firmware for the RAK5010. I’ll put it back on the device and test.

Nothing connected to IO3 on the RAK5010.

The FW is here - RAKwireless Downloads

FW uploading guide here - RAK5010 Quick Start Guide | RAKwireless Documentation Center

Thanks. I reverted the firmware back to the original from the link you sent. When I plug the USB cable in, the device does not turn on. I have to push the power button to get it to start. Seems to be doing the same thing.

I don’t know how it could be a hardware issue, but to me it’s looking like it’s something with hardware that isn’t triggering the startup sequence. Some component shorted out??

Some ideas I have that can possibly narrow down the issue and get more useful observations:

  1. I tried re-uploading the same firmware with my RAK5010 here and everything seems fine.

  2. Do we have the same FW?

image

  1. When you connect the RAK5010 to USB port, is the port detected and can you send AT commands? With or without battery connected. Like can you send at+version? If you can AT commands, does at+set_config=device:restart restarts the device as if you are pressing the power button?

  2. If possible, can you try to configure the device if it can work on automatic cellular sending mode?

  3. Can you try to compare current consumption of a working fine module and a problematic module? I am trying my luck to see if we can find unusual there. You can probably use a bench power supply simulating the battery.

I don’t think this is related to firmware. I think it’s a failure on some component on the board.

I have 4 boards on my bench - all are running the same firmware. Have GPS and Antenna and battery attached. Only 1 will not boot up if you unplug the battery and plug back in.

The one that is failing has another odd issue…

My code can put the device to sleep - it first turns off the BG96, then it puts the nRF5x into POWER_MODE_OFF.

The 3 devices that work will turn off the BG96 (red/blue light goes out), then the CPU turns off. My LOOP function stops running and the device is off until you plug the power (USB) cable in. It’ll then boot back up automatically.

The 1 device that I’m having issues with will turn off the BG96 and CPU, however about 5-8 seconds later, the BG96 powers back up without touching the board or plugging in power.

So I’m going to call this a hardware issue. It doesn’t happen often (out of 100 units I think this has happened less than 10 times). It could be because of a bunch of prototyping and how I was connecting the SGP30 sensor to the device originally.

I’m just curious as to why this happened so I can prevent in the future.

Interesting info. Hmm. Things like these are hard to troubleshoot because they are not occurring most of the time. Another idea I have is to check the power lines like VDD and battery level during the process when the battery/usb is connected. Also you can check reset or pwrkey pins. You might be able to find some clue there.