I'm trying to use a jlink JTAG unit which received recently.
The atmel processors, specifically the ARM9 I'm using have a configuration bit that toggles with each write.
I need a method to read address 0x0 take the read value and store it, write something different to address 0x0 to see if I need to remap memory. If I'm successful writing address 0x0 nothing needs to be done, write the original value back to 0x0.
The following script is for another probe vendor, is there a way to do this with the JLink-RDI script language.
//==========================================================================
// CheckNoRemap()
//==========================================================================
/* Remap:
On Reset After remap
0x0000_0000 Internal ROM -> REMAP -> 0x0000_0000 Internal SRAM
0x0030_0000 Internal SRAM 0x0040_0000 Internal ROM
//--------------------------------------------------------------------------
// 0xFFFFee00 (AT91C_MATRIX_MCFG) = Bus Matrix Master Configuration Register
//--------------------------------------------------------------------------
• RCBx[x = 4..0]: Remap Command Bit for AHB Master x
0: No effect
1: This Command Bit acts on a toggle basis: writing a 1 alternatively cancels and restores the
remapping of addressed slaves from master x.
*/
$i = * 0x00000000
$mem = $i
$i++
memwrite 4 0x00000000 $i
$pt = * 0x00000000
if($i == $pt) {
echo "---------------------- The Remap is done ---------------------------"
memwrite 4 0x00000000 $mem
} else {
echo "--------------------- Toggle the RESET map -------------------------"
memwrite 4 0xFFFFee00 0x00000003
}
Is there any way to do a conditional statement in the RDI script to read-modify and compare to see if the mapping of address 0 is processor SRAM? The processors bit to control this is a toggle function and you got to test before you set it.
Thanks.
The atmel processors, specifically the ARM9 I'm using have a configuration bit that toggles with each write.
I need a method to read address 0x0 take the read value and store it, write something different to address 0x0 to see if I need to remap memory. If I'm successful writing address 0x0 nothing needs to be done, write the original value back to 0x0.
The following script is for another probe vendor, is there a way to do this with the JLink-RDI script language.
//==========================================================================
// CheckNoRemap()
//==========================================================================
/* Remap:
On Reset After remap
0x0000_0000 Internal ROM -> REMAP -> 0x0000_0000 Internal SRAM
0x0030_0000 Internal SRAM 0x0040_0000 Internal ROM
//--------------------------------------------------------------------------
// 0xFFFFee00 (AT91C_MATRIX_MCFG) = Bus Matrix Master Configuration Register
//--------------------------------------------------------------------------
• RCBx[x = 4..0]: Remap Command Bit for AHB Master x
0: No effect
1: This Command Bit acts on a toggle basis: writing a 1 alternatively cancels and restores the
remapping of addressed slaves from master x.
*/
$i = * 0x00000000
$mem = $i
$i++
memwrite 4 0x00000000 $i
$pt = * 0x00000000
if($i == $pt) {
echo "---------------------- The Remap is done ---------------------------"
memwrite 4 0x00000000 $mem
} else {
echo "--------------------- Toggle the RESET map -------------------------"
memwrite 4 0xFFFFee00 0x00000003
}
Is there any way to do a conditional statement in the RDI script to read-modify and compare to see if the mapping of address 0 is processor SRAM? The processors bit to control this is a toggle function and you got to test before you set it.
Thanks.
The post was edited 1 time, last by caltick ().