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
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.
Hope it can help you
BR
XiangJun Rong