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

Running Zephyr on HolyIOT nRF52840 does not work (Solved)

Hi,

I recently bought a couple of HolyIOT nRF52840 modules for a personal project (building a keyboard). I also got a JLink Edu Mini to flash/debug it. I am able to successfully run the sample programs (Blinky, TWI, USB mass storage and USB BLE Uart) using the Segger Embedded Studio, if I choose the board as PCA10059. I am also able to run programs on it with the Arduino library using PlatformIO.

Documentation is very lacking about the device. Nothing about the components on it. The only useful information in the datasheet is the pinout.http://www.holyiot.com/eacp_view.asp?id=278

I am hoping to run ZMK on it. ZMK runs on Zephyr. I have so far been unsuccessful to get the board to do anything when I try any of the sample applications (beacon, USB mass storage, blinky). Now only GPIO is not working. Bluetooth and USB works.

I followed this blog post https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf5x-support-within-the-zephyr-project-rtos and I have been able to set up the SDK and other stuff. I have added this configuration to the boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig file.

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_250PPM=y

I am able to successfully build the applications and flash them using the commands

west build -p auto -b nrf52840dongle_nrf52840 samples/subsys/usb/hid
west flash

The board folder:

7711.nrf52840dongle_nrf52840.zip

Other relevant info:

Zephyr version: 2.5.99 
west version: 0.9.0
Toolchain version: Zephyr 0.12.2

Is it possible to get Zephyr working on this board? Has anyone ever done it? I would be very grateful for any help that is provided, as getting Zephyr working would save me a whole bunch of time.(Bluetooth and USB is working now. Some samples don't work, but most seem to.)

Thanks a lot in advance.

Any alternatives you can advice to accomplish my goal (building a simple keyboard that can switch between USB and Bluetooth) would also be welcome. I have spent too many weekends and nights on this already. :D (QMK doesn't support this chip either)

Note: My day job is a software developer and this is my first microcontroller project ever. So I could be missing something very obvious, so please bear with me. And apologies if I did actually miss something obvious. I also do not have a development board as I could not think of a way to reuse that in any project and it costs twice the base price in my country (and 5x the cost of a HolyIOT board).

  • I have no idea what got it working, but Bluetooth and USB now works. The device requires me to reset it (turn off the power, wait for a couple of seconds, turn it back on). So, in case anyone needs a confirmation whether the HolyIOT 18010 works with Zephyr, it does, with the board files I attached.

    I still haven't figured out how to get GPIO working, but it is still some progress.

  • Further testing shows that it is not necessary to add these lines to the nrf52840dongle_nrf52840_defconfig file for this module:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_250PPM=y

    I guess there is an external oscillator provided on the board. Or it manages fine without it.

    (And sorry about so many edits and replies. I am hoping this would provide as a reference to someone who might need it.)

  • Looks like it was a combination of my rat's nest of a build environment, the need to reset the device after every flash and me editing the wrong configuration files that got me into this mess. GPIO works fine now. Some code is behaving oddly, but I guess that is for another day and another topic.

    For now, all LEDs are blinking. Slight smile

    My apologies and thanks to whoever spent time reading through the post.

    For anyone in a similar muddle, the nrf52840dongle_nrf52840_defconfig board file works fine for the HolyIOT 18010 module. 10059 board works fine in the Segger Embedded Studio samples. Cheers!

  • This probably sounds silly, but I have a guess about how the board suddenly started working. I installed zmk and initialized it. It pulled another copy of zephyr and set the environment to that. Once again everything stopped working and the board did not respond.

    Then I erased everything using nRF Connect, flashed SoftDevice 140 (7.2.0) to it, reset it. Then I again flashed the sample hex file I had built previously and it started working like magic. Just erasing all did not help, I had to flash SoftDevice. Even now I am not clear why that worked, but it did. Blinky has started blinking again! Man dancing tone3

Related