arm7tdmi jtag
Hi all
I am developing a free JTAG agent for ARM7TDMI. It is almost finish. So far, everything works well.
During the development, I encounter a strange problem. When ARM7TDMI is halted and enters DEBUG state, one of the basic operations is to change the value of a register (for example R0). This can be achieved by inserting ARM instruction LDR R0, [R0] into scan chain 1. I found that every time I need to write twice. The first time clear the target register (for example R0) with 0x00000000 . The second time write the new value into the target register. Then the write operation can succeed. If I omit the first clear step, the write operation seems can't succeed. If the new value is 0x12345678, the read out is 0x34567812 or something like that. If I clear the target register before writing the new value, the write operation succeeds everytime.
I don't understand why two write operations are needed?
Is this a bug of ARM7TDMI?
Has anyone ever encountered such situation?
: (