Hard fault occurs when use USART4 clocked from XTAL32M - LPC5516

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

Hard fault occurs when use USART4 clocked from XTAL32M - LPC5516

1,701 Views
Mirek_Vaclavek
Contributor I

Hi,

my project is running on LPC5516JBD100. I get hard-fault (sometimes immediatelly, sometimes later) when communication through USART4 is running. Everything is OK when use other USART.

I have tried simple test by writte "AT" (in main loop without interrupt) to USART4 FIFO which was connected to GSM module. Module returned some short answer back. Hard fault has only occured only when Rx pin was physically conected (no hardfault when physically disconnected). I have also tried disabled USART4 Rx pin, but hard fault still occured.

I am using clock source for FLEXCOMM4 from main_clk which is clocked directly from XTAL32M (crystal 16MHz).

I have discovered that when I switch main_clk to be clocked by PLL0 (16MHz) which is clocked by the same source-XTAL32M then everything is OK and no more hard fault occurs.

Can you give me some explanation of my discovery and reason why it crash when use clocing directly from XTAL32M (not through PLL0)?

 

See my clock setings for test:

 - with trouble (first picture)

 - and for test runing without troubles (second one)

 

Mirek_Vaclavek_0-1712826045855.png

Mirek_Vaclavek_2-1712827233850.png

 

 

Mirek

0 Kudos
Reply
1 Reply

1,661 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

From your description, it appears that the uart4 baud rate is incorrect, which leads to the receiver error.

Pls try to use the following clock routine to set up the main_clk, I suppose that the two clock is the same.

I suggest you output the main_clk signal to CLKOUT pin and connect a scope to test the CLKOUT clock and if it is what you expected.

 

xiangjun_rong_0-1712890339936.png

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply