virtualabs / btlejack-firmware

Btlejack firmware for BBC Micro:Bit
MIT License
49 stars 27 forks source link

Doesn't work on Nordic NRF51 devboards (PCA10028 etc) - fix supplied #4

Open raplin opened 5 years ago

raplin commented 5 years ago

Original Nordic dev boards have somewhat different hw but use same UART TX/RX as the BLE400 board; however they also require RTS/CTS set up. Adding this at the start of main, to existing 'custom serial pin' stuff; additional setup for the PCA boards..


#ifdef YOTTA_CFG_TXPIN
  #ifdef YOTTA_CFG_RXPIN

    //Nordic NRF51 devboard (PCA10028) and probably others
    //use p0_08 is CTS, 0_09=RxD, 0_10=RTS, P0_11=TXD
    //The onboard J-Link seems to want RTS/CTS set correctly.
    //We need to deactivate the "display" we don't have one anyway - and assign the gpios correctly
    //or the device will transmit over the JLink UART but not receive.
    //Again - this is only for the Nordic PCA devboards.
    #pragma message("Btlejack firmware for Nordic PCA10028 dev board RTS/CTS pins")
    uBit.display.disable();
    DigitalOut cts(P0_8,0); //must set rts/cts for Nordic board
    DigitalIn  rts(P0_10);
    /// End Nordic PCA devboard

    #pragma message("Btlejack firmware will use custom serial pins")
    uBit.serial.redirect(YOTTA_CFG_TXPIN, YOTTA_CFG_RXPIN);

  #endif
#endif
bbirkinbine commented 3 years ago

Curious to see if this will work with my nRF52840 boards.

KamicDemon commented 1 year ago

Hey @raplin I've just come across this issue while trying to get btlejack to work for my device, the same PCA10028 board that your fix here is for. I've been having a lot of trouble putting together an environment to properly compile the firmware with the changes you shared in your post, I think the ARM mbed Online has been discontinued and for the life of me I cannot get Yotta installed on any of my systems. You wouldn't happen to have a pre-compiled version of the firmware for the PCA10028 that you could share, would you? I'm sorry to ask like this, especially since it's been so many years since you opened the issue. Thanks.

raplin commented 1 year ago

sorry that was on an old computer, don't have a binary of it any more (nor NRF tools installed on this computer)