Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LPC2148 code is stuck

Status
Not open for further replies.

Beenaplaye

Member level 2
Joined
Aug 23, 2009
Messages
49
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Belgium
Activity points
1,577
I'm using the KEIL IDE and toolchain to compile and run code on my LPC2148. The toolchain is the realvision / armcc. I debug the code with a segger J-link and run it at 100kHz.
When I run the code on the device it get stuck in a branch instruction to itself (it's own instruction address). Why it's not skipping this address?
 

The simulator in the KEIL IDE is not handy to debug this problem. It doesn't emulate the LPC2000 bootloader and startup code.
 

When I run the code on the device it get stuck in a branch instruction to itself (it's own instruction address). Why it's not skipping this address?

The code execution is "stuck" repeatedly branching to itself, due to the fact it has arrived at the SuperLoop, the infinite loop, which you have in your code:

Code:
while(1)
{
}

The above "while" loop assembles as a branch to itself instruction, as should be expected. Why would you expect any other outcome?

There is nothing wrong with KEIL Compiler or IDE.

BigDog
 

If I do like:

while(1)
{
int i;
for(i=0; i < 2000; i++){};
}
or
while(1)
{
int i=0;
if(i < 2000){i++};
}

And I place a breakpoint either to the for or if loop, it passes one time at the breakpoint and then it keep branching to same instruction(0x8C4). At the same address??
 

I found out that using the 2132 target in the Keil project let my board start up. So the startup code for the 2148 target doesn't work on all boards. Now the supervisor mode becomes user mode after start up.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top