S32K312: LPUART7 not working

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

S32K312: LPUART7 not working

跳至解决方案
2,680 次查看
himonkoch
Contributor III

Hi,

I am working on a project that uses S32K312 microcontroller. While working on the dev board and using LPUART1 for uart communication, it works fine and I am able tom see the required output.

However, my project needs to use LPUART0. So when I try to use LPUART0, the code goes into a hard-fault. The following line in Lpuart_Uart_Ip_HwAccess.c causes the hard-fault:

himonkoch_0-1731767256426.pnghimonkoch_0-1731767256426.png

 

The same code using only LPUART1 works just fine.

What could be the issue?

 

S32K312EVB-Q172

标记 (1)
0 项奖励
回复
1 解答
2,624 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

For projects developed based on NON-AUTOSAR MCAL, you need to enable the clock gate of LPUART7 in Clocks Tool:

LPUART clock gate enable Clocks Tool S32K312.jpgLPUART clock gate enable Clocks Tool S32K312.jpg

 

For projects developed based on AUTOSAR MCAL, you need to enable the clock gate of LPUART7 in Mcu-> McuPeripheral -> Peripheral Clock Enable in Peripherals Tool: refer to the discussion in S32K312EVB-Q172 UART Example not working

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "ACCEPT AS SOLUTION" 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.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,625 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

For projects developed based on NON-AUTOSAR MCAL, you need to enable the clock gate of LPUART7 in Clocks Tool:

LPUART clock gate enable Clocks Tool S32K312.jpgLPUART clock gate enable Clocks Tool S32K312.jpg

 

For projects developed based on AUTOSAR MCAL, you need to enable the clock gate of LPUART7 in Mcu-> McuPeripheral -> Peripheral Clock Enable in Peripherals Tool: refer to the discussion in S32K312EVB-Q172 UART Example not working

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "ACCEPT AS SOLUTION" 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.
-------------------------------------------------------------------------------

0 项奖励
回复
2,616 次查看
himonkoch
Contributor III

Hello @Robin_Shen ,

The Project is not AUTOSAR based. The clocks for all the LPUART peripherals are already enabled.

himonkoch_0-1731991800767.pnghimonkoch_0-1731991800767.png

 

Another piece of information that I did not mention in the query is that currently we are only performing Transmission of uart messages, no receiving. Also, the tx is a synchronous tx. The following is the function we are calling for the same.

himonkoch_1-1731991980419.pnghimonkoch_1-1731991980419.png

 

Regards,

Himon Koch

0 项奖励
回复
2,611 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

If it is convenient, please send me a simple test project for a quick test.

0 项奖励
回复
2,578 次查看
himonkoch
Contributor III

Hello @Robin_Shen ,

In the process of making the test project with uart, the issue was resolved. Thank you for the support.

 

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1995740%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K312%3ALPUART7%E4%B8%8D%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1995740%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BB%8E%E4%BA%8B%E4%B8%80%E4%B8%AA%E4%BD%BF%E7%94%A8%20S32K312%20%E5%BE%AE%E6%8E%A7%E5%88%B6%E5%99%A8%E7%9A%84%E9%A1%B9%E7%9B%AE%E3%80%82%E5%9C%A8%E5%BC%80%E5%8F%91%E6%9D%BF%E4%B8%8A%E5%B7%A5%E4%BD%9C%E5%B9%B6%E4%BD%BF%E7%94%A8%20LPUART1%20%E8%BF%9B%E8%A1%8C%20uart%20%E9%80%9A%E4%BF%A1%E6%97%B6%EF%BC%8C%E5%AE%83%E8%BF%90%E8%A1%8C%E8%89%AF%E5%A5%BD%EF%BC%8C%E6%88%91%E8%83%BD%E5%A4%9F%E7%9C%8B%E5%88%B0%E6%89%80%E9%9C%80%E7%9A%84%E8%BE%93%E5%87%BA%E3%80%82%3C%2FP%3E%3CP%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E6%88%91%E7%9A%84%E9%A1%B9%E7%9B%AE%E9%9C%80%E8%A6%81%E4%BD%BF%E7%94%A8LPUART0%E3%80%82%E5%9B%A0%E6%AD%A4%EF%BC%8C%E5%BD%93%E6%88%91%E5%B0%9D%E8%AF%95%E4%BD%BF%E7%94%A8%20LPUART0%20%E6%97%B6%EF%BC%8C%E4%BB%A3%E7%A0%81%E4%BC%9A%E5%87%BA%E7%8E%B0%E7%A1%AC%E6%95%85%E9%9A%9C%E3%80%82%3CSTRONG%3ELpuart_Uart_Ip_HwAccess.c%3C%2FSTRONG%3E%E4%B8%AD%E7%9A%84%E4%BB%A5%E4%B8%8B%E8%A1%8C%E5%AF%BC%E8%87%B4%E7%A1%AC%E6%95%85%E9%9A%9C%EF%BC%9A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22himonkoch_0-1731767256426.png%22%20style%3D%22width%3A%20712px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22himonkoch_0-1731767256426.png%22%20style%3D%22width%3A%20712px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310885i7FAA2DEB3447EDD6%2Fimage-dimensions%2F712x116%3Fv%3Dv2%22%20width%3D%22712%22%20height%3D%22116%22%20role%3D%22button%22%20title%3D%22himonkoch_0-1731767256426.png%22%20alt%3D%22himonkoch_0-1731767256426.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ehimonkoch_0-1731767256426.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E4%BB%85%E4%BD%BF%E7%94%A8%20LPUART1%20%E7%9A%84%E7%9B%B8%E5%90%8C%E4%BB%A3%E7%A0%81%E5%B0%B1%E5%8F%AF%E4%BB%A5%E6%AD%A3%E5%B8%B8%E5%B7%A5%E4%BD%9C%E3%80%82%3C%2FP%3E%3CP%3E%E5%8F%AF%E8%83%BD%E5%AD%98%E5%9C%A8%E4%BB%80%E4%B9%88%E9%97%AE%E9%A2%98%EF%BC%9F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FS32K312EVB-Q172%2Fpd-p%2FS32K312EVB-Q172%22%20class%3D%22lia-product-mention%22%20data-product%3D%223493-1%22%20target%3D%22_blank%22%3ES32K312EVB-Q172%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1998053%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9AS32K312%3ALPUART7%E4%B8%8D%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1998053%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F57959%22%20target%3D%22_blank%22%3E%40Robin_Shen%3C%2FA%3E%20%EF%BC%8C%3C%2FP%3E%3CP%3E%E5%9C%A8%E7%94%A8uart%E5%88%B6%E4%BD%9C%E6%B5%8B%E8%AF%95%E9%A1%B9%E7%9B%AE%E7%9A%84%E8%BF%87%E7%A8%8B%E4%B8%AD%EF%BC%8C%E8%AF%A5%E9%97%AE%E9%A2%98%E5%B7%B2%E5%BE%97%E5%88%B0%E8%A7%A3%E5%86%B3%E3%80%82%E8%B0%A2%E8%B0%A2%E5%A4%A7%E5%AE%B6%E7%9A%84%E6%94%AF%E6%8C%81%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1996801%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9AS32K312%3ALPUART7%E4%B8%8D%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1996801%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%A6%82%E6%9E%9C%E6%96%B9%E4%BE%BF%E7%9A%84%E8%AF%9D%EF%BC%8C%E8%AF%B7%E5%8F%91%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E6%B5%8B%E8%AF%95%E9%A1%B9%E7%9B%AE%E7%BB%99%E6%88%91%EF%BC%8C%E4%BB%A5%E4%BE%BF%E5%BF%AB%E9%80%9F%E6%B5%8B%E8%AF%95%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1996798%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9AS32K312%3ALPUART7%E4%B8%8D%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1996798%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F57959%22%20target%3D%22_blank%22%3E%40Robin_Shen%3C%2FA%3E%20%EF%BC%8C%3C%2FP%3E%3CP%3E%E8%AF%A5%E9%A1%B9%E7%9B%AE%E4%B8%8D%E6%98%AF%E5%9F%BA%E4%BA%8E%20AUTOSAR%E3%80%82%E6%89%80%E6%9C%89%20LPUART%20%E5%A4%96%E8%AE%BE%E7%9A%84%E6%97%B6%E9%92%9F%E5%9D%87%E5%B7%B2%E5%90%AF%E7%94%A8%E3%80%82%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22himonkoch_0-1731991800767.png%22%20style%3D%22width%3A%20692px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22himonkoch_0-1731991800767.png%22%20style%3D%22width%3A%20692px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F311143i15A7969C54089760%2Fimage-dimensions%2F692x180%3Fv%3Dv2%22%20width%3D%22692%22%20height%3D%22180%22%20role%3D%22button%22%20title%3D%22himonkoch_0-1731991800767.png%22%20alt%3D%22himonkoch_0-1731991800767.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ehimonkoch_0-1731991800767.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E6%88%91%E5%9C%A8%E6%9F%A5%E8%AF%A2%E4%B8%AD%E6%B2%A1%E6%9C%89%E6%8F%90%E5%88%B0%E7%9A%84%E5%8F%A6%E4%B8%80%E6%9D%A1%E4%BF%A1%E6%81%AF%E6%98%AF%EF%BC%8C%E7%9B%AE%E5%89%8D%E6%88%91%E4%BB%AC%E5%8F%AA%E6%89%A7%E8%A1%8C%20uart%20%E6%B6%88%E6%81%AF%E7%9A%84%E4%BC%A0%E8%BE%93%EF%BC%8C%E6%B2%A1%E6%9C%89%E6%8E%A5%E6%94%B6%E3%80%82%E6%AD%A4%E5%A4%96%EF%BC%8C%E8%AF%A5%20tx%20%E6%98%AF%E5%90%8C%E6%AD%A5%20tx%E3%80%82%E4%BB%A5%E4%B8%8B%E6%98%AF%E6%88%91%E4%BB%AC%E4%B8%BA%E6%AD%A4%E8%B0%83%E7%94%A8%E7%9A%84%E5%87%BD%E6%95%B0%E3%80%82%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22himonkoch_1-1731991980419.png%22%20style%3D%22width%3A%20702px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22himonkoch_1-1731991980419.png%22%20style%3D%22width%3A%20702px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F311144iE05651E40353636B%2Fimage-dimensions%2F702x309%3Fv%3Dv2%22%20width%3D%22702%22%20height%3D%22309%22%20role%3D%22button%22%20title%3D%22himonkoch_1-1731991980419.png%22%20alt%3D%22himonkoch_1-1731991980419.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ehimonkoch_1-1731991980419.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E6%AD%A4%E8%87%B4%EF%BC%8C%3C%2FP%3E%3CP%3E%E5%B8%8C%E8%92%99%C2%B7%E7%A7%91%E8%B5%AB%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1996714%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9AS32K312%3ALPUART7%E4%B8%8D%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1996714%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EHi%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E5%AF%B9%E4%BA%8E%E5%9F%BA%E4%BA%8ENON-AUTOSAR%20MCAL%E5%BC%80%E5%8F%91%E7%9A%84%E9%A1%B9%E7%9B%AE%EF%BC%8C%E9%9C%80%E8%A6%81%E5%9C%A8%3CEM%3E%3CSTRONG%3EClocks%3C%2FSTRONG%3E%20Tool%3C%2FEM%3E%E4%B8%AD%E5%BC%80%E5%90%AFLPUART7%E7%9A%84%E6%97%B6%E9%92%9F%E9%97%A8%E6%8E%A7%EF%BC%9A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LPUART%20clock%20gate%20enable%20Clocks%20Tool%20S32K312.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LPUART%20clock%20gate%20enable%20Clocks%20Tool%20S32K312.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F311119i899414EDA10B9BCE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22LPUART%20clock%20gate%20enable%20Clocks%20Tool%20S32K312.jpg%22%20alt%3D%22LPUART%20clock%20gate%20enable%20Clocks%20Tool%20S32K312.jpg%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ELPUART%20clock%20gate%20enable%20Clocks%20Tool%20S32K312.jpg%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%E5%AF%B9%E4%BA%8E%E5%9F%BA%E4%BA%8E%20AUTOSAR%20MCAL%20%E5%BC%80%E5%8F%91%E7%9A%84%E9%A1%B9%E7%9B%AE%EF%BC%8C%E9%9C%80%E8%A6%81%E5%9C%A8%3CSTRONG%3E%E2%80%9CMcu%3C%2FSTRONG%3E%20-%26gt%3B%20%3CSTRONG%3EMcuPeripheral%3C%2FSTRONG%3E%20-%26gt%3B%20%3CSTRONG%3EPeripherals%20Clock%20Enable%E2%80%9D%3C%2FSTRONG%3E%20%3CEM%3E%3CSTRONG%3E%EF%BC%88%E5%A4%96%E8%AE%BE%3C%2FSTRONG%3E%E5%B7%A5%E5%85%B7%3C%2FEM%3E%E4%B8%AD%E7%9A%84%E2%80%9C%E5%A4%96%E8%AE%BE%E6%97%B6%E9%92%9F%E5%90%AF%E7%94%A8%E2%80%9D%EF%BC%89%E4%B8%AD%E5%90%AF%E7%94%A8%20LPUART7%20%E7%9A%84%E6%97%B6%E9%92%9F%E9%97%A8%EF%BC%9A%E8%AF%B7%E5%8F%82%E9%98%85%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FS32K312EVB-Q172-UART-Example-not-working%2Ftd-p%2F1762274%22%20target%3D%22_self%22%3E%E2%80%9CS32K312EVB-Q172%20UART%20%E7%A4%BA%E4%BE%8B%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%E2%80%9D%3C%2FA%3E%E4%B8%AD%E7%9A%84%E8%AE%A8%E8%AE%BA%3C%2FP%3E%0A%3CP%3E%E6%AD%A4%E8%87%B4%EF%BC%8C%3CBR%20%2F%3E%E7%BD%97%E5%AE%BE%3CBR%20%2F%3E--------------------------------------------------------------------------------%3CBR%20%2F%3E%E7%AC%94%E8%AE%B0%EF%BC%9A%3CBR%20%2F%3E%20-%20%E5%A6%82%E6%9E%9C%E8%BF%99%E7%AF%87%E6%96%87%E7%AB%A0%E5%9B%9E%E7%AD%94%E4%BA%86%E6%82%A8%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%8C%E8%AF%B7%E7%82%B9%E5%87%BB%E2%80%9C%E6%8E%A5%E5%8F%97%E4%B8%BA%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E2%80%9D%E6%8C%89%E9%92%AE%E3%80%82%E8%B0%A2%E8%B0%A2%E4%BD%A0%EF%BC%81%3C%2FP%3E%0A%3CP%3E-%20%E6%88%91%E4%BB%AC%E4%BC%9A%E5%85%B3%E6%B3%A8%E4%B8%8A%E6%AC%A1%E5%8F%91%E5%B8%96%E5%90%8E%E4%B8%83%E5%91%A8%E7%9A%84%E5%B8%96%E5%AD%90%EF%BC%8C%E4%B9%8B%E5%90%8E%E7%9A%84%E5%9B%9E%E5%A4%8D%E5%B0%86%E8%A2%AB%E5%BF%BD%E7%95%A5%3CBR%20%2F%3E%E5%A6%82%E6%9E%9C%E6%82%A8%E7%A8%8D%E5%90%8E%E6%9C%89%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%EF%BC%8C%E8%AF%B7%E6%89%93%E5%BC%80%E4%B8%80%E4%B8%AA%E6%96%B0%E7%BA%BF%E7%A8%8B%E5%B9%B6%E5%8F%82%E8%80%83%E5%B7%B2%E5%85%B3%E9%97%AD%E7%9A%84%E7%BA%BF%E7%A8%8B%E3%80%82%3CBR%20%2F%3E--------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E