Attached is micropython firmware for the nRF52840

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
User avatar
devnull
Posts: 337
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Attached is micropython firmware for the nRF52840

Post by devnull » Fri Oct 26, 2018 10:04 am

Code: Select all

IMHO, setting up the toolchain and other programs to do the build is non-trivial,
Can you clarify this, I already have a build environment for esp32, esp8266 and stm32, so I added the nrf, but I did not need to install any additional toolchains for the NRF ??

The build was successful, but I have not yet attempted to flash it to the device, as I am using your firmware and don't want to break my working device until I am sure I have not missed anything.

I will also need to create a new board definition as this device is a 'basic board' with no LEDs etc etc.

User avatar
WhiteHare
Posts: 129
Joined: Thu Oct 04, 2018 4:00 am

Re: Attached is micropython firmware for the nRF52840

Post by WhiteHare » Fri Oct 26, 2018 1:01 pm

Since you are able to do the build, just proceed as you would normally.
Last edited by WhiteHare on Fri Oct 26, 2018 1:15 pm, edited 1 time in total.

User avatar
devnull
Posts: 337
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Attached is micropython firmware for the nRF52840

Post by devnull » Fri Oct 26, 2018 1:12 pm

Thanks, all I am really trying to determine is whether I need anything else other than the micropython toolchains ?

I have not tried to flash my build yet (with frozen modules) as while I have it working I would rather not break it :-)

User avatar
WhiteHare
Posts: 129
Joined: Thu Oct 04, 2018 4:00 am

Re: Attached is micropython firmware for the nRF52840

Post by WhiteHare » Fri Oct 26, 2018 1:17 pm

Since you are able to do the build, there's nothing extra that I'm aware of.

User avatar
devnull
Posts: 337
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Attached is micropython firmware for the nRF52840

Post by devnull » Fri Oct 26, 2018 1:28 pm

OK, what about enabling bluetooth, I see there is a bash script file to download the stack, but how do I flash this to the device

PS: Thanks so much for your help !

User avatar
WhiteHare
Posts: 129
Joined: Thu Oct 04, 2018 4:00 am

Re: Attached is micropython firmware for the nRF52840

Post by WhiteHare » Fri Oct 26, 2018 1:50 pm

If you read the github post under ports/nrf carefully, you'll notice that it says that if you tack on an "sd" at the end of the make incantation, then the make will include bluetooth, provided that you also set the configuration file flags correctly. So, I'd recommend a careful reading of that, plus there's also a recent thread I had with Glenn Rub (the author of it all) talking about how to get WebBluetooth working, and there's more info in that if you need it. It's very impressive what Glenn Rub has accomplished.

User avatar
devnull
Posts: 337
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Attached is micropython firmware for the nRF52840

Post by devnull » Fri Oct 26, 2018 2:29 pm

Yes, read that, but that is all based on using the Segger for flashing, whereas I am building and then using openOcd to flash using ST-LINK Jtag Programmer.

The text appears to say that make will first upload the bluetooth stack (using Segger) and then upload the firmware, however I am using openOcd flash command which is not integrated with the micropython build and is run separately.
The make sd will trigger a flash of the bluetooth stack before that application is flashed. Note that make sd will perform a full erase of the chip, which could cause 3rd party bootloaders to also be wiped.
Unless I misunderstand, it looks like adding sd to the build command will automatically invoke the Segger programmer and upload the bluetooth stack ?!

So I don't see how I can do this using openOcd, although it succeeds in uploading the firmware which you built !

User avatar
WhiteHare
Posts: 129
Joined: Thu Oct 04, 2018 4:00 am

Re: Attached is micropython firmware for the nRF52840

Post by WhiteHare » Fri Oct 26, 2018 2:59 pm

There's a bona fide Segger built into the nRF52840-DK, so the DK is a pretty good value when you consider that a standalone Segger costs much much more. Like I mentioned, the DK's Segger can be used for programming external nRF52840 modules like your HolyIOT. It's not limited to programming only the nRF52840 that's on the DK itself. You can also use it to program external nRF52832's and nRF51's.

User avatar
devnull
Posts: 337
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Attached is micropython firmware for the nRF52840

Post by devnull » Fri Oct 26, 2018 3:08 pm

There has to be a way of using openOcd to do this, I really don't want to have to order another board and wait another 2 - 3 weeks for it to arrive, given that I have already succeeded in flashing the device using openOcd and StLink.

Surely a separate file can be generated and uploaded manually as opposed to the way it's done automatically using the build command ?

User avatar
devnull
Posts: 337
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Attached is micropython firmware for the nRF52840

Post by devnull » Sat Oct 27, 2018 6:25 am

OK, confirmed that you can generate the file without having to use Segger.

This will generate the bluetooth stack file:

Code: Select all

make SD=132
Whereas this will generate it and also upload the file via nrfjprog (Segger):

Code: Select all

make SD=132 sd

Post Reply