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

NRF52840 Development Kit - code not working when using external supply or CR2032 battery

Hello everyone,

I am using a NRF52840 development kit to write a custom protocol, so for the moment I am not using the softdevice but I am rather using the Radio as a peripheral.

My code runs as expected to, and I am able to have 2 boards communicate with each other. So far, I have always worked with the USB cables plugged to the computer.

Now, I decided to remove the USB cables to start evaluating the power consumption, but with great surprise I noticed that the code does not run at all, neither with the battery, nor with an external power supply connected on P21. It is not the first time I work on NRF52 kits, and in fact I can confirm that the kit itself works. If for example I program it with a blinky example, this runs smoothly both with battery and external supply.

So, my guess is that somewhere in the code there is something wrong. I also tried to replace the main function of my application with the one to simply blink the leds, and this works fine, so I think the sdk_config file is well configured.

Do you have any clue where I could start investigating? I am honestly pretty surprised with this behavior.....thank you!

Parents
  • Hello,

    I suspect that you a project that is initializing the uart, is that correct? Either as a peripheral, or maybe in the logging module?

    If so, I suspect that you are getting a APP_UART_COMMUNICATION_ERROR event in your uart_event_handle(). Can you try to comment out the APP_ERROR_HANDLER in this event?

    Something like this:

            case APP_UART_COMMUNICATION_ERROR:
                //APP_ERROR_HANDLER(p_event->data.error_communication);
                break;

    Alternatively, if you haven't modified the UART pins, can you try to connect P0.08 to GND. 

    If this is the issue, it is caused by the fact that the RX pin on the UART peripheral is floating. When it floats between 0 and 1, sometimes being 0 and sometimes being 1, it will interpret this as something is trying to send a UART message, but it isn't following the given baudrate, which throws an error. The default way to handle this error in our examples is to send this into APP_ERROR_HANDLER(), to let the developer know of the issue. The problem is that if you don't have any logging or debugging, it is difficult to know what that is happening. 

    Try what I suggested, and let me know if it doesn't solve the issue.

    Best regards,

    Edvin

  • Definitely working fine now, the problem was exactly the one you described.  Good catch and precious help! You saved me I can't imagine how many hours of debugging :) 

    Thanks a lot. 

Reply Children
No Data
Related