Making a bluetooth split keyboard (part 1)

It’s been a while since I last posted something remotely technical so I thought this would do this entry

All the work is based on the Lily58 split keyboard, we will be using the nRFmicro board, which in turn will be the brain of each keyboard half

The first step was to make the nRFmicro board using the soldering guide in the repo, needless to say the process was complicated but a very good excuse to use my new Pinecil

nRFmicro before

nRFmicro after

The plan is to use the ZMK firmware but to do so, flashing the board is necessary, so far I’ve looked at 2 different approaches:

nRF Command Line Tools in Linux

This is the process that was needed to use a nRF52DK as a debugger/programmer (it has a J-Link OB, which is why it can be used to program or debug other boards ) to flash a bootloader on the nRFmicro

According to official documentation and this devZone post it is possible to use P20 or P19 to connect external boards (needs shorting solder bridge SB47)

I’m using P20 according to the following diagram (minus the GND DETECT connection):

nRF52DK as debugger

Once the connections are sorted out the first step of the process is downloading and installing nRF Command Line Tools

Following the link provided will point to a downloads page, since I use Manjaro, I had to download the corresponding linux zip file and uncompress it, I also uncompressed the tar files within the root directory (Debian based distro users can just use the .deb packages):

.
├── nRF-Command-Line-Tools_10_12_2_Linux-amd64
│   ├── JLink_Linux_V688a_x86_64.deb
│   ├── JLink_Linux_V688a_x86_64.tgz
│   ├── mergehex
│   ├── nRF-Command-Line-Tools_10_12_2_Linux-amd64.deb
│   ├── nRF-Command-Line-Tools_10_12_2.tar
│   ├── nrfjprog
│   └── README.txt
├── nRF-Command-Line-Tools_10_12_2_Linux-amd64.tar.gz
├── pynrfjprog-10.12.2.zip
└── ReadMe.txt

According to the README, directories mergehex and nrfjprog need to be copied to the /opt directory:

  • copy directories to /opt
sudo cp -r <path_to_download>/nRF-Command-Line-Tools_10_12_2_Linux-amd64/nRF-Command-Line-Tools_10_12_2_Linux-amd64/nrfjprog /opt/
sudo cp -r <path_to_download>/nRF-Command-Line-Tools_10_12_2_Linux-amd64/nRF-Command-Line-Tools_10_12_2_Linux-amd64/mergehex /opt/
  • Make symbolic link for nrfjprog in /usr/local/bin
sudo ln -s /opt/nrfjprog/nrfjprog /usr/local/bin/nrfjprog
  • Make symbolic link for mergehex in /usr/local/bin
sudo ln -s /opt/mergehex/mergehex /usr/local/bin/mergehex

nRF command line tools expects the Jlink files to be installed under /opt/SEGGER/JLink, otherwise errors about JLink DLL not found pop up in the terminal, I followed the guide at Eclipse embed CDT:

sudo mkdir -p ~/opt/SEGGER
cd ~/opt/SEGGER
sudo tar xf /<path_to_download>/nRF-Command-Line-Tools_10_12_2_Linux-amd64/JLink_Linux_V688a_x86_64.tgz
chmod a-w ~/opt/SEGGER/JLink_Linux_V688a_x86_64
mv JLink_Linux_V688a_x86_64 JLink

Also an important part of this is to copy the device rules

sudo cp ~/opt/SEGGER/JLink/99-jlink.rules /etc/udev/rules.d

Funnily enough I think the installation was successful but I couldn’t flash the nRFmicro board, still debugging why …

Creating a Black Magic Probe using a STM32 Blue Pill board

As an alternative I tried to follow a tutorial to create another programmer/debugger

I installed stm32flasher from AUR

yay -S stmflasher

And then followed the instructions but I have run into trouble with either my FTDIRS232 module or the Blue pill not responding UART requests in bootloader mode… a bit frustrating and also, still debugging…


Day 10 of my 2021’s

Join 100DaysToOffload!

By lopeztel

Mexican, wannabe maker and overall linux distro enthusiast. I enjoy playing around with electronics, running, painting and reading. I started blogging as therapy and got more invested recently.

7 comments

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.