Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MicroPython on Bluefruit NRF52832 with J-Link and openocd #6

Open
utterances-bot opened this issue Dec 17, 2020 · 18 comments
Open

MicroPython on Bluefruit NRF52832 with J-Link and openocd #6

utterances-bot opened this issue Dec 17, 2020 · 18 comments

Comments

@utterances-bot
Copy link

MicroPython on Bluefruit NRF52832 with J-Link and openocd

Cause when you fail, somebody has to laugh at you

https://whynot.fail/notes/micropython-on-nrf52832-with-openocd/

Copy link

Excelent Material!
Just compile to NRF52832.
Plans to compile to NRF52840 ?

Copy link

i already have a ADAFRUIT BOOTLOADER.
Used to upload firmware to Adafruit Arduino. I guess that i can use the same, right ?
I asked you because i am getting this error
sboxes@osboxes:~/Adafruit_nRF52_Bootloader$ make BOARD=feather_nrf52832 all
CC dfu_ble_svc.c
In file included from src/dfu_ble_svc.c:41:
lib/sdk11/components/libraries/bootloader_dfu/dfu_ble_svc.h:39:10: fatal error: nrf.h: No such file or directory
39 | #include "nrf.h"

thanks!

Copy link
Owner

dzervas commented Dec 17, 2020

Thank you very much!

I wouldn't bother with MicroPython on the 52840 - there's already amazing support for it through CircuitPython AND ready-to-flash hex files! https://circuitpython.org/downloads

I don't know how "deep" you wanna go, but CircuitPython has support for most commercially available boards - if you're designing your own board you may need to add support for all the peripherals

duh... of course it didn't compile, as I missed a very important step:
after git clone, cd into the directory and do git submodule update --init

Also you're gonna need the intelhex python module. Either install it through your package manager (search for python-intelhex or python3-intelhex) or just install it through pip pip3 install --user intelhex.

Updating the post with the above corrections Updated!

@tcpipchip
Copy link

I dont like the circuitpython to NRF52...they are not investing in the BLE and the documentation is not good

Looks that micropython BLE is much better!

I am doing now a blog about how to compile step by step and i will post here, right ?

Thanks!!!!!

@dzervas
Copy link
Owner

dzervas commented Dec 17, 2020

Sure! Keep in mind that you can post your blog post in here with a merge request! Don't forget to add your name as author and try to conform with the style I already use (markdown can become a mess). You can use this blog post's source as a reference

@tcpipchip
Copy link

thanks! YES

Tell me about your experience with MicroPython with NRF52, did you test BLE ?

@dzervas
Copy link
Owner

dzervas commented Dec 17, 2020

At this point, I've very turned down on what software tooling we have on MCUs... And let me explain. It's MUCH better than 10 or even 5 years ago, but we're not there yet. Mini post follows 😂

I wanted to make a companion dongle for my bluetooth keyboard - like most BT keyboard do. It's needed if you want to use your keyboard before loading the bluetooth stack on your computer (e.g. to setup BIOS). My requirements to do this where extremely simple: I needed an MCU with native USB support (to act as a USB keyboard) and with BLE support (to act as a Bluetooth Central). I'd then pair my keyboard with the dongle (and NOT my computer) and I could just passthrough the received bluetooth keystrokes over USB. Without second thought, I ordered a couple of nRF52840. Simple, right? Noooooope...

I tried to do this with:

In general I'm kinda in a state that I stop fiddling with MCUs too much until Rust Embedded is mature enough. I don't want to write C any more. I fear it - let alone C++... Micro/CircuitPython is really slow for me and lacks various things (e.g. interrupts????)

@tcpipchip
Copy link

You wont believe, but i started rust study weeks ago :)

https://nina-b302-arduino-adafruit-blink.blogspot.com/2020/10/u-blox-nina-b302-e-arduino-adafruit-o.html

And RUST will be the official language to the RISC-V

@dzervas
Copy link
Owner

dzervas commented Dec 18, 2020

I really wanna fiddle with the ESP32-C3! (It's a RISC-V!)

@tcpipchip
Copy link

I really wanna fiddle with the ESP32-C3! (It's a RISC-V!)

I really wanna fiddle with the ESP32-C3! (It's a RISC-V!)

Wich tools do you use to RISC-V ?

@tcpipchip
Copy link

Simple, right? Noooooope...
Did you try zephyr ?
I love it!
I use it for ble solutions!

Copy link
Owner

dzervas commented Dec 18, 2020

Wich tools do you use to RISC-V?

Never played with a RISC-V before - hopefully a readily available debugger (SWD?) and a compiler is all we're gonna need 🙏

Did you try zephyr?

Not yet, but I probably will. I need to add support for MCP23017 to ZMK to port it for my custom keyboard (BTW post is coming about it. Schematics can be found here: github.com/dzervas/lab68 and current firmware is kmk: https://github.com/KMKfw/kmk_firmware)

Copy link

Hi, compiled to nrf52840 and working!

@tcpipchip
Copy link

I will need your help! It’s working but, why got error when import ble or music for example, no libs found 👎

@tcpipchip
Copy link

Why I ask to compile with bleupy?

@tcpipchip
Copy link

solved! Thanks!

@tcpipchip
Copy link

bluetooth_conf.h
// Default defines.

#ifndef MICROPY_PY_BLE
#define MICROPY_PY_BLE (1)//0
#endif

@tcpipchip
Copy link

@dzervas

is it possible to save the script into the NRF528XX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants