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
  • Update time again...

    So we figured out the jtag pin issue- turns out the schematic was designed to be used with a raspberry pi (!?!?!) for programming than spending the money for the JLink even though they included a JLink when they shipped us everything. Almost 2 weeks lost to a 9-size font note in one of the pages of the schematics... hilarity.

    Anyway, last night got the new cables set up (hacked the singular one we had to reroute the cable) and got both the MCU and BLE programmed properly.

    After adjusting for a BoM change (swap from 10MHz to 16MHz oscillator)- got proper serial output coming from the latest boards and successfully have them serial'd so that everything is kosher- except...

    My proceedure is as follows for bring up:

    • Prime EEPROM via this command:
       
      "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude" 
      -C "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" 
      -v -patmega1284p -cstk500v2 -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m 
      -Uhfuse:w:0xDE:m -Ulfuse:w:0xDE:m 
      && wait 1 && 
      "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude" 
      -C "C:\Program Files(x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" 
      -v -patmega1284p -cstk500v2 -Pusb 
      -Uflash:w:"C:\DualOptiboot_V5.0_atmega1284p_BlinkD15.hex":i -Ulock:w:0x0F:m
    • Then in Adruino burn the bootloader
    • Upload the configuration firmware via AVRISP MkII
    • Set the serial number
    • Upload the main firmware via AVRISP MkII
    • Upload softdevice to nrf51822 via JLink
    • Upload main program to nrf51822 via JLink

    When I do all that, I got the board to get to the point of searching for it's BLE pairing (so, that means getting a cellular signal, locking onto GPS, and checking the cloud for firmware updates).

    Once there, I can't see the device in a Bluetooth scanner (both from Adafruit, and Nordic) and the Connection LED is not flashing at any point.

    I have to verify 2 things tonight- when I tried connecting to the nrf51822 after the above setup- it couldn't and reported back a reference voltage of 3.664V (which is obviously high). When I cleared everything back down to priming the EEPROM- I *could* connect to the nrf51822 and the ref voltage reported was 3.4V.

    Need to verify if this is a design error or if there's something else at play- as I have (from the previous cable hack-together) managed to wipe clean a nrf51822 and reprogram the softdevice and main program and it went back to the Connection LED flashing upon issuing Reset (r) and Go (g). Second thing to check is if an older board reports back the same high voltage when running properly.


    Any thoughts and comments would be appreciated, as well as any other ideas about what P0.09 & P0.11 (as Turbo J mentions, they may just be debug lines).

  • P0.09 & P0.11 are just gpio.  Nothing special about them.  The user may have wanted to repurpose the unused jtag pins for his own use.  

Reply Children
No Data
Related