| Electronic Components Datasheet Search |
|
AVR32AP Datasheet(PDF) 97 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
AVR32AP Datasheet(HTML) 97 Page - ATMEL Corporation |
|
97 / 181 page ![]() 97 32001A–AVR32–06/06 AVR32 1. Write RAR_DBG to the Debug Program Counter. 2. Increment RAR_DBG by 2 or 4, so the register points to the start of the next word in the program memory. 3. Write 1 to Instruction Replace (IRP) in DC. 4. Write a retd instruction to DINST. The CPU will exit Debug Mode and stall while waiting for new instructions. 5. Write the stored word to DINST. This instruction is fetched by the CPU, and the CPU continues normal program execution. 9.2.6.1 Instruction replacement example Table 9-1 shows an example of a code where the user wants to insert a breakpoint. The tool wants to insert a software breakpoint on the instruction "adc r6,r12,r7" on PC=0x000016. This is an extended instruction, and only the upper halfword needs to be replaced by the breakpoint instruction. 1. The upper halfword is contained within the word located at 0x000014, and the debug tool stores this value (0xC0ACF807). 2. The debugger writes a breakpoint instruction (opcode 0xD673) to location 0x000016 in the CPU’s program memory to replace the most significant word of the breakpointed instruction. 3. When the breakpoint instruction executes, the CPU will enter OCD Mode, and DS:DBS and DS:SWB are set, indicating that OCD Mode is entered due to a software breakpoint. 4. The tool performs a normal sequence of operation in OCD Mode. 5. When the tool is ready to return to normal CPU operation, it reads the RAR_DBG value to find the return address. 6. The tool inserts CPU instructions to DINST to increment RAR_DBG by 2, so it is aligned to the next word in the program memory. 7. The tool inserts a "retd" instruction to DINST. The tool will receive a Debug Status mes- sage, which indicates that the CPU has exited OCD Mode, and is now waiting for one more instruction from the tool. 8. The tool writes the return address (0x000016) to the Debug Program Counter (DPC). 9. The tool looks up the stored instruction word (based on the return address) and writes this value (0xC0ACF807) to the Debug Instruction Register (DINST). The CPU now resumes normal operation. Table 9-1. Example of a user code section PC value Opcode Instruction 0x000010 0x0E9C mov r12,r7 0x000012 0x201C sub r12,0x01 0x000014 0xC0AC rcall label1 0x000016 0xF8070046 adc r6,r12,r7 0x00001A 0x2027 sub r7,0x02 |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |