USART3 and USART4 not working on LPC845

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

USART3 and USART4 not working on LPC845

1,415 Views
nxp19
Contributor II

I've setup USART1-4 (USART0 configured for debugger output) but can only get Data through USART1 and 2. 3 and 4 cause the MCU to lock up and freeze.


init before my main loop is the same for all USART

PRINTF("Init started\n\r");

USART_TransferCreateHandle(usart_3, &usart3_handle, USARTUserCallback, &callbackUserData3);

PRINTF("Handle created\n\r");

USART_TransferStartRingBuffer(usart_3, &usart13_handle, ringBuffer3, 100);

PRINTF("Init finished\n\r");

Both messages are printed, but when the USART recives data / sends data on 3 or 4 the MCU frezes up and dosn't react to anything. But also there is no stack trace.
When I try to stop the program in debug mode, it seems to always be inside the interrupts. Breakpoints in the main loop never fire after "hanging".

Pins and Clock are configured with the Configuration Tool and looks correct:

#define USART4_PERIPHERAL ((USART_Type *)USART4)
#define USART4_CLOCK_SOURCE 18000000UL

    SWM_SetMovablePinSelect(SWM0, kSWM_USART3_TXD, kSWM_PortPin_P0_19);

    SWM_SetMovablePinSelect(SWM0, kSWM_USART3_RXD, kSWM_PortPin_P0_18);

    SWM_SetMovablePinSelect(SWM0, kSWM_USART4_TXD, kSWM_PortPin_P0_15);
    SWM_SetMovablePinSelect(SWM0, kSWM_USART4_RXD, kSWM_PortPin_P0_14);

Labels (2)
0 Kudos
6 Replies

1,263 Views
nxp19
Contributor II

Finaly found the root cause. There was an interupt conflict with the PINT component. After removing PINT everything worked as expected.

0 Kudos

1,263 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello  Burghard Bode ,

Please send your whole project , I will help you check it.

If it can't public, you can send me a private message. 

Regards,

Alice

0 Kudos

1,263 Views
nxp19
Contributor II

Find the test project here: Project zipped

0 Kudos

1,263 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Burghard,

I create a simple project for you , use UART3, TX-PIO0_18, TX-PIO0_19 as your code,

the UART3 can work well on my side, you can refer it to check your code.

Hope it helps,

Alice

0 Kudos

1,263 Views
nxp19
Contributor II

This code does use the blocking interface, not the interupt functions. I debugged my code further and it seems to be stuck in an endless loop inside PIN_INT6_USART3_IRQHandler. - But the interupt handler is not called in the blocking functions.

0 Kudos

1,263 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Burghard,

You can create a simple project, use MCUXpresso Config tool to config , or you can change code in UART demo under SDK. Then porting code into your project.

I add UART3 configration to SDK demo “lpcxpresso845max_usart_transfer_interrupt”, just test USART_TransferSendNonBlocking() function, it can send word successfully.

Regards,

Alice

0 Kudos