NRF51 JTAG problems

Post here to get support
Post Reply
theseankelly
Expert
Posts: 143
Joined: Mon Dec 28, 2015 3:23 pm
Contact:

NRF51 JTAG problems

Post by theseankelly » Sat Aug 12, 2017 2:49 pm

Hey Forum

Couple questions regarding NRF51 JTAG using the debug adapter kit (with the RST button jumper set to SWDIO)

1) I accidentally ripped a pads off the tiny little JTAG adapter board that solders on to the pads on the main CFlie board. I should be able to solder the ends of jumper wires between the four pins labled "NRF51" on the main JTAG board to the four pads on the side of the crazyflie and still use JTAG, right? I see that those pins are a 1:1 mapping, but its not clear to me which pin is which on the two boards.

2) Before I damaged the little adapter, I had been having some intermittent JTAG problems so I tried a "make factory_reset". It seemed to work somewhat but died in the middle of flashing. When I power up right now, the blue "m3" LED is pulsing rapidly (not even a full blink) and I'm not able to connect at all with JTAG. Any clues on what's going on?

Thanks
Sean
http://www.thejumperwire.com
Tips, tutorials, and science about DIY electronics, drones, and embedded software.

theseankelly
Expert
Posts: 143
Joined: Mon Dec 28, 2015 3:23 pm
Contact:

Re: NRF51 JTAG problems

Post by theseankelly » Sat Aug 12, 2017 10:30 pm

Solved my own problems with some trial and error :)

#1: Yes, this works fine. The pin nearest the "P1" label on the debug board corresponds to the pad closest to the front of the crazyflie. They go in order from there.

#2: Through trial and error it appears this is a power draw problem -- I was powering my board via USB with all sorts of strange, intermittent problems. I switched over to powering with a battery and JTAG is working great. I just had to rebuild the firmware with BLE=0 and S110=0 and now I'm stepping through code just fine! (Though, I'm curious why stepping doesn't work with BLE=1 and S110=1? Does the image get flashed to an offset location to make room for the softdevice or something?)
http://www.thejumperwire.com
Tips, tutorials, and science about DIY electronics, drones, and embedded software.

arnaud
Bitcraze
Posts: 1291
Joined: Tue Feb 06, 2007 12:36 pm

Re: NRF51 JTAG problems

Post by arnaud » Mon Aug 14, 2017 7:52 am

Hi,

Good that you solved the problem. For #2, yes we have seen that we need VBAT up in order to flash the nRF51. We are not sure why but we are doing it in factory.

For stepping, when S110=1 the firmware is flashed in the middle of the flash, the beginning contains a Master Boot Record (some minimal jump and flashing program) and the bluetooth stack. The architecture is explained in the readme of the firmware: https://github.com/bitcraze/crazyflie2- ... chitecture. If BLE=1, apparently the bluetooth stack disables stepping and you can set a setpoint, inspect the memory, but not step or continue. If you want to be able to step and keep the radio bootloader alive you can compile with S110=1 BLE=0.

theseankelly
Expert
Posts: 143
Joined: Mon Dec 28, 2015 3:23 pm
Contact:

Re: NRF51 JTAG problems

Post by theseankelly » Mon Aug 14, 2017 1:24 pm

Thanks for the follow up! Good to know that stepping is disabled when Bluetooth is enabled. Strange -- I hope there's a technical reason behind that and it isn't just Nordic trying to protect their IP by hindering debuggability :(
http://www.thejumperwire.com
Tips, tutorials, and science about DIY electronics, drones, and embedded software.

Post Reply