This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Crash when 2 UARTs transmit at same time

Hi

I have a problem on a LPC2478 where if I keep transmiting the same data to both UART0 and UART2 at the same time very soon the micro will crash with a prefetch Abort error raised. I beleive this is caused by two different UART transmit interrupts being active at once.

If I transmit the data to just UART0 or UART2 individually then there is never a problem.

I am not intentionally using nested interrupts but I suspect this may be the problem. Can I turn this off as I don't need nested interrupts? or is this off by default and I would need to extra code for nested interrupts.

I also assume the prefetch Abort error can be caused by a stack corruption, is there a way to get a trace of everything up to this error using Keil uVision4?

Any help or suggestions would be appreciated.

Regards
Simon

Parents
  • "My startup code file is LPC2400.s which is the "normal" code generated by the Keil MDK-ARM compiler when creating a new project. There is nothing in there that I am aware of to do with nesting interrupts.

    As I don't need nested interrupts is there a way to turn this off for LPX24xx micros? I cannot see any reference to nested interrupts in the micro datasheet."

    Keil have sample code for the assembler part required for handling nested interrupts. Not sure but it might be written for the LPC21xx processor architecture but the concept is the same.

    But it isn't needed unless your ISR happens to enable interrupts which would allow other interrupts of same or higher priority to step in before the first ISR ends. As long as the ISR doesn't enable interrupts, only the FIQ can step in. And since the FIQ has its own stack, there aren't any need for any special assembler code to support a FIQ nesting on top of an IRQ.

    But with IRQ nesting with IRQ, the standard code will not manage to properly save all registers - it will only save the registers that is shared with the "main-loop" registers.

Reply
  • "My startup code file is LPC2400.s which is the "normal" code generated by the Keil MDK-ARM compiler when creating a new project. There is nothing in there that I am aware of to do with nesting interrupts.

    As I don't need nested interrupts is there a way to turn this off for LPX24xx micros? I cannot see any reference to nested interrupts in the micro datasheet."

    Keil have sample code for the assembler part required for handling nested interrupts. Not sure but it might be written for the LPC21xx processor architecture but the concept is the same.

    But it isn't needed unless your ISR happens to enable interrupts which would allow other interrupts of same or higher priority to step in before the first ISR ends. As long as the ISR doesn't enable interrupts, only the FIQ can step in. And since the FIQ has its own stack, there aren't any need for any special assembler code to support a FIQ nesting on top of an IRQ.

    But with IRQ nesting with IRQ, the standard code will not manage to properly save all registers - it will only save the registers that is shared with the "main-loop" registers.

Children
No data