Porting espruino to a custom nrf52 device

Posted on
  • Hi all,

    I am trying to port espruino to a nrf52 based iTracker board that I recently got from RAK wireless.
    The setup of the board is very similar to the Puckjs board and p0.28 and p0.29 are the rx/tx pins. So i tried building the firmware for the board.

    However once I have built the firmware (bootloader included) and flashed the device using nrfjprog, I am able to see the device correctly on my android device (I am using nrf connect app) and also able to see the nordic BLE UART service + characteristics, but I am not able to get the Espruino Serial output on this UART service.

    I also tried connecting the NRF UART app on android to the iTracker board but still not able to see the REPL interface

    So after snooping around, In the PUCKJS board py file, i was able to see a comment like so:

    'D28' : "If pulled up to 1 on startup, D28 and D29 become Serial1",

    Do I need to pull D28 to a HIGH (+3.3v) to enable the Serial port ?

    Please let me know if I am missing something here.
    I also plan to dedicate some of my time to add support for this board into the Espruino mainline. Is there a way I can do so by sending PR for the board after the necessary changes to include a BOARDS.py file. I just want to give back to the awesome open source community behind Espruino.

    Naresh K

  • i tried connecting to the Espruino using the Espruino command line on my raspberry pi and here is the output

    pi@ttn-gateway:~ $ espruino --list

    Espruino Command-line Tool 0.0.36

    pi@ttn-gateway:~ $ espruino -p /dev/ttyAMA0

    Espruino Command-line Tool 0.0.36

    Connecting to '/dev/ttyAMA0'
    No result found - just got ""

    Not sure why i am getting the " just got "" " line
    ideally it should shows the REPL-like interface right ??

  • Hi All

    I was able to get the Espruino IDE working from an android mobile (samung s7) and was able to see the repl interface come up correctly on to the console on the left.

    TO debug what was wrong from the PC side, I tried runing a couple of Google Web Bluetooth demos (https://googlechrome.github.io/samples/w­eb-bluetooth/) and they are able to see the device but while enumerating the characteristics, there is some issue. Maybe its my bluetooth dongle or some other isssue. Will keep this port updated as i progress. Maybe it can serve as a learning for other devs.

    I will start adding the pin defintion and related jswrap files for the itracker to enable the use of the NBIoT module and the GPS module on it. Then proceed to add the various sensors as well. Hopefully will be able to get a new board support into Espruino.

  • Hi @narioinc89, any news about your progress? Do you use the RAK2011-NB?

  • Hi @Spocki
    I was able to get a majority of the stuff on the itracker board working on espruino:

    However the drivers were written in C. I had a word Gordon and had him review the code. He suggests that having javascript based drivers is a more optimal solution as that will allow the drivers to be reused for other boards as well.

    However if you like, you could go through the C code in the branch :) i am not a Javascript geek so i had to make do with this. As for the serial connection with the GPS and GSM, you can use the Serial UART javascript API.

    i have an mbed port as well that you can find in the mbed code reporsitory. just search for itracker

  • There's some really good news here - RAK Wireless want to get an 'official' build going. I'm just waiting for some boards from them to arrive (it's been a few weeks now), but when I get them and can get it sorted there'll be proper hex files and instructions available.

  • That is great news @Gordon !!!

    An official port would be a great addon for the board. the onboard GSM and GPS also add some many possibilities :)

    i have the JS driver for two of the onboard sensors. Maybe ill cleanup the code (as we had discussed earlier on some of the best practices) and send them in for you review.

  • That'd be great, thanks!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Porting espruino to a custom nrf52 device

Posted by Avatar for narioinc89 @narioinc89