Skip to contentSkip to conversation

JTAG debugging of the kernel

DISCUSSION Peter Barada 3 participants 5 messages Aug 15, 2008 – Aug 18, 2008

lore
Share & tools
lore
#0 lore raw

I've been trying to use JTAG (and an Abatron BDI-2000) to debug the ALSA driver to determine why madplay can't keep up when pulling .mp3 from an SD card, and have not had any luck trying to halt via JTAG and set/stop at breakpoints within the kernelthe kernel. I've found that JTAG works for a while on kernel startup, but stops working at a non-reproducible point in the startup code.

Have people had success using a BDI-2000 to debug the kernel after it has completed startup?

Any suggestions on what can cause the JTAG to stop working after the kernel starts?

Thanks in advance!

#1 lore raw
Quoted 16 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Peter Barada
Sent: Friday, August 15, 2008 8:34 PM
To: [email protected]
Subject: JTAG debugging of the kernel

I've been trying to use JTAG (and an Abatron BDI-2000) to debug the ALSA driver to determine why madplay can't keep up when pulling .mp3 from an SD card, and have not had any luck trying to halt via JTAG and set/stop at breakpoints within the kernelthe kernel. I've found that JTAG works for a while on kernel startup, but stops working at a non-reproducible point in the startup code.

Quoted 6 lines

Have people had success using a BDI-2000 to debug the kernel after it has completed startup?

Any suggestions on what can cause the JTAG to stop working after the kernel starts?

I think you should disable Power Management. Which kernel are you using now?

Regards,
Khasim

#2 lore raw
Quoted 15 lines · Khasim
Quoted 15 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Peter Barada
Sent: Friday, August 15, 2008 8:34 PM
To: [email protected]
Subject: JTAG debugging of the kernel

I've been trying to use JTAG (and an Abatron BDI-2000) to debug the ALSA driver to determine why madplay can't keep up when pulling .mp3 from an SD card, and have not had any luck trying to halt via JTAG and set/stop at breakpoints within the kernelthe kernel. I've found that JTAG works for a while on kernel startup, but stops working at a non-reproducible point in the startup code.

Quoted 8 lines
Quoted 6 lines

Have people had success using a BDI-2000 to debug the kernel after it has completed startup?

Any suggestions on what can cause the JTAG to stop working after the kernel starts?

I think you should disable Power Management. Which kernel are you using now?

2.6.22.18. I'm planning to move to 2.6.26 after the dust settles...

I'll try w/o power management, but any idea why power management might affect JTAG?

Quoted 2 lines

Regards,
Khasim

#3 lore raw
Quoted 8 lines · Peter Barada
Quoted 7 lines · Khasim
Quoted 7 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Peter Barada

Any suggestions on what can cause the JTAG to stop working after the kernel starts?

Quoted 6 lines
Quoted 1 line

I think you should disable Power Management. Which kernel are you using now?

2.6.22.18. I'm planning to move to 2.6.26 after the dust settles...

I'll try w/o power management, but any idea why power management might affect JTAG?

The guy I share an office with (who's out on vacation) worked through this with their tech support, who suggested replacing WFI instructions with NOPs.

Look at cpu_v7_do_idle in arch/arm/mm/proc-v7.S. Changing the WFI to a NOP did the trick for him.

Presumably power management was off, but even WFI (wait for interrupt) put the CPU in a state that wasn't handled by the BDI firmware at the time. I'm not sure if they resolved the issue in a later firmware update or not. We didn't think the workaround was worthy of a Kconfig option - hopefully updated firmware for the BDI box will address the issue.

- Josh

#4 lore raw
Quoted 20 lines · Josh Karabin
Quoted 8 lines · Peter Barada
Quoted 7 lines · Khasim
Quoted 7 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Peter Barada

Any suggestions on what can cause the JTAG to stop working after the kernel starts?

Quoted 6 lines
Quoted 1 line

I think you should disable Power Management. Which kernel are you using now?

2.6.22.18. I'm planning to move to 2.6.26 after the dust settles...

I'll try w/o power management, but any idea why power management might affect JTAG?

The guy I share an office with (who's out on vacation) worked through this with their tech support, who suggested replacing WFI instructions with NOPs.

Quoted 8 lines

Look at cpu_v7_do_idle in arch/arm/mm/proc-v7.S. Changing the WFI to a NOP did the trick for him.

Presumably power management was off, but even WFI (wait for interrupt) put the CPU in a state that wasn't handled by the BDI firmware at the time. I'm not sure if they resolved the issue in a later firmware update or not. We didn't think the workaround was worthy of a Kconfig option - hopefully updated firmware for the BDI box will address the issue.

Hmm, trying both disabling power management and changing the WFI to NOP in cpu_v7_do_idle does not work, the BDI times out when I try to halt the processor. I'm running with version 1.07 of the BDI firmware. Is this what other people are successfully using to debug the kernel with a BDI-2000?

Quoted 2 lines

- Josh