Raspi 3B V1.2 as bootloader installer for nrf52840

September 29, 2023, 20:31

suzu9521

Good day; i want to use my raspi to install a bootloader on a board with a holyiot 18010 nrf52840 as the controller however im completely inept when it comes to programming, so i dont know what i have to do ive been sent this github link by someone, they dont have the time to walk me through that however, and i dont know what to even do as i have no prior experience with programming a raspi or anything https://github.com/joric/nrfmicro/wiki/Bootloader#flashing-the-nrf52s-bootloader-using-raspberry-pis-gpio-and-openocd i havent used the raspi before for anything, so its just as out of the box as it gets if someone would be willing to walk me through this thatd be nice also, feel free to ping me so i can answer quickly^^

oops.se

Follow the guide in the URL. Copy and past the lines with "greyish" background into a terminal window. Example: sudo apt update and the press enter

oops.se

and then continue with:
sudo apt install git autoconf libtool make pkg-config libusb-1.0-0 libusb-1.0-0-dev telnet

oops.se

You need to study a beginners/get started guide. And the Raspberry Pi isn't going to show up in your device manager (unless you configure it ala "USB Gadget"). So hock up a keyboard, mouse and display to your Raspberry Pi and use it as a computer.

suzu9521

thanks πŸ‘

suzu9521

hm, maybe all is set already? πŸ€” theres a couple lines with rp3 and the line below is uncommented so this means its already set up correctly? πŸ˜… sorry for the ping tho, only noticed you were already offline after i pinged you πŸ™ˆ

suzu9521

been able to flash the bootloader onto the nrf^^

suzu9521

works differently than an arduino tho πŸ€” πŸ˜… guess ill have to live with that tho 🀷

oops.se

Nice, cudos to your!

suzu9521

yeah, main problem was that i didnt know i needed to connect it like a pc, install pi os on an sd card and would find the terminal in the os when connected to a monitor

oops.se

Well, then I guess my recommendation hit the target with 100% accuracy πŸ˜‰

oops.se

Humble me....

oops.se

Arduino distributes compiled versions of Raspberry Pi's "elf2uf2" tool along with the installation of the "Arduino Mbed OS RP2040 Boards" platform, and the 3rd party "Raspberry Pi RP2040 Boards" platform 58 does the same. So if you have installed either of those via the Arduino IDE Boards Manager, you already have the tool on your computer. You can also get the compiled tool from Arduino directly from the download links under the "Assets" section of each release page here: https://github.com/arduino/rp2040tools/releases/latest Or the same here for the earlephilhower 20 version here: https://github.com/earlephilhower/pico-quick-toolchain/releases/latest Of course, this tool uses the .elf file, not the .bin. The Arduino IDE 2.x Sketch > Export Compiled Binary feature (as well as arduino-cli compile --export-binaries 8) also save the .elf file to the build/arduino.mbed_rp2040.pico subfolder of the sketch folder.

oops.se

I haven't tried it myself as I uses Python (Thony) on my Picos and Arduino IDE on my ESP32/8266s

suzu9521

(the readme definitely flies way above my head)

suzu9521

hm, not sure how the blog should help me there either πŸ˜… either im missing a part, or the blog doesnt explain how to use the uf2 and just explains what it is πŸ€” πŸ˜…

suzu9521

i need something with an exe and a big ui button πŸ™ˆ

oops.se

1. Select the Pico as your board 2. Write your program in Arduino IDE 2.x 3. Save your sketch 4. Compile it: Sketch > Export Compiled Binary 5. Have a look in your sketch folder πŸ™‚

oops.se

Tested with Arduino IDE 2.2.1 just now, But I havent tried to upload the uf2 file...

oops.se

Have you installed Pico hardware support in Arduino IDE ?

oops.se

Upgrade Arduino IDE to the latest 2.2.1

suzu9521

~ installing

suzu9521

~ restarting pc i guess πŸ€”

oops.se

Yes

suzu9521

hm, well thats odd i cant seem to start the 2.2.1 ide πŸ€”

suzu9521

ill do a quick reinstall see if that helps

suzu9521

i am really confused rn i cant seem to run the 2.2.1 πŸ€”

suzu9521

i redownloaded the install file for w10 64b, installed that as admin, didnt run the ide, but restarted my pc, then tried to run the ide as admin only thing that happened (once) was my tertiary monitor going black for a second, nothing else

suzu9521

interesting, i need to start it in compatibility with w8 πŸ€”

suzu9521

it also seems that there is a slight different between the files still πŸ€” the one on the nrf52840 (CURRENT.UF2) has the uf2 in capital letters, while the one from the arduino ide is in lower case πŸ€”

suzu9521

if i download the CURRENT.UF2, rename it to ServoSweep.uf2 and drop it onto the nrf, it immediately disconnect so there has to still be something thats different about the uf2 files πŸ€”

suzu9521

hm, neither nrf primo outputs a UF2 file, wouldve thought those would

suzu9521

https://github.com/adafruit/Adafruit_nRF52_Bootloader hm according to this, i might need to change the memory location πŸ€” but how to do that if i wanna create the uf2 directly πŸ€”πŸ˜…

oops.se

But nrf52840 isn't a Pico?! Or is it Pico compatible?

oops.se

You cant chose a Pico in Arduino IDE and compile it for a nrf.

suzu9521

makes sense yeah, was just following your recommendation there thought uf2 is fully standardized(or standardized enough) to be interchangeable ive tried with the pimori, but that doesnt output uf2 files when compiled

suzu9521

neither does the nano ble

oops.se

I have worked with Nordic Radio like 10 years ago, but they where to looked in...

oops.se

So if your gona use Arduino IDE you need hardware support for the nrf52840 and install it

oops.se

This is OLD and I don't know if it works, probably not: https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/arduino-bsp-setup

oops.se

Noop, I got 404 when trying to add it

oops.se

Ahh I think I got it. Open "Board manager" and search for nrf52,

suzu9521

the first one i installed, guess the second one didnt show up in the 203 ide i had before(or didnt notice it)

suzu9521

can try when i get back tho see if any of those output uf2 files

oops.se

It compiles but don't create uf2, but elf and bin. And the commandline tool should be able to produce uf2. uf2 is just a packaging format kind of like zip

oops.se

But Im going offline now for the day, cya

suzu9521

not sure how those are installed, but maybe you can install it on yours and send me a zip with the files? (and where to install them)

suzu9521

think i found it

suzu9521

just tried the dk; didnt get a uf2 file πŸ€” should i just try all of them? πŸ˜…

suzu9521

(with the 840 ending ofc, dont have an 832)

suzu9521

hm, none created a uf2 file πŸ˜…

suzu9521

no .bin files either