Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: Handling interrupts on RAM (debug) version

2006-05-29 by 3gpabko

--- stefano_m_a <stefano_mora@...> wrote:

> My code has a classic startup written in assembly
> code that run the C 
> main() function.
> Into the main() function i have:
> 
> #ifdef RAM_RUN
> 	// Per la compilazione in RAM \ufffd necessario
> reimpostare
> 	// anche la zona degli interrupt (se usati...)
> 	SCB_MEMMAP = 2;
> #endif
> 	VIC_Init();
> 	initTimer0(1000); // set up the timer0
> 	enableIRQ();
> 	while(1) .....
> 
> If i take a look into the main.lss i see:
> 
> 40000000 <startup>:
> .section .startup, "ax"
> 	.code 32
> 	.align 0
> 
> 	b     _start
> 40000000:	ea000083 	b	40000214 <start>
> 	ldr   pc, _undf	
> 40000004:	e59ff014 	ldr	pc, [pc, #20]	; 40000020 
> <_undf>
> 	ldr   pc, _swi
> 40000008:	e59ff014 	ldr	pc, [pc, #20]	; 40000024 
> <_swi>
> 	ldr   pc, _pabt
> 4000000c:	e59ff014 	ldr	pc, [pc, #20]	; 40000028 
> <_pabt>
> 	ldr   pc, _dabt	
> 40000010:	e59ff014 	ldr	pc, [pc, #20]	; 4000002c 
> <_dabt>
> 	nop
> 40000014:	e1a00000 	nop			(mov r0,r0)
> 
> 	ldr   pc, [pc,#-0xFF0] 
> So I think this it is correcty mapped ...

Yes this seems to be OK.


> My dubt is: when the interrupt is fired, the flow
> should go to 
> 0x4000.0018 address to read the IRQ VIC address
> (0xFFFF.F030)
> containing the service routine. 
> When the vectors are based on 0x0 (Flash) then
> pc,#-0xFF0 => 
> 0xFFFF.F030 but when the vectors are based on
> 0x4000.000 (RAM) the 
> difference is equal to 0x3FFF.F030 that's incorrect
> !! 
> 

No. You are making a mistake. The remapping does not
affect the program counter.
In my code I have also:

ldr   pc, [pc,#-0xFF0]

at IRQ vector location and it works placed in RAM or
FLASH.
So this is not the case.
You are telling that only interrupts are not working
...?



\u0417\u043d\u0430\u043d\u0438\u0435\u0442\u043e \u0435 \u043b\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0436\u0438\u0432\u044f\u043d\u0430 \u0438\u0441\u0442\u0438\u043d\u0430.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.