MakeCode for nRF52840?

There is currently no hardware available, other than hacking something with a bread board. When there is some hardware we can add it.

You can use this bootloader https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/boards/arcade_feather_nrf52840_express/pinconfig.c with a hacked Feather 840. Otherwise, you can build your own.

1 Like

I have a 840 board designed and my pull request for CircuitPython support was just merged. So, it will support CP officially. https://tinkeringtech.com/blog/scoutmakes-azul/ I can design some HW around this platform.

In the pinconfig.c that you referenced above has pons for Left, right, up, down, etc.
In order to test, do I just wire up the same as here https://learn.adafruit.com/makecode-arcade-with-samd51-m4/feather-m4-express ?

Do I need to build the .uf2 bootlader for the URL you referenced?

Thanks.

I tried to build the840 express .uf2 got the below error. Any ideas?
I cloned https://github.com/adafruit/Adafruit_nRF52_Bootloader/

$make BOARD=arcade_feather_nrf52840_express all

Adafruit folks provide binary builds on their github. You can use that.

You need to wire it the way it’s described in pinconfig.c, not sure if it’s the same as the M4 guide.

As for build failure, you need to do git clone --recursive at the beginning.

I managed to get it to build after your suggestion of --recursive during the clone. thank you for that.

However, I tried to flash my board by dragging over the .uf2 to the device via USB, but nothing seems to happen with the flashing of the new bootloader. Something I’m missing?
Does this new .uf2 have code to unlock, flash and relock the bootloader space?

I will test the breadboard wiring once I can successfully flash the 840 with the makecode arcade bootloader.

You can follow instructions here https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader

1 Like

ok @mmoskal . Was able to follow those instructions and got the makecade arcade .uf2 flashed on the 840.

I downloaded the jumpy platformer game from makecode beta for N4 and tried to drag over the game to the 840 while in bootloader mode, but was getting the same error @204maker reported above MakeCode for nRF52840? any thoughts on resolving this issue. Appreciate all your responses so far.

It could be the drive is unmounting itself too quickly. You should check - it may still work.

@mmoskal you are correct. Despite the error, the game runs.
The buttons don’t seem to work right still, but might be a breadboarding issue, so I will need to check.

How do we fix the file load error? Also, I’m working on hardware to support makecode arcade on the 840. How can we get the 840 platform out of experiment to supported?

I’m not a SW dev, but willing to help in any way I can.

For anyone else looking for the wiring the OLED to the 840 express, here’s the map from pinconfig.c

4, 0x18, // PIN_BTN_A = PIN_RX
5, 0xa, // PIN_BTN_B = PIN_D2
47, 0x6, // PIN_BTN_LEFT = PIN_D11
48, 0x1a, // PIN_BTN_RIGHT = PIN_D9
49, 0x1b, // PIN_BTN_UP = PIN_D10
50, 0x7, // PIN_BTN_DOWN = PIN_D6
51, 0x8, // PIN_BTN_MENU = PIN_D12

32, 0xe, // PIN_DISPLAY_SCK = PIN_SCK
34, 0xd, // PIN_DISPLAY_MOSI = PIN_MOSI
35, 0x1e, // PIN_DISPLAY_CS = PIN_A2
36, 0x1c, // PIN_DISPLAY_DC = PIN_A3
43, 0x2, // PIN_DISPLAY_RST = PIN_A4
44, 0x3, // PIN_DISPLAY_BL = PIN_A5

@mmoskal any thoughts on the above or where I could get some assistance? Thanks for all your help this far.

You can report the uf2 error at https://github.com/adafruit/Adafruit_nRF52_Bootloader

I’m back to trying nRF52840. I have a new nRF52840 Feather Express.
FTHR840BOOT

I was trying up update the existing bootloader with an ā€˜arcade bootloader’ for this board from Adafruit:

Making your own UF2

To create your own UF2 DFU update image, simply use the Python conversion script on a .bin file or .hex file, specifying the family as 0xADA52840 . If using a .bin file with the conversion script you must specify application address with the -b switch, this address depend on the SoftDevice size/version e.g S140 v6 is 0x26000

To create a UF2 image from a .bin file:

uf2conv.py firmware.bin -c -b 0x26000 -f 0xADA52840

To create a UF2 image from a .hex file:

uf2conv.py firmware.hex -c -f 0xADA52840

To create a UF2 image for bootloader from a .hex file using separated family of 0xd663823c

uf2conv.py bootloader.hex -c -f 0xd663823c

I am currently using Windows 10 trying to flash an arcade bootloader to the nRF52840 Feather express board.

Method 1:
I tried to drag and drop the converted .UF2 file to the FTHR840BOOT (E:) but it does not change anything on the bootloader. I tried renaming the .UF2 file to CURRENT.UF2 and overwrite the existing file but it does nothing on after reset.
FTHR840BOOT

What did I miss here?

Method 2:
To flash the bootloader with JLink:
make BOARD=arcade_feather_nrf52840_express flash

Using J-flash Lite with the SEGGER J-Link EDU with the hex file failed too.
J-flash lite for nrf52840

How were you able to successfully update the bootloader to use the arcade bootloader version?

The NRF52 bootloader currently can’t update itself with a UF2 file (unlike the STM32 and SAMD bootloaders), so there’s no need to convert the bootloader to UF2. You can use the Adafruit instructions as posted above:

1 Like

On Windows , download adafruit-nrfutil.exe from this link:
https://github.com/adafruit/Adafruit_nRF52_nrfutil/releases/tag/0.5.3.post13

However, the link does not contain adafruit-nrfutil.exe. I am using Windows 10 64-bit. Would you know where to find a working adafruit-nrfutil.exe for Windows?

@TinkeringTech, how did you flash the Makecode Arcade UF2 bootloader to the nRF52840?

I tried to flash the bootloader today from compiling the source on Ubuntu 16.04 LTS.

arcade_feather_nrf52840_express_bootloader-0.3.2-184-g64ea299-dirty_s140_6.1.1.zip

However, I got an error uploading a UF2 game into my arcade.
UF2 game error

What does ā€˜dirty’ mean?

Only the downloaded bootloader from Adafruit’s release worked.

https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases

arcade_feather_nrf52840_express_bootloader-0.3.2_s140_6.1.1.zip

Also, I tried to re-assign the pins form the source (pinconfig.c), recompiled then flashed the ā€˜dirty’ bootloader to the nRF840 Feather Express board successfully. When I tried to check the contents of the UF2 file using the patcher, I noticed that the contents of the CURRENT.UF2 file remains unchanged on the ARCADE-N4 drive.

No BLE extension ?