Can I use JTAG to debug my program on top of embedded Linux?

I use at91sam9260 for my development. It has a Linux kernel in it, and I run my own software on top of it.

I was wondering if I can use the JTAG debugger to debug the software I'm working on without seeing much of what is happening with the Linux kernel?

I ask because I think that I could become very difficult to debug my software when I saw full Linux execution.

In other words, I would like to know if there can be some level of abstraction when debugging with a JTAG probe?

+4
source share
4 answers

In general, yes, you can jtag, since the debugger has absolutely nothing to do with what software you use on this processor. Where you can get into the problem, this is the cache, for example, if you stop the processor, you want to change some instructions in ram and restart, changing instructions in ram is access to data that does not go through the command cache, and data cache, if you have a separate instruction and data cache, they are included, and some of the instructions that you modified are located at the address that is in the command cache, you can quickly get confused with new and outdated instructions that are given to the processor, Linux likes to use caches , if there is.

The second one is mmu, the processor / jtag most likely works on virtual addresses on the mmu processor side, and not on physical addresses, so depending on how the equipment works, for example, if you set a breakpoint at the address in the debug unit in the processor , and the task of the operating system switches to another program / thread in the same address space, you will stop at the wrong program at the right address. If the debugger / processor sets breakpoints by changing the instruction in ram, then you start the cache problem above, if you don't cache, then you break the right instruction in the right thread, but then you have a cache problem.

In fact, if the processor supports jtag-based debugging, which does not change based on any software that you have chosen to run on that processor.

+2
source

Probably not - as far as I know, most JTAG debuggers assume the ability to set breakpoints in the processor. In a multi-tasking OS that also stops the kernel of the OS.

Embedded operating systems, such as QNX, have debuggers that run on top of the OS kernel and that communicate over Ethernet.

+3
source

It depends on the JTAG device and its driver. Personally, I only know one device that can do this: XDS560 + Code composer studio (CCS). But there may be others.

I suggest consulting the manufacturer of your device.

+2
source

For ARM, the Asset Arium family is claimed to be able to debug application code. I have not even tried.

0
source

Source: https://habr.com/ru/post/1389623/


All Articles