Re: Help needed with SCI interrupts (HC12)



On Jun 28, 2:58 pm, cs_post...@xxxxxxxxxxx wrote:
Please describe what you mean by crashes. For example, does it jump
to an arbitrary address outside of the program and thus trigger the
software trap debugging interrupt?

I`m sorry for my ignorance, but how can I check this?


What is your debuger and target connection?

I`m using Serial Monitor debugger, and Monitor as Target in
Codewarrior IDE 5.7.
Sorry for not referring to these information earlier.


You need to have a non-banked memory section in your linker .prm file
(assuming codewarrior) which will not be banked switch and thus always
reliably there when an interrupt occurs, and you need to put your
interrupt service routine and anything that it might call in that
section.

If you are using the .prm from the connector app, this section is
called NON_BANKED
so you would precede your ISR and anything it uses with a

#pragma CODE_SEG NON_BANKED

and follow it with a

#pragma CODE_SEG DEFAULT

This is my case..

#pragma CODE_SEG NON_BANKED
interrupt void SCI1Interrupt (void) {
SCI1_isr_handler();
}
#pragma CODE_SEG DEFAULT


Also make sure that you are getting the address of the ISR correctly
loaded into the vector table. In the connector app, vectors.c does
that and would need to reference your ISR.

in Vectors.c
-------------------------
....
SCI1Interrupt, /* 38 Default (unused) interrupt */
.....


I believe SCI1 is supposed to be Interrupt Vector No. 21. But how do I
clarify that my specific interrupt is triggered by that?

Thank you for your support so far.

.



Relevant Pages

  • Re: about the #pragma
    ... #pragma intterupt Timer ... implementation-defined manner" (except for a few of the form ... A function called as an ISR (interrupt service routine) may be called ... compiler will generate for a function, making it save (and restore on ...
    (comp.lang.c)
  • Re: kernel panic with pccard insert on recent 7.0 CURRENT
    ... We know if an interrupt source is edge or level ... It falls back to a level trigger emulation if it can't. ... Run A's handler, it claims the interrupt, so schedule A's ithread if ...
    (freebsd-current)
  • Re: [KVM PATCH v4 2/2] kvm: add support for irqfd via eventfd-notification interface
    ... The non-default mode is to trigger a ... I would really like to keep using eventfd. ... But we'd still need to know when to lower the interrupt. ... IIUC, isn't that usually device/subsystem specific, and out of scope of ...
    (Linux-Kernel)
  • Re: TL16C550CIFN
    ... verify this UART's DMA function,but the /RXRDY goes true when there is ... IIRC most cacheing UARTs will allow you to adjust the trigger point ... Thus once an interrupt occurs the service can ... or more characters in the FIFO and more than three character ...
    (comp.arch.embedded)
  • Re: Lenovo 3000 N100 i8042 problems
    ... hardware that only applies to legacy mode, ... internally we the kernel still deals with 2 interrupt ... Does it take long to trigger the bug? ... This has me typing some unimportant stuff, and then it sticks, ...
    (Linux-Kernel)