Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I'm asking for help:
Can someone share his procedure to put Micropython onto the (ItsyBitsy) nRF52840?
I'm assuming that the firmware of the Feather nRF52840 Express should work as it is the same processor (and bootloader).
However at our download page there are only .bin and .hex files.
I managed to convert the .hex file with
uf2conv.py -c -f 0xADA52840 -b 0x27000 -o feather.uf2 FEATHER52-20240117-v1.23.0-preview.47.g16c6bc47c.hex
which reports:

Converted to uf2, output size: 371712, start address: 0x0
Wrote 371712 bytes to feather.uf2

The resulting .uf2 put onto the NRF52BOOT drive should install, but after RESET I cannot communicate to the Board, there is no ttyACM0 or similar.

With another board ( SEEED XIAO nRF52840 Sense ) there are installation instructions and they tell that after using
uf2conv.py -c -f 0xADA52840 -o firmware.uf2 firmware.hex it must report the start address as 0x27000.
Which is not the case here.
Could that be the culprit? How can I change the start address then?
Or are there other reasons?

You must be logged in to vote

Replies: 4 comments · 14 replies

Comment options

The board definitinon named FEATHER52 and labeled as “Feather nRF52840 Express” in board.json is actually for an nRF52832, so I’m not sure if it would run on an ItsyBitsy nRF52840 (or even on the Feather).

What I did is make my own board definition for the ItsyBitsy nRF52840. I have a couple of pending pull requests for nRF, at least #13071 is needed to use that board definition. I have built working UF2 firmware from that. I suppose I could build you one of the specific version you want, if you are not set up to build it yourself.

You must be logged in to vote
0 replies
Comment options

@rkompass The location of the firmware depends on the softdevice version which is being used. And the firmware has to be built accordingly. The load address can be 0x26000 (SD 6.0.1), 0x27000 (SD 7.x).

You must be logged in to vote
0 replies
Comment options

Thank you both. I had a look at the build instructions: There is the Bluetooth Stack (SD) and that is not the soft device, is it?

The location of the firmware depends on the softdevice version which is being used. And the firmware has to be built accordingly.

I assume that the bootloader.ld address has to match the definitions in mpconfigport.mk? And trust in that you configured it right @cwalther . I will try to build it later.

Do you have experience with the BOSSA flash programming utility ? That would allow flashing the bin file without conversion to .uf2.

You must be logged in to vote
9 replies
@andrewleech
Comment options

andrewleech Jan 23, 2024
Collaborator Sponsor

@cwalther I'm not sure if hid requires different descriptors or something that might not be easily supported? You would probably find it easier to use my nimble support branch and then use aioble?

@cwalther
Comment options

I need to read up on this more thoroughly, but https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/ seems to suggest that HID requires L2CAP, of which I see no mention in ubluepy (in contrast to the bluetooth module). But now I’m confused whether that specification is about BLE at all, or Bluetooth Classic.

At any rate, if your branch is complete enough for that, I’ll give it a try!

@rkompass
Comment options

@andrewleech This sounds like your branch allows for using aioble already?
That's exciting. I saw that Circuitpython pulled your branch in.
All I want is to have a similar experience like on the other MP boards that support Bluetooth.
As I'm learning all this freshly I'm not interested in a lot of different APIs, of course.

How much work is to be done in your branch yet? Can someone not acquainted with Bluetooth yet help?

@andrewleech
Comment options

andrewleech Jan 24, 2024
Collaborator Sponsor

I rebased my branch last night, it was a fair bit harder than I expected there's been a reasonable amount of change to the nrf port in the last couple of years.

I've done just a basic test of the aioble temp_sensor example and that worked on my 52840 dongle, not sure if I've got any of the older / smaller chips around still to test on.

I'll need to re-run the multitests at some stage...

@rkompass
Comment options

I have to confess I'm a Github layman still, unfortunately.
Can someone (of you?) combine the timer/RTC PRs and your last branch (of @andrewleech).
So I can clone this and compile?
I might try to run the multitests perhaps (if they are not too complicated).

Comment options

Thanks to your help I have a little more insight now.
I could compile the firmware copying your (@cwalther) board definitions into the ports/nrf/boards folder.
Then I converted the firmware.hex with uf2conv.py firmware.hex -c -f 0xADA52840.
The start address reported is 0x26000 which seems good.

Now I'm stuck with an old or perhaps wrong? bootloader apparently.
The INFO_UF2.TXT contains:

UF2 Bootloader 0.5.0 lib/nrfx (v2.0.0) lib/tinyusb (0.9.0-22-g7cdeed54) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Nordic nRF52840 Dongle
Board-ID: nRF52840-pca10059-v1
SoftDevice: S140 version 6.1.1
Date: Apr  4 2021

which is a little progress after I put a converted to .uf2 https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/download/0.8.2/itsybitsy_nrf52840_express_bootloader-0.8.2_s140_6.1.1.hex onto the boot drive.
Before that it told SoftDevice: none

Still the bootloader is version 0.5 and this version does not allow to flash big firmwares as needed.
Trying to update the bootloader with update-itsybitsy_nrf52840_express_bootloader-0.8.2_nosd.uf2 from the adafruit github
does not change it, apparently.

Could it be that I have a completely wrong bootloader (thinking to be a Nordic nRF52840 Dongle, see the above file content), that refuses to flash a firmware for another board?

Also I'm confused: Apparently the bootloader was not updated by the itsybitsy_nrf52840_express_bootloader-0.8.2_s140_6.1.1.uf2 yet the SoftDevice was?

You must be logged in to vote
5 replies
@rkompass
Comment options

Update: I see now the compilation was o.k.. because I could flash my firmware onto a second board:

MicroPython v1.23.0-preview.56.gf7f53f2b9.dirty on 2024-01-23; Adafruit ItsyBitsy nRF52840 Express with NRF52840
Type "help()" for more information.

but on that board was this bootloader:

UF2 Bootloader 0.7.0 lib/nrfx (v2.0.0) lib/tinyusb (0.12.0-145-g9775e7691) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Adafruit ItsyBitsy nRF52840 Express
Board-ID: nRF52840-ItsyBitsy-revA
Date: Jul 13 2022
SoftDevice: S140 6.1.1

So this is at least partial success. I shall incorporate you pull requests @cwalther :-)

And now only this question remains: How do I get the right bootloader on my first board?
Thank you all for your help, btw.

Raul

@robert-hh
Comment options

When I wrecked the bootloader one on a Seeed device, I could restore it with my jlink adapter. You "just" need the hex file with the S140 6.1.1 soft device. Maybe you can copy it from the working board. Just get the address range up to 0x26000.

@rkompass
Comment options

Thank you robert.
I just now found:
adafruit-nrfutil --verbose dfu serial --package itsybitsy_nrf52840_express_bootloader-0.8.2_s140_6.1.1.zip -p /dev/ttyACM0 -b 115200 --singlebank --touch 1200 and the bootloader got updated.
I could flash my firmware afterwards.

@cwalther
Comment options

Good to hear that you got it sorted out. FWIW, on my board I have the same 0.7.0 as on your second one, and I had installed that using update-itsybitsy_nrf52840_express_bootloader-0.7.0_nosd.uf2. (I’m not sure why I hadn’t downloaded 0.8.x, maybe I just followed the link from the CircuitPython download page.)

@rkompass
Comment options

It seems the serial update with adafruit-nrfutil is more universal in that you may flash a bootloader that is even for another board, so I needed that.

Just noticed there is no machine.freq().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🔌
nRF
Labels
None yet
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.