Programming a nRF52810 (BL651 module) using nRF Connect for Vscode and nRF52-dk

Hi,

I'm using the nRF52-DK to program a BL651 Module (nRF52810). To confirm things work as intended I'm starting with the blinky sample. I've set up an emulated project by selecting "nrf52dk_nrf52810" as a board. The blinky sample works exactly as expected on the nRF52-DK's built in nRF52832 chip.

I then hooked up the BL651 module to P20 on the DK board and was able to successfully flash the blinky sample onto the BL651 (The BL651 was hooked up to external LED for testing). The problem is, the LED is flashing almost exactly 32 times slower than expected - Instead of toggling once every second, it toggles once every 32 seconds). 

After some more digging, I found on the info center under "Developing for nRF52810" that I need to do a few things to transfer this emulated project to run on an nRF52810. The page states: 

"In your IDE, remove the DEVELOP_IN_NRF52832 and NRFX_COREDEP_DELAY_US_LOOP_CYCLES defines from the compile flags." I assume this is the cause of my much slower LED blinking.

I'm new to nRF development and am having a very difficult time finding where I can find these defines. I would really appreciate any help that can point me in the right direction.

To recap:

1. Is the cause of my slower LED blinking the fact I haven't removed said compile flags?
2. How can I remove these compile flags in nRF connect for vscode?

Parents Reply Children
  • Hi,

    mmdunc said:
    I'll look into making / getting a proper DTS file for my board and report back if that solves the slower LED blinking issue.

    Ok, but to be honest I find it a bit surprising that the same fw would result in slower LED blinking on the nRF52810. Have you double checked that the fw is the same?

    regards

    Jared 

  • The firmware is nearly identical, I just change led0 GPIO pin from the default (17) on nRF52832 (nRF-dk) to pin #14 on nRF52810 using a board overlay file:

    &led0{
        gpios = < &gpio0 14 GPIO_ACTIVE_HIGH >;
    };

  • Hi,

    I can't see how that would result in a lower blinking frequency. Have you tried measuring directly on the pin? Do you have a logical analyzer or a oscilloscope that you can use to verify that the LED is actually blinking slower? Do you see the same if you change the pin to for example pin 10? 

    regards

    Jared

  • Hi,

    I changed the pin to #17 and could observe the exact same behavior: with 1000ms setting between toggles, the LED actually toggles every 32ish seconds. I was able to verify with an oscilloscope that this is just the pin turning toggling once every 32 seconds (no PWM going on here). By extension, if I lower the time between toggles to 32ms, the LED now turns on/off about every second. Either way, there seems to be this factor of ~30 introduced in the blinking time.

    Something that intrigues me is that the "DEVELOP_IN_NRF52832" flag comes up as an intellisense suggestion in nRF connect Vscode, but unfortunately the "right click -> go to definition" doesn't bring me anywhere.
    Similarly, "NRFX_COREDEP_DELAY_US_LOOP_CYCLES" also comes up as an intellisense suggestion, and using "right click -> go to definition" brings me to "v2.1.0\modules\hal\nordic\nrfx\soc\nrfx_coredep.h".

    I guess I'm wondering what exactly did these flags do in the nRF52 SDK, and is there not an equivalent that needs to be done in nRF connect SDK to get the emulated project to run on native nRF52810?

  • If you're using nRF Connect SDK then you need to make a DTS file for your custom board. You can use the nrf52dk_nrf52810 board as a starting point. 

    Another update on this front, I confirmed with BL651 manufacturer that the module is functionally identical to the bare nRF52810 in terms of programming, and that the nrf52dk_nrf52810 board should be fine to use as is to program the chip. I think it's therefore unlikely the cause of the slower blinking LED is related to an incorrect .dts file.

Related