This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BEAGL-BONE-BLACK: Cannot set registers or memory using GDB and OpenOCD in Beagle Bone Black.

Part Number: BEAGL-BONE-BLACK

Hi everyone, 

I have been using Beagle Bone Black a couple of months now and have been exploring to debug using JTAG connectors. I have been planning a simple GPIO based LED turn on and off through GDB.

I am using the BlackHawk USB100v2 and was initially not able to connect to the board but I found that I was able to connect once I load a dummy program (program which just prints "hello world") and then connect. The output I get when I connect directly on power cycle is 

Error: JTAG-DP STICKY ERROR
Error: Could not initialize the APB-AP 

or 

Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: am335x.jrc: IR capture error; saw 0x3f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : starting gdb server for am335x.m3 on 3333
Info : Listening on port 3333 for gdb connections
Info : starting gdb server for am335x.cpu on 3334
Info : Listening on port 3334 for gdb connections

Going through this and I was able to get GDB connected to OpenOCD and was trying to inspect memory regions for I/O such as GPIO, UART. I was not able to write anything (giving an error "Cannot write" to the specified location, and read those address return 0x0 always. I also tried to read the DATA_OE register of GPIO1 which should on power cycle should reset to 0xFFFFFFFF and what I received was 0x00000000

After that, I read in some forums that we have to keep the core running in order for the access to happen and I tried that and in this case OpenOCD gives out saying the core has to be halted.

I kind of think I am missing something and would like some help on finding the issue in my setup. For any more details please let me know so that I can provide some.

Thanks for the help in advance.

Note: I have not used any code other than the dummy code in CCS as to connect initially.

Best,
Venkatakrishnan Sutharsan