S32K312: LPUART7 not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K312: LPUART7 not working

Jump to solution
2,678 Views
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

Tags (1)
0 Kudos
Reply
1 Solution
2,622 Views
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.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
4 Replies
2,623 Views
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 Kudos
Reply
2,614 Views
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 Kudos
Reply
2,609 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply
2,576 Views
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 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1995740%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K312%3A%20LPUART7%20not%20working%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%3EI%20am%20working%20on%20a%20project%20that%20uses%20S32K312%20microcontroller.%20While%20working%20on%20the%20dev%20board%20and%20using%20LPUART1%20for%20uart%20communication%2C%20it%20works%20fine%20and%20I%20am%20able%20tom%20see%20the%20required%20output.%3C%2FP%3E%3CP%3EHowever%2C%20my%20project%20needs%20to%20use%20LPUART0.%20So%20when%20I%20try%20to%20use%20LPUART0%2C%20the%20code%20goes%20into%20a%20hard-fault.%20The%20following%20line%20in%3CSTRONG%3E%20Lpuart_Uart_Ip_HwAccess.c%3C%2FSTRONG%3E%20causes%20the%20hard-fault%3A%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%3EThe%20same%20code%20using%20only%20LPUART1%20works%20just%20fine.%3C%2FP%3E%3CP%3EWhat%20could%20be%20the%20issue%3F%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%3ERe%3A%20S32K312%3A%20LPUART7%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1998053%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20%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%2C%3C%2FP%3E%3CP%3EIn%20the%20process%20of%20making%20the%20test%20project%20with%20uart%2C%20the%20issue%20was%20resolved.%20Thank%20you%20for%20the%20support.%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%3ERe%3A%20S32K312%3A%20LPUART7%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1996801%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIf%20it%20is%20convenient%2C%20please%20send%20me%20a%20simple%20test%20project%20for%20a%20quick%20test.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1996798%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K312%3A%20LPUART7%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1996798%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20%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%2C%3C%2FP%3E%3CP%3EThe%20Project%20is%20not%20AUTOSAR%20based.%20The%20clocks%20for%20all%20the%20LPUART%20peripherals%20are%20already%20enabled.%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%3EAnother%20piece%20of%20information%20that%20I%20did%20not%20mention%20in%20the%20query%20is%20that%20currently%20we%20are%20only%20performing%20Transmission%20of%20uart%20messages%2C%20no%20receiving.%20Also%2C%20the%20tx%20is%20a%20synchronous%20tx.%20The%20following%20is%20the%20function%20we%20are%20calling%20for%20the%20same.%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%3ERegards%2C%3C%2FP%3E%3CP%3EHimon%20Koch%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1996714%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K312%3A%20LPUART7%20not%20working%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%3EFor%20projects%20developed%20based%20on%20NON-AUTOSAR%20MCAL%2C%20you%20need%20to%20enable%20the%20clock%20gate%20of%20LPUART7%20in%20%3CEM%3E%3CSTRONG%3EClocks%3C%2FSTRONG%3E%20Tool%3C%2FEM%3E%3A%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%3EFor%20projects%20developed%20based%20on%20AUTOSAR%20MCAL%2C%20you%20need%20to%20enable%20the%20clock%20gate%20of%20LPUART7%20in%20%3CSTRONG%3EMcu%3C%2FSTRONG%3E-%26gt%3B%20%3CSTRONG%3EMcuPeripheral%3C%2FSTRONG%3E%20-%26gt%3B%26nbsp%3B%3CSTRONG%3EPeripheral%20Clock%20Enable%3C%2FSTRONG%3E%20in%20%3CEM%3E%3CSTRONG%3EPeripherals%3C%2FSTRONG%3E%20Tool%3C%2FEM%3E%3A%20refer%20to%20the%20discussion%20in%26nbsp%3B%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%3ES32K312EVB-Q172%20UART%20Example%20not%20working%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EBest%20Regards%2C%3CBR%20%2F%3ERobin%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22ACCEPT%20AS%20SOLUTION%22%20button.%20Thank%20you!%3C%2FP%3E%0A%3CP%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E