This code is an addon patch on 2440test project. 2440test is a C based project provide my FriendlyARM DVD. ARM Developer Studio is needed to compile and build this project and binary can be loaded to Mini2440 via JTAG. This change is needed in main.c. We are enabling and setting CLK0 pin clock pin and connecting this to PCLK. We are also setting GPIOA 13 pin as Address chip select pin for the address 0x10000000. Next is basically a loop where we are waiting for 1s and toggling LED status. We are first reading the status in a byte. Then toggling LSB bit. Then again writing the state back to device.

static void __irq Isr_INT3(void)
{
  ClearPending(BIT_EINT3);
  Uart_Printf("Int EINT3 on read/write at 0x10000000\n");
}
void Isr_Init(void)
{
  pISR_UNDEF=(unsigned)HaltUndef;
  pISR_SWI  =(unsigned)HaltSwi;
  pISR_PABORT=(unsigned)HaltPabort;
  pISR_DABORT=(unsigned)HaltDabort;
  rINTMOD=0x0;    /* All=IRQ mode */
  rINTMSK=BIT_ALLMSK;    /* All interrupt is masked. */

  pISR_EINT3 = (unsigned)Isr_INT3;
  ClearPending(BIT_EINT3);
  rINTMSK =~(BIT_EINT3);
}


void Main(void)
{
  unsigned char val;

  Clk0_Enable(4);  /* 4:PCLK */
  Clk1_Disable();
  rGPACON |= (<< 13);


  while(1)
  {
    Delay(1000);
    val =  *((unsigned char*)0x10000000);
    val ^= 1;
    *(char*)0x10000000 = val;
  }
  /* Or without val */
  while(1)
  {
    Delay(1000);
    *(char*)0x10000000 ^= 1;
  }
}

This is the disassembly of the C code

val =  *((unsigned char*)0x10000000);
val ^= 1;
*(char*)0x10000000 = val;
	
[0xe3a00540] * mov      r0,#0x10000000
[0xe5d06000]   ldrb     r6,[r0,#0]
[0xe2266001]   eor      r6,r6,#1
[0xe3a00540]   mov      r0,#0x10000000
[0xe5c06000]   strb     r6,[r0,#0]

Output: LED will turn on or off as per val 0 bit. Interrupt will be triggred

#