Hard fault occurs when use USART4 clocked from XTAL32M - LPC5516

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Hard fault occurs when use USART4 clocked from XTAL32M - LPC5516

1,709 次查看
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 项奖励
回复
1 回复

1,669 次查看
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 项奖励
回复