k32l2b31 writing to LPUART1->STAT |= (1<<25) cause semihost_hardfault

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

k32l2b31 writing to LPUART1->STAT |= (1<<25) cause semihost_hardfault

939 Views
plefebvre1
Contributor I

i want to activate LIN Break detection on k32l2b31 

bit LKDE must be set in status register

i try LPUART1->STAT |= (1<<25)

but it appear "semihost_hardfault" on debug

who knows why ?

best regards

0 Kudos
Reply
2 Replies

265 Views
mianjay
Contributor I

The "semihost_hardfault" when activating LIN break detection on the K32L2B31 most certainly suggests a problem that extends beyond simply setting the 'LKDE' bit. Possible causes include faulty LPUART clock configuration, accessing the peripheral before proper activation, memory access violations caused by an invalid base address, wrongly configured LIN break interrupts without a handler, or problems with the debugger/semihosting configuration. Before enabling LIN break detection, debug the initialization code, validate the base address, step through code with a debugger, check interrupts, simplify your code, and reference the datasheet to guarantee proper peripheral configuration. pa turnpike ez pass login

0 Kudos
Reply

813 Views
patricia845
Contributor I

The "semihost_hardfault" when enabling LIN break detection on the K32L2B31 likely indicates a problem beyond just setting the `LKDE` bit. Potential causes include incorrect LPUART clock configuration, accessing the peripheral before proper initialization, memory access violations due to a wrong base address, improperly configured LIN break interrupts without a handler, or issues with the debugger/semihosting setup. Debug by reviewing initialization code, verifying the base address, stepping through code with a debugger, checking interrupts, simplifying your code, and consulting the datasheet to ensure correct peripheral setup before enabling LIN break detection.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2045419%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ek32l2b31%20writing%20to%20LPUART1-%26gt%3BSTAT%20%7C%3D%20(1%26lt%3B%26lt%3B25)%20cause%20semihost_hardfault%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2045419%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ei%20want%20to%20activate%20LIN%20Break%20detection%20on%20k32l2b31%26nbsp%3B%3C%2FP%3E%3CP%3Ebit%20LKDE%20must%20be%20set%20in%20status%20register%3C%2FP%3E%3CP%3Ei%20try%26nbsp%3BLPUART1-%26gt%3BSTAT%20%7C%3D%20(1%26lt%3B%26lt%3B25)%3C%2FP%3E%3CP%3Ebut%20it%20appear%20%22semihost_hardfault%22%20on%20debug%3C%2FP%3E%3CP%3Ewho%20knows%20why%20%3F%3C%2FP%3E%3CP%3Ebest%20regards%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2185012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20k32l2b31%20writing%20to%20LPUART1-%26gt%3BSTAT%20%7C%3D%20(1%26lt%3B%26lt%3B25)%20cause%20semihost_hardfault%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2185012%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20%22semihost_hardfault%22%20when%20activating%20LIN%20break%20detection%20on%20the%20K32L2B31%20most%20certainly%20suggests%20a%20problem%20that%20extends%20beyond%20simply%20setting%20the%20'LKDE'%20bit.%20Possible%20causes%20include%20faulty%20LPUART%20clock%20configuration%2C%20accessing%20the%20peripheral%20before%20proper%20activation%2C%20memory%20access%20violations%20caused%20by%20an%20invalid%20base%20address%2C%20wrongly%20configured%20LIN%20break%20interrupts%20without%20a%20handler%2C%20or%20problems%20with%20the%20debugger%2Fsemihosting%20configuration.%20Before%20enabling%20LIN%20break%20detection%2C%20debug%20the%20initialization%20code%2C%20validate%20the%20base%20address%2C%20step%20through%20code%20with%20a%20debugger%2C%20check%20interrupts%2C%20simplify%20your%20code%2C%20and%20reference%20the%20datasheet%20to%20guarantee%20proper%20peripheral%20configuration.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fezpass-pa.site%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E%3CSPAN%20class%3D%22%22%3Epa%20turnpike%20ez%20pass%20login%3C%2FSPAN%3E%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2095298%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20k32l2b31%20writing%20to%20LPUART1-%26gt%3BSTAT%20%7C%3D%20(1%26lt%3B%26lt%3B25)%20cause%20semihost_hardfault%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2095298%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20%22semihost_hardfault%22%20when%20enabling%20LIN%20break%20detection%20on%20the%20K32L2B31%20likely%20indicates%20a%20problem%20beyond%20just%20setting%20the%20%60LKDE%60%20bit.%20Potential%20causes%20include%20incorrect%20LPUART%20clock%20configuration%2C%20accessing%20the%20peripheral%20before%20proper%20initialization%2C%20memory%20access%20violations%20due%20to%20a%20wrong%20base%20address%2C%20improperly%20configured%20LIN%20break%20interrupts%20without%20a%20handler%2C%20or%20issues%20with%20the%20debugger%2Fsemihosting%20setup.%20Debug%20by%20reviewing%20initialization%20code%2C%20verifying%20the%20base%20address%2C%20stepping%20through%20code%20with%20a%20debugger%2C%20checking%20interrupts%2C%20simplifying%20your%20code%2C%20and%20consulting%20the%20datasheet%20to%20ensure%20correct%20peripheral%20setup%20before%20enabling%20LIN%20break%20detection.%3C%2FP%3E%3C%2FLINGO-BODY%3E