This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Programming nRF51822 via 6pin?

Hello all,

So I've ran into an unfortunate situation, our firmware team decided to ditch us just as we're about to launch our product. I got a dump from them including just about everything we ever paid them to do, and have made my way through programming our PCB boards via an AVR ISP MkII and getting our iOS and Android apps to compile via the ionic framework.

The last thing I've left to do to get us back up and running as we look for replacements is programming the Raytec MDBT40 which houses the nRF51822. Along the lines of developement we had decided to use Adafruits firmware for the unit as it had extensions written that were favorable to what we wanted to do with the module.

Looking through the dump, this seems to be the instruction set to upload the firmware via the 6pin connector on our daughter board, and from what I gather- we need to upload it via a JLink (which we have) but need the 20pin to 6pin adapter (just the PCB part, not the cable since we already have a cable that we use for the AVR ISP MkII).

 .\JLink.exe -if SWD -device nRF51822 -speed auto
 
loadfile  <PATH>\Adafruit_BluefruitLE_Firmware-master\Adafruit_BluefruitLE_Firmware-master\softdevice\s110_nRF51822_7.1.0_softdevice.hex
loadfile  <PATH>\Adafruit_BluefruitLE_Firmware-master\Adafruit_BluefruitLE_Firmware-master\0.5.0\blefriend\blefriend_s110_xxaa_0_5_0_150224_blefriend_release.hex
r
g
for spifriend go to:
loadfile  <PATH>\Adafruit_BluefruitLE_Firmware-master\Adafruit_BluefruitLE_Firmware-master\softdevice\s110_nRF51_8.0.0_softdevice.hex
loadfile <PATH>\Adafruit_BluefruitLE_Firmware-master\Adafruit_BluefruitLE_Firmware-master\0.7.7\blespifriend\blespifriend_s110_xxac_0_7_7_161213_blespifriend.hex

Is there anything I'm missing? Does anyone know if I can buy just the PCB part without the cable? I know that seems silly but why have 2 cables?

Regardless, if there's anyway to do this update via OTA- a bit of help would be appreciated as I haven't found a way to do it via the Adafruit BLE app nor the Nordic BLE Connect app... every time I try to get the module into DFU- it disconnects.

Much appreciate any help and guidance, cheers.

Parents
  • Still at a complete loss as to getting this setup properly... I've tried 3 different computers now, 2 Windows and a MacOS. All eventually get to the same point of not being able to connect after outputting this in console:

    MacBook-Pro:jlink user$ JLinkexe -if SWD -device nRF51822 -speed auto
    SEGGER J-Link Commander V6.20i (Compiled Nov 17 2017 17:33:48)
    DLL version V6.20i, compiled Nov 17 2017 17:33:39
    
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V10 compiled Apr 20 2018 16:47:09
    Hardware version: V10.10
    S/N: 260104503
    License(s): FlashBP, GDB
    OEM: SEGGER-EDU
    VTref = 1.019V
    
    
    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Device "NRF51822_XXAA" selected.
    TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
    TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
    
    
    Connecting to target via SWD
    Cannot connect to target.
    J-Link>connect
    Device "NRF51822_XXAA" selected.
    
    
    Connecting to target via SWD
    Cannot connect to target.
    J-Link>connect
    Device "NRF51822_XXAA" selected.

    Can someone please help me get this setup correctly? It's a bit insane to still not have a functional dev env after 4 days of effort... (conversely, I could program with the AVR ISP MkII in an hour of getting the package in the mail).

  • Some thing odd here.  AVR ISP cannot program the nRF chip.  It is only made for the Atmel AVR.  I am not sure to completely understand your setup.  Another thing, I see from your JLink output that the target voltage is only 1.019V.  That will not work for nRF51 chip.  It needs at least 1.75V 

  • Just got off the phone with JLink, this seems to make a lot of sense...

    He's guessing that the nrf51822 is already in low power mode and not supplying enough voltage to the 6 pin headers.

    I'm thinking that is the issue too, and I need to force the module into DFU or some other mode that will allow the full 3.5v to come through so I can successfully connect.


    Can someone guide me in doing that? From what I remember, it's a matter of putting GND to the DFU lead?

  • Well, that makes no sense at all.  The supply voltage is not generated by the nRF.  It is the other way around.  You need to provide sufficient voltage to the nRF for it to function.  Secondly, when jtag is connected, the chip never sleeps. 

  • Well, what would be the procedure to bring up a fresh module?

  • It depends on your HW.  Normally just hook up jtag, power up and flash the firmware.  If your board does give the right voltage, it is either an assembly issue or a design issue.  You'll need to validate your board supply first.  It is not going to work until you fixe that issue.

  • Well, somethings going on.

    I can force the module to reset by grounding the DFU pin for 5 seconds- but if I ground the DFU pin when powering up, the module just keeps sitting in command mode (3 blinks, 3 second delay).

    Seems strange that it's not going into DFU for whatever reason...

Reply Children
  • I am not sure to completely understand the issue here.  Are you having problem flashing the firmware into the nRF chip ? Based on your last comment, it seems to have the firmware flashed in already.  How exactly does that firmware work, only the one who provides you that firmware can answer.  I don't think you can find an answer on that here.  The nRF chip is sold without firmware.  It is the users to develop their own firmware.  

Related