problem of program running on flash( interrupts)

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

problem of program running on flash( interrupts)

1,229 Views
fugrace
Contributor III

Hi everyone,

I have solved the e2448 problem on my program without interrupt service routine.But when I apply it on other program with interrupt service,then comes problem.

It jumps to default handler() function.But actually the program works well on RAM.So I really don't know what's the problem.When I step into each line,I found the  problem occurs at the "EnableInterrupts;" which is defined by:  #define EnableInterrupts asm(" CPSIE i");

I'm using K60,CW10.3 ,GCC compiler.

Can anyone give me some hints?Thanks a lot!

Grace

0 Kudos
Reply
4 Replies

1,030 Views
chris_brown
NXP Employee
NXP Employee

Hi Grace,

It sounds like you might have an interrupt pending when you enable interrupts globally but don't have a interrupt service routine defined for that interrupt.  What value is at location 0xE000ED04 when your program jumps to the default handler?

~Chris

0 Kudos
Reply

1,030 Views
fugrace
Contributor III

Chris,

Thank you very much,I guess it has sth with the interrupt service routine.But not because of lack of the routine.

I guess my own interrupt service routine hasn't been located in the vectortable. But actually I make it using:

" __vector_table[INT_FTM0] = (uint32)PWM_ISR  "  on RAM, however it seems not work on Flash,I don't know what's wrong.

Can you give me another help chrisbrown

Thanks

Grace

0 Kudos
Reply

1,030 Views
chris_brown
NXP Employee
NXP Employee

Grace,

Right now, I don't see anything that's immediately obvious.  Could you provide a project?  That would help greatly.

Also, have you been able to get the value at address 0xE000ED04 when your program jumps to the default handler?

Thanks,

Chris

0 Kudos
Reply

1,030 Views
fugrace
Contributor III

Chris,

Sorry for replying late.You mean the register SCB_ICSR ? Before it jumps to the default handler,it's 0,then it turns to 0x84e.I can't find info in the manual ,so I don't know what it means.

It's really very kind of you to help me.I attach my project below.Maybe it's a little hard to find that the interrupt service routine PWM_ISR is initialized in the startup_code\kinetis_sysinit.c in the InterruptVector[78].I changed the former _vector_table[78]=(uint32)PWM_ISR like this.

Thank you very much,if it's too troublesome,I would also be appreciating if you send me a demo with interrupt service running on kinieics flash.


Best regards

Grace

0 Kudos
Reply