The usual VIC problem not resolved.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The usual VIC problem not resolved.

1,000 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nmariner on Wed May 07 09:43:48 MST 2014
After trying many things I stripped out code into new project with basic timer2 running.
Still have problems with timer2 int not always hitting although on some builds if I reset the code twice I could get the interrupt to hit regularly.
Now it seems that code just goes into error state (data abort) in startup code when run.
I don't know what's happening so have included all code in zip file in case someont else has an idea.
Reset processor, erased flash and re-debug and no data abort now, but still no interrupt!

Original Attachment has been moved to: VIC_test_project.zip

0 Kudos
Reply
5 Replies

969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue May 13 10:25:46 MST 2014
Yes. Look in the docs (Help->Help Contents).
0 Kudos
Reply

969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nmariner on Tue May 13 09:38:04 MST 2014
I did notice the tag on the interrupt function but as the original code that I have been stripping down didn't seem to have this (and I have searched for it) I didn't include it.
Everything works fine now this is included, don't know how things were working on the original code then !
Is there a reference for all of the __attribute__ directives so I can see what's available and what they all do?

Many thanks,
Nigel.
0 Kudos
Reply

969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon May 12 07:51:39 MST 2014
First of all, if you look at the example I provided, you will see that you need to tag C functions used as interrupt handlers, so that the compiler can generate appropriate entry/exit code for them. There is more detail of this in the GCC docs, but basically you need to change:

void timer2_handler()


to

__attribute__((interrupt("IRQ")))
void timer2_handler()


This appears to solve your 'interrupt only triggered once' issue when testing your project here.

In addition, I've noticed that occasionally, because of the way reset is handled when starting a debug connection, you can get interrupts getting registered before your code has actually set things up (because the code that was already in flash got partially executed before the debugger took control). This can be solved by modifying the cr_startup_…. file to clear any interrupts in the VIC before switching on IRQs at the ARM core level. To do this change:
        MSR   CPSR_c,#MODE_SYS|F_BIT// System Mode

to
LDR r10, =0xFFFFF014// VICIntEnClear register
LDR r0,=0xFFFFFFFF
STR r0,[r10]
        MSR   CPSR_c,#MODE_SYS|F_BIT// System Mode


Let us know how you get on after making these changes.

Regards,
LPCXpresso Support
0 Kudos
Reply

969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nmariner on Fri May 09 15:53:10 MST 2014
Ok sorry, I will stick with same thread.

If I start with ISP enabled for debug, it has the same effect as erasing full memory and starting debug. This does not seem to change anything, ie: interrupt can hit once at startup but then does not hit.
I notice LPC-Link board LED is always flickering on during run, I assume it's not reading VIC registers as I did read this could cause problems as VIC may think interrupt is in progress so masking other interrupts.
The LPC-Link board I have is one with LPC11U14 REV A. I have removed links for the demo part of the board so I can connect JTAG to board with LPC2368 on.The target board is bespoke design, not demo board. It has been in use with this software before so It is a working board but the JTAG has never been used before for developing on it.
The previous software developer just used debug messages from UARTS and LEDs.
Expresso version is 7.1.1 although 7.0.2 had same results.
This software I am using is totally cut down version of original code to act as test bed.

I have not managed to re-create data abort problem since resetting processor.

Just to update, compiling for release code and running without debug still does not toggle LEDs.

Regards,
Nigel.
0 Kudos
Reply

969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed May 07 12:45:45 MST 2014
Rather than continually creating new threads (which just means we have to keep going hunting for everything that has been said before), it would really help us to help you if you actually tried what we have previously suggested, and also provided us with the other information that we have asked you for…

http://www.lpcware.com/content/forum/lpc2368-vic-inturrupt-not-happening#comment-1137083

But basically…
- Result of powering up with ISP selected before starting a debug session
- LPCXpresso version
- Debug probe
- Target board

With regards to data abort, when you see this, try using the Restart button and seeing if you then end up at main().

Regards,
LPCXpresso Support
0 Kudos
Reply