MCXA153VLH LPUART INTERRUPT

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

MCXA153VLH LPUART INTERRUPT

Jump to solution
2,624 Views
_Ferrari_
Contributor V

I'm developing a project based on the MCXA153VLH microprocessor.

It needs to receive data serially using the LPUART1 peripheral in interrupt mode.

_Ferrari__0-1754062818351.png

 

Upon receiving data, a dedicated interrupt routine named Rs485Interrupt should be called.

_Ferrari__1-1754062881026.png

 

I've debugged the code, and the interrupt handler is called correctly,

_Ferrari__2-1754062913014.png

 

but the s_lpuartIsr array is not initialized, and the program crashes.

_Ferrari__4-1754063033454.png

 

Have you experienced a similar issue? How did you solve it?

Thank you very much for your help and cooperation

regards

Tags (3)
0 Kudos
Reply
1 Solution
2,583 Views
_Ferrari_
Contributor V

Thanks for your help, Habib_MS. I found the solution to the problem. It was because my interrupt handling routine was in a .cpp file.

Changing the file extension from .cpp to .c solved the issue.

View solution in original post

0 Kudos
Reply
2 Replies
2,596 Views
Habib_MS
NXP Employee
NXP Employee

Hello @_Ferrari_,

You need to redefine the IRQ, as explained in the tooltip that appears when you hover over the option:

Habib_MS_0-1754339824589.png

To help with this, you can use the name that you assign to the IRQ handler. for example, the default name "LPUART1_SERIAL_RX_TX_IRQHANDLER", which can be found in peripherals.h:

Habib_MS_1-1754339834965.png

Additionally, I recommend see the SDK (version 25.6) example titled "lpuart_interrupt". It demonstrates how to properly configure an interrupt and provides a good reference for understanding how it works.

BR
Habib.

0 Kudos
Reply
2,584 Views
_Ferrari_
Contributor V

Thanks for your help, Habib_MS. I found the solution to the problem. It was because my interrupt handling routine was in a .cpp file.

Changing the file extension from .cpp to .c solved the issue.

0 Kudos
Reply