-
• #2
Tue 2021.05.25
'but I'm a little at a loss when it comes to setting up toolchains'
Hi @DanTheMan827 this exact question was asked a week ago and many links resulted.
For your perusal:
http://forum.espruino.com/conversations/363762/#comment15992393
-
• #3
That's more about writing extensions to the espruino firmware and building that, it doesn't really talk about how you'd go about taking a brand new main.cpp file and end up with a .bin file you can flash over DFU mode to the puck.js
-
• #4
Hi,
I'm afraid there isn't anything specifically about this. The chip and bootloader are pretty much standard nRF52832 though, so you could use all of Nordic's tools, documentation and SDK (we use SDK 12) for development.
However developing software while upgrading via DFU is a slow, painful process and is really not something I would encourage anyone to do.
The best bet would be to buy an nRF52832 DK board (about $40 I think?) and wire up GND, SWDCLK and SWDIO pins, then treat the Puck like any other Nordic device (and follow Nordic's tutorials and code).
When you want to return to normal you can then just reflash a full hex file of Puck.js to ensure everything is returned to standard.
-
• #5
A repo with a couple examples in C++ that builds a firmware bin for the puck.js that could be flashed over DFU would be quite helpful.
Just get nordic SDK https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v12.x.x/ and arm gcc toolchain https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads , setup SDK to point to your gcc folder (e.g. in
components/toolchain/gcc/Makefile.posix
) and run 'make' in any example inside SDK and you get the binary.True that there could be some easy example and board file for Puck with pins/leds etc so you could just copy it to the sdk structure. However to get more into it you need to read lot of 52832 and SDK documentation anyway
https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/nrf52832.html?cp=4_2
https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/index.html?cp=7_5_9And once you do, you won't need the example anymore :-)
For searching for issues or help you can use https://devzone.nordicsemi.com/
There is also nordic supported segger studio https://www.nordicsemi.com/Software-and-tools/Development-Tools/Segger-Embedded-Studio but example project files for it are only in newest SDKs, definitely not SDK12
As for boards for development - anything with SWD pins accessible is good enough including http://www.espruino.com/Puck.js#pinout . On aliexpress bare nrf52832 board with swd debugger is below $10 total.
Also there is Arduino for nrf52, one older based on SDK11 https://github.com/sandeepmistry/arduino-nRF5 and Adafruit one based on SDK15(?) https://github.com/adafruit/Adafruit_nRF52_Arduino - both would need changing softdevice and bootloader in you Puck
-
• #6
I recently was working on a project for the puckjs using platformio and zephyr. These zephyr configs helped me:
# Puckjs CONFIG_GPIO_AS_PINRESET=n CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y CONFIG_STDOUT_CONSOLE=n CONFIG_SERIAL=n # Debugging CONFIG_NO_OPTIMIZATIONS=y
I'd like to dive into writing some native firmware for the puck.js but I've only ever messed around with devices that supported the Arduino IDE.
I'm not a stranger to coding in C++, but I'm a little at a loss when it comes to setting up toolchains for embedded stuff like this.
I've tried looking at the espruino repository, but that supports so many different boards that it's a little difficult to figure out what build process is for what board.
What I definitely don't want to happen is me somehow managing to bork the bootloader and have a puck that I can't flash (if that's even possible)
A repo with a couple examples in C++ that builds a firmware bin for the puck.js that could be flashed over DFU would be quite helpful.