SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By Mikkael
#192603
Hi fellows,

I'm currently on my first steps into OpenOCD.

I'm using an jTag Lock-Pick Tiny 2 with Visual Studio Community 2015, 30-days trail of VisualGDB and an Nordic nRF51422 custom board.

It took hours to get the first result from this setup, but I managed to get the Lock Pick Tiny work (driver issues Windows 10...).

I logged the output of VisualGDB which is:
Code: Select all
Open On-Chip Debugger 0.9.0 (2016-10-14) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : FTDI SWD mode enabled
swd
cortex_m reset_config sysresetreq
adapter speed: 1000 kHz
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x0bb11477
Info : nrf51.cpu: hardware has 4 breakpoints, 2 watchpoints
nrf51.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0xc1000000 pc: 0x000006d0 msp: 0x000007c0
VisualGDB_OpenOCD_Ready
Info : accepting 'gdb' connection on tcp/50726
Info : nRF51822-CEAA(build code: C0) 256kB Flash
nrf51.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0xc1000000 pc: 0x000006d0 msp: 0x000007c0
nrf51.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0xc1000000 pc: 0x000006d0 msp: 0x000007c0

But now I wonder why there is so many stops (halted) andhow to verify if it uploaded properly.

I couldn't measure a change in output on my test-pins, but this also could be in case of a false programming.


What does the output of VisualGDB mean?
What't xPSR?
And how can I use Raw Terminal to get a loop-back from the nRF in VisualGDB?
How can I access Breakpoints during debugging?

Lots of questions but at the moment I don't know how to go on as I'm working on this since 3 days...
Any help welcome!
By Mikkael
#192616
Thanks for your suggestion. But I still don't know where to start from.
Are you an experienced VisualGDB user and might you take a look at this output?

In my opinion there's no error and my LED should start to blink. No idea where to start from :(

ThereÄs no magic in my LED test-code:
Code: Select all
#include <stdbool.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif
	
#include "nrf_delay.h"
#include "nrf_gpio.h"
	
#ifdef __cplusplus
}
#endif



__STATIC_INLINE void nrf_gpio_cfg_output_high_drive(uint32_t pin_number)
{
	nrf_gpio_cfg(
	    pin_number,
		NRF_GPIO_PIN_DIR_OUTPUT,
		NRF_GPIO_PIN_INPUT_DISCONNECT,
		NRF_GPIO_PIN_NOPULL,
		NRF_GPIO_PIN_H0H1,
		NRF_GPIO_PIN_NOSENSE);
}



int main(void)
{
	nrf_gpio_cfg_output_high_drive(12);
	nrf_gpio_cfg_output_high_drive(13);

	for (;;)
	{

	}
}
Any tutorials or other stuff to get started with VisualGDB/OpenOCD/VisualStudio is welcome as well ;)