Getting the nrfmicro to work
Soldering the hardware
I started with the bottom of the board in this order:
- 2× 1K resistors
- 10K resistor
- 4.7K resistor
- 2× 100K resistors
- 3× 10uF capacitors
Then I did the top:
- Red LED
- Blue LED
- 2× 5.1K resistors
- Place kapton tape under USB-C connector
- USB-C connector
Then I tinned the underside pads of the module.
I placed the module on top of the pads and soldered the bottom-left pad. I flipped the board and reflowed the bottom pads that connect to the inner pre-tinned pads on the module. Then I moved on to the top goldfingers.
I bridged the eight solder pads near the USB port. I did only the top side. I think this changes depending on how you mount it for the split keyboards you'd be making.
I flipped the board again and added the on-off switch as well as adding solder to the USB-C ground mounting points.
After plugging the board in with USB, the red LED was blinking because the switch was in the off position. Switching it on made it solid. The blue LED was not working. I may have flipped the LED around the wrong way.
I probed VCC and RAW and it gave me 3.31V and 4.29V respsectively. I believe this means the charging circuit works.
I soldered male header pins to VCC, RST, GND, SWD, and SWC.
Unlocking the NRF52 module
I connected the CMSIS-DAP adapter to the nrfmicro with the following connections:
I downloaded the latest OpenOCD from here (Version 20191024 as of this writing) and extracted it to somewhere. I added the
bin folder the my PATH for my convenience.
openocd -f interface/cmsis-dap.cfg -f target/nrf52.cfg
I used PuTTY for my telnet connection, and connected to
nrf52.dap apreg 1 0x04 gives the status for whether the module is unlocked. 0 means locked.
nrf52.dap apreg 1 0x04 0x01 should unlock it. Here, I've done it already so it did a
clearing lockup after double fault and reset, I think. Checking with
nrf52.dap apreg 1 0x04 should return a 1 now.
Flashing the bootloader
I downloaded the Adafruit bootloader (
pca10056_bootloader-0.2.11_s140_6.1.1.hex) to my Desktop.
I connected the pure unmodified ST-Link to the nrfmicro with the same connections. I ran
openocd -f interface/stlink-v2.cfg -f target/nrf52.cfg just to see if it won't fail.
I exited and set my current directory to where the hex file resides and ran:
openocd -f interface/stlink-v2.cfg -f target/nrf52.cfg -c init -c "reset halt" -c "flash write_image erase pca10056_bootloader-0.2.11_s140_6.1.1.hex" -c reset -c exit
Connecting the nrfmicro with the USB-C cable showed a mass storage device.
I downloaded this example firmware file from joric. I saved it to my desktop before copying it to the mass storage device. After that it reset and the other LED was blinking on my board.
I have not tested all the other GPIO pins yet.
Compiling a QMK firmware for it
I downloaded joric's fork of QMK:
git clone --recurse-modules https://github.com/joric/qmk_firmware qmk_nrf52840
I switched to the
git checkout nrf52-jorne
I downloaded the nRF5 SDK from here, version 15.0.0_a53641a, and extracted the folder to inside the QMK fork folder. (So now I have a folder named
qmk_nrf52840/nRF5_SDK_15.0.0_a53641a/). I added the folder name to
Using msys, I set the nRF SDK root with:
And then I run
make jorne_ble/master as a test.
Great. The firmware compiled.
Converting the firmware with u2fconv.py
I downloaded uf2conv.py and placed it in my
~/qmk_utils folder so I can access it anywhere in msys.
u2fconv.py .build/jorne_ble_master_default.hex -c -f 0xADA52840:
Flashing to the nrfmicro
I plugged in the nrfmicro and placed the flash.uf2 file in the mass storage device that appeared. If it doesn't appear, short RST twice within 500ms.
After the reset, the blue LED (I say blue because that's the default LED color. I lost the tiny 0603 LED so I had to replace it with whatever I had) lit up.
Opened my phone and I see this:
Initially, tapping on it to pair didn't do anything. I just disconnected and reconnected the USB cable and it successfully paired.
To fully test it out, I unpaired it from my phone and opened up my laptop with bluetooth. And I took some screenshots of the process of me connecting it up to my laptop. After unpairing it to try it again on my phone, it would not pair anymore. Apparently by default, re-pairing is not allowed.
I fixed this issue by following the modification suggested in the comment. I modified
tmk_core/protocol/nrf/sdk15/ble_master.c on line 285. I am unsure if the same has to be done for the slave side for split keyboards, since I have only one board to play around with.
It was at this point, I desoldered all the male header pins and soldered a 2-pin JST connector to RAW and GND so I can connect a li-po battery.
Shorting pin 017 and 029 should type out 'q'.
And it does! I used Switch Hitter for testing. Note at the upper middle portion, the Interface says Bluetooth. Next step should be adapting the
jorne_ble firmware files to make custom firmware fit for whatever board I'm building.