Hello dear community!
Our HW guys decided to switch from K20 to K22. I started to adopt my code to this new MCU, but stuck right at the beginning. I get forced hard fault on writing to UART0_AP7816A_T0 during UART0 initialization. The code was generated by PE and it pretty straightforward:
/* UART0_WF7816: GTFD=1 */
UART0_WF7816 = UART_WF7816_GTFD(0x01);
/* UART0_ET7816: TXTHRESHOLD=0,RXTHRESHOLD=0 */
UART0_ET7816 = (UART_ET7816_TXTHRESHOLD(0x00) | UART_ET7816_RXTHRESHOLD(0x00));
/* UART0_AP7816A_T0: ADTI_H=0 */
UART0_AP7816A_T0 = UART_AP7816A_T0_ADTI_H(0x00);
This happens right in the PE_low_level_init() and only generated code is executed before this fault. Can someone shed a light on this behaviour? Maybe I am missing some simple thing? Or maybe it is a hardware problem?