Flashing Firmware to your keyboard
nRF52832 Boards
The nRF52832 does not have on-chip USB support. As such, you need to use the on board serial adapter to connect your computer to the nRF52832 for flashing a new firmware. Depending on whether your hardware has on-board serial or not, you will need a serial USB adapter. Note that the hardware is +3.3V. As such, a standard +5V serial adapter may damage the nRF52 processor.
On reboot, the Adafruit_nRF52_Bootloader briefly listens to the serial UART for a firmware upgrade connection. Note that unlike for the nRF52840, the bootloader does not provide for a "double-reset" trigger to go (and remain) into firmware upgrade mode. Because of the very brief period in which the bootloader listens for a firmware update, it is recommended to use a controller which has the serial adapter on-board with the necessary reset circuitry installed. This circuitry connects the DTR line from the serial chip to the reset line through a capacitor. See the circuit diagram for the Adafruit Feather nrf52832 for an example of such circuitry.
Serial Upload using Arduino IDE
This step assumes you have the firmware already initialized and downloaded from the BlueMicro Builder Github actions tool. You need the entire repository and not the artifact generated by the github action.
- Start the Arduino IDE
- Open the firmware
- Select the board from the Arduino IDE "Tools -> Board" Menu
- Connect your keyboard. A new serial port should show up in the "Tools -> Port" menu.
- Select the serial port of your keyboard in the "Tools -> Port" menu.
- Compile your keyboard using the ✔️ button in the toolbar
- Flash (upload) your keyboard using the ➡️ button in the toolbar
SWD Upload
If you do not have an on-board serial adapter that triggers the reset circuitry, it may be easier to flash the nRF52832 using a SWD programmer. At this point, this upload method is not considered "easy" from a setup point of view as the methods differs between SWD programmers. You can use the hex or bin files provided as part of the github action artifact.
nRF52840 Boards
The Adafruit_nRF52_Bootloader supports both serial and UF2 flashing for nRF52840 chips.
Using UF2 Upload Method
This step assumes you have the firmware already initialized and compiled using the BlueMicro Builder Github actions tool. You just need to download the GitHub Actions artifact and uncompress the artifact zip file. It will contain the UF2 file you need.
- Have your UF2 file ready
- Connect your keyboard to your computer
- A new "drive" should show up for your keyboard
- Copy (drag/drop) the UF2 file to this drive
- Once the copy is complete, the keyboard will reset automatically. This may cause the operating system to give you a error (failed to copy) as it won't have access to the drive anymore to verify that the copy was successful. This is OK: the firmware has been flashed.
Using Serial Upload Method and Arduino Tooling
This step assumes you have the firmware already initialized and downloaded from the BlueMicro Builder Github actions tool. You need the entire repository and not the artifact generated by the github action.
- Start the Arduino IDE
- Open the firmware
- Select the board from the Arduino IDE "Tools -> Board" Menu
- Connect your keyboard. A new serial port should show up in the "Tools -> Port" menu. Note that you may need to "double-reset" your board to be able to select the correct serial port.
- Select the serial port of your keyboard in the "Tools -> Port" menu.
- Compile your keyboard using the ✔️ button in the toolbar
- Flash (upload) your keyboard using the ➡️ button in the toolbar