Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

describe how to use code warrior to display 16 memory contents starting at $1200

ID: 1806900 • Letter: D

Question

describe how to use code warrior to display 16 memory contents starting at $1200

Explanation / Answer

The technique of this application note involves the CodeWarrior debugger, and its Command Line panel, to write to and read from target flash. You must be running a debug session to the target before you begin this technique. This technique makes use of the CodeWarrior commands change, which writes to memory, and display, which reads from memory. The general formats are: change p: display p:.. where: ? , , and are address values that comply with the CodeWarrior default radix, or with an explicitly defined radix. ? is a data value that complies with the CodeWarrior default radix, or with an explicitly defined radix. ? is 8bit, 16bit, 32bit, or 64bit. Listing 7 AMD: One 16-Bit Device # Set device to Read state change p:%%%00000 f0f0 16bit # Get Mfg and Device ID values change p:%%%00aaa aaaa 16bit change p:%%%00554 5555 16bit change p:%%%00aaa 9090 16bit # Display Mfg ID value at offset 0 # Display Dev ID value at offset 2 display p:%%%00000..%%%00004 16bit # Reset device to Read state change p:%%%00000 f0f0 16bit Example 2: Two 16-Bit Intel Devices The Freescale MPC8560ADS evaluation board uses two 16-bit IN28F640J3 Intel-format devices, on a 32-bit bus. These devices have manufacturer ID 0x0089 and device ID 0x0017. The high-order flash base starting address begins with the three digits ff0. For the arrangement of two 16-bit Intel devices, Table 1 says to use the command sequence of Listing 20. We: 1. Copy this code into text file check_flash.tcl, making the code a script. 2. Substitute the string ff0 for all instances of %%%. 3. Use the source command to invoke the script. Listing 23 shows the resulting code. Listing 23 Example 2 Results %>source check_flash.tcl # Set devices to read state # and clear status registers change p:FF000000 ffffffff 32bit change p:FF000000 50505050 32bit # Get Mfg and Device ID values change p:FF000000 90909090 32bit # Display Mfg ID values at offsets 0, 2 # Display Dev ID values at offsets 4, 6 display p:FF000000..FF000007 16bit ff00000 $0089 $0089 $0017 $0017 ...... # Read and display status registers change p:FF000000 70707070 32bit display p:FF000000..FF000003 16bit ff000000 $0080 $0080 .... # Reset devices to Read state change p:FF000000 ffffffff 32bit The results of the first display line do show the manufacturer ID code 0x89 (as $0089 $0089) and the device ID code 0x0017 (as $0017 $0017) for both devices. This confirms basic read/write functionality of the flash devices.