This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Two different code area?

Hi all ,
I want to run program which has some 2 different code area. In the example that I have written below CODEAREA1 gets executed until I branch to CODE AREA2….after branching to CODEAREA2 I am getting the error

Prefetch Abort: ARM Instruction at 41000000H

I would like to the cause for the error and how can I remove this error?The main theme behind codearea2 is that i want to place some fixed code in that area for ever ....that why I am trying with some experiments like this...

looking for your help
t.senthil

 AREA CODEAREA1, CODE, AT 0x40000000
	START

	LDR R0,=num1
	LDR R1,[R0]
	LDR R0,=num2
	LDR R2,[R0]
	CMP R1,R2
	BHI second
	MOV R3,R1 ;
	 BL 0x41000000 
second   MOV R3,R2

	 SWI 11

AREA DATAAREA, DATA, READWRITE

	num1 DD 0x19
	num2 DD 0x34
	result DD 0

AREA CODEAREA2, CODE, AT 0x41000000

	MOV R3,#0x43

 	END	



. I am also giving how my flash.ini is like

/*  FLASH.INI: Flash Initialization File                               */
/*                                                                     */
/***********************************************************************/


//*** <<< Use Configuration Wizard in Context Menu >>> ***


FUNC void Setup (void) {

// <h> External Memory Controller (EMC)

//   <h> Bank Configuration 0 (BCFG0)
//     <o1.0..3>   IDCY: Idle Cycles <0-15>
//     <o1.5..9>   WST1: Wait States 1 <0-31>
//     <o1.11..15> WST2: Wait States 2 <0-31>
//     <o1.10>     RBLE: Read Byte Lane Enable
//     <o1.26>     WP: Write Protect
//     <o1.27>     BM: Burst ROM
//     <o1.28..29> MW: Memory Width  <0=>  8-bit  <1=> 16-bit
//                                   <2=> 32-bit  <3=> Reserved
//   </h>
  _WDWORD(0xFFE00000, 0x20003CE3);   // BCFG0: Flash Bus Configuration

  _WDWORD(0xE002C014, 0x0E6001E4);   // PINSEL2: CS0, OE, WE, BLS0..3
                                     //          D0..31, A2..23, JTAG

// </h>

}


Setup();                             // Setup for Flash
pc=0x40000000

0