Porting Espruino to RedBear BLE Nano 2

Posted on
  • @Gordon I was backer of both projects (Puck.js and RB BLE Module Nano 2). I have both on my desk now. I would like to have Espruino on Nano 2 for HW experiments what should be easy, both have the same MCU. BUT I don't know how to put FW of Espruino to Nano 2. Please could you give me some hints how to do it. Thank you in advance for your helpfulness.

  • RedBear said in their KickStarter:

    There are existing efforts to port Espruino, a JavaScript run-time for MCU, to nRF52832, we will get involved and ensure our boards are fully compatible with the open source version for nRF52.

    So I'd bug them about it.

    They were perfectly happy to use our work on Espruino to try and sell more of their devices - I don't see why I should spend my time trying to help them out when they're not doing what they said they would on their KickStarter page.

    I know that's not good to hear for you as a backer of both, but it puts me in a difficult position.

    If they were willing to contribute back to Espruino development things might be different, but they did this on their last product too - they ported Espruino to that one and didn't contribute a single thing back - also the firmware hasn't been updated for 6 months so if you bought one of their products hoping to use Espruino on it you're basically screwed.

  • It is bad sitaution, especially for backers of both campaigns, who thought of the synergy of both. However, I understand your opinion... fully understand! I have no tools to remedy the situation just occurred to me that I could forward our communication to RedBear, if you give me permission. Can I do it?
    P.S. You are 100% right... I was also backer for their Redbear Duo.

  • I'd prefer you didn't forward it to them - I don't really want to get involved...

    This is really an issue between RedBear and their KickStarter backers :)

    To be fair, at RedBear they've been perfectly friendly to me - even gave me some Duos. The issue is they don't see why they should contribute anything back to Espruino. They don't have to at all - what they're doing is perfectly fine... It just means I have no reason to spend time helping them out :)

  • OK, I'll respect that, I'll communicate with them only for my person. First, I'll give them a little time since they fulfilled their promises from KS campaign in advance. In the meantime I would like to try to do it myself, even though I had never done it.
    I would like to ask you directly at the beginning whether I can expect any support from your side (from my side has already been demonstrated - bought 3 pcs Pico, some PCB, 2 pcs PUCKJS from KS project:-))... because the questions are sure to come. If you know that there are obstacles that are difficult for a beginner to master please tell me it now. Thanks in advance for you reply.

  • My plan was to use the Duo as a via for pucks to internet... now it's just sitting around... and I see not much activity on their side...

  • You might just be able to upload the NRF52832DK image from here and have it work.

    It'd expect there to be a UART (TX on pin D6, RX on pin D8), so you probably ought to wire that up to a USB-TTL converter at least at first (or tie D8 to 3.3v), but it may 'just work'. If you can use it with the standard firmware then everyone's happy :)

  • ... I mean P0_6 an P0_8 as well (not D6 and D8 - which appear to be redbear-specific, not chip-specific)

  • @Gordon Thank you for your advice but the link espruino_1v91.58_nrf52832.hex does not work. I just installed the compiler and try to build some FW... Yippee... Espruino for Linux working...

  • @Gordon Thank you for showing me the right direction!
    Success! FW for NRF52832DK has been build and is working on the serial line.... Some values has to be changed in directory BOARDS, file NRF52832DK.py... see below ... Time to go to bed now.

    info = {
     'default_console_tx' : "D29",
     'default_console_rx' : "D30",
    devices = {
      'RX_PIN_NUMBER' : { 'pin' : 'D30'},
      'TX_PIN_NUMBER' : { 'pin' : 'D29'},
      'CTS_PIN_NUMBER' : { 'pin' : 'D28'},
      'RTS_PIN_NUMBER' : { 'pin' : 'D2'},
  • Nice - I'm surprised that hex image from the repo didn't work though. Did you try without UART connected to P0_6/etc?

    Looking at this it seems Espruino checks to see if the UART is attached on all nRF52 boards, so if nothing was connected it should have just ignored it and presented itself over BLE like a Puck.

    Actually it looks like *_PIN_NUMBER aren't used either...

  • Thanks for your reply. Now I can not do any experiments, I'm at work and I have my lab at home. I did not try described possibility, I was permanently connected to the USART... moreover I did not know about this dependence. In other words ...
    IF USART_connected THEN communicate_USART ELSE communicate_BLE
    ... Am I right?

    May I have more questions?
    a/ Where can I find the rules how to describe the particular card? ...BOARD.PY
    b/ FW for PUCKJS is in zip archive... what is in the file "espruino_1v91_puckjs.dat"?

    Thanks for the additional hints ... it will be long night today :-)

  • Well, BLE will always be available, but UART is only used if it's connected since it draws a lot of power.

    Where can I find the rules how to describe the particular card? ...BOARD.PY

    You mean what's in those files? https://github.com/espruino/Espruino/blo­b/master/README_BuildProcess.md might help - but otherwise you just have to dig around I'm afraid.

    FW for PUCKJS is in zip archive... what is in the file "espruino_1v91_puckjs.dat"?

    It's all to do with the 'secure bootloader' - the zip file contains only the binary, but not the SoftDevice.

    The hex file contains everything (at least for nRF52DK) and is just a complete image of flash memory

  • @Gordon You had all the time right :-) The problems were, as usual, on 2 sides ... between keyboard and chair :-) as well as Linux Mint 18.1 has problems with bluetooth. Now work both ways ... UART line and BLE (but BLE only on my corporate notebook with W10 ...pairing without any problems). Now I am in a state which fully satisfies me, maybe later I will strive for OTA FW upgrade (as PUCKJS) but at the moment I do not need it... it takes a lot of time. Now I use DAPLink as dev tool and it is very quick, handy for development. Now the time has come to also start studying things around nrf52832.
    At this point, I want also to thank you for your support and I remain a loyal member of your cute and inspiring "toys".

  • Thanks! Glad it works!

  • Hi can any one expain how to port espruino on BLE nano 2
    I read all the post, but I don't understand what is the procedure
    Thanks a lot

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

Porting Espruino to RedBear BLE Nano 2

Posted by Avatar for profra @profra