Hello,
im using S32k148 and trying to use the LPUART driver from the sdk.
when i initialise the driver : LPUART_DRV_Init(INST_LPUART1, &lpuart1_State, &lpuart1_InitConfig0); the program stuck and does not return, i found the issue in LPUART_Init(), i dont know why it says bus error ?
Regards.
Solved! Go to Solution.
Refer to the "53.4.2 Baud rate generation" of S32K1xx MCU Family - Reference Manual
I can see you select CLK_SRC_SIRC_DIV2 for LPUART ASYNCH Module Clock. The baud rate has nothing to do with your choice of external external 40Mhz clock source. Please send 0x55 or 0xAA and measure the actual baud rate of the TX pin with a logic analyzer or oscilloscope.
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hello Robin,
Thank you for your answer.
the clock gate is enabled in the clockMan1.c file by default
but i needed to change the OSC clock from 8 MHz to 40Mhz since im using an external 40Mhz clock source.
this seems to solve the issue to a certain extent, when i want to receive data in Putty at a baudrate of 115200 i get random char, which means my clock is not correctly configured.
here is a summury of my clock configuration :
LPUAR config
Thank you for your support
Refer to the "53.4.2 Baud rate generation" of S32K1xx MCU Family - Reference Manual
I can see you select CLK_SRC_SIRC_DIV2 for LPUART ASYNCH Module Clock. The baud rate has nothing to do with your choice of external external 40Mhz clock source. Please send 0x55 or 0xAA and measure the actual baud rate of the TX pin with a logic analyzer or oscilloscope.
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Kazarian,
Please check if the clock gate and the selected clock source are enabled: Table 27-9. Peripheral module clocking
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------