User forums > Embedded development

Viewing pheripheral registers while debugging

(1/2) > >>

zainka:
Hi

I use CB 16.01 on xubuntu 15.10 to develope and debug code for AVR8s. This has prooven to be very stable when using avrdude, avarice and atmels own avr-gcc tool package with avr-gdb together with jtagice-mk2 debugger.

However, there is one problem that needs an solution. CB has no clue of the special function registers, or pheripheral registers if you like, thus I can not view easily the content of the timer registers or ADC and such.

I am currently trying to figure out how to eventually write a plugin that adds this feature based on atmels own peripheral register file description, a xml file that is part of Atmel studio. The plugin would then ask for such a file (a setting in the project setup) and based on its content (special for each chip) provide a window under the "debug window" menu much like the CPU registers debug window so that one may read and write to these registers easily.

But, for all I know, there might be an solution for this already somewhere, so I would be glad to hear your experiences for debugging with access to pheripheral registers. How are you dealing with this today?

Breg

oBFusCATed:
What is this xml file doing? Can you show me an example?
And how do you ask the debugger for the special registers?

Quiss:
For sometime ago, I did something like that for STM .svd files (.xml file), it looks like:


I basicly copied one of the debugging windows and edited it but it's been a long time and it is really a mess. Maybe you could use this as a starting point.

Edit: I forgot to put a .svd file.

oBFusCATed:
What are the gdb commands to read and write the registers?

Quiss:
Same as ExamineMemory; you just get perihperal register's address (base address+offset) from the .xml or .svd file:

--- Code: ---[debug]>>>>>>cb_gdb:
[debug]> if 1
x/1xw0x48000400
x/1xw0x48000404
end
[debug] > > >0x48000400: 0x00000000
[debug]0x48000404: 0x00000000
[debug]>>>>>>cb_gdb:

--- End code ---
I do not know about AVR but it should be similiar.

Navigation

[0] Message Index

[#] Next page

Go to full version