HardFault Error While Init Clock

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

HardFault Error While Init Clock

491 Views
daoph
Contributor I

Hi,

 

I am facing a problem while configuring the S32K344. Without I2C MCAL configuration, I can go to debug mode. However, when I add I2C MCAL configuration, I got the following error:

MemManage: The processor attempted an instruction fetch from a location that does not permit execution.

while Mcu_InitClock(McuClockSettingConfig_0) was called. Could you please help? I attached the project here.

I'm using S32K3X4EVB

0 Kudos
Reply
3 Replies

456 Views
daoph
Contributor I

Thanks for your reply,

 

I already enable the PLL & I2C peripheral clock, but the problem still persist.

daoph_0-1762837917813.png

 

0 Kudos
Reply

199 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Thank you for your patience.
Here is the reply from Software Team:

I checked the example after adding I2C, I see that the section int_sram_no_cacheable was overflowed Because I2C used quite larger spaces in that section.

The solution is that reduces using int_sram_no_cacheable

E.g: in the file ethif_port.c,  you can also remove the statement:  " __attribute__ ((section (".int_sram_no_cacheable")))" as below

__attribute__ ((section (".int_sram_no_cacheable")))

VAR_ALIGN(uint8 ethif_DataBuffer[ETH_RXBD_NUM * ETH_43_ETH_MAX_RXBUFFLEN_SUPPORTED], 64);

BTW, Please remove the preprocessor: "D_CACHE_ENABLE" if ping cannot work

Please remove D_CACHE_ENABLE if the ping cannot work LWIP_I2C.png

0 Kudos
Reply

461 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi 

Please configure the McuPeripheral -> Peripheral Clock Enable

Hope it helps.


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
%3CLINGO-SUB%20id%3D%22lingo-sub-2202296%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHardFault%20Error%20While%20Init%20Clock%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202296%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20am%20facing%20a%20problem%20while%20configuring%20the%20S32K344.%20Without%20I2C%20MCAL%20configuration%2C%20I%20can%20go%20to%20debug%20mode.%20However%2C%20when%20I%20add%20I2C%20MCAL%20configuration%2C%20I%20got%20the%20following%20error%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EMemManage%3A%20The%20processor%20attempted%20an%20instruction%20fetch%20from%20a%20location%20that%20does%20not%20permit%20execution.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3Ewhile%20Mcu_InitClock(%3CSPAN%3EMcuClockSettingConfig_0%3C%2FSPAN%3E)%20was%20called.%20Could%20you%20please%20help%3F%20I%20attached%20the%20project%20here.%3C%2FP%3E%3CP%3EI'm%20using%20S32K3X4EVB%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2202350%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HardFault%20Error%20While%20Init%20Clock%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202350%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%20for%20your%20reply%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20already%20enable%20the%20PLL%20%26amp%3B%20I2C%20peripheral%20clock%2C%20but%20the%20problem%20still%20persist.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22daoph_0-1762837917813.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22daoph_0-1762837917813.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22daoph_0-1762837917813.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364822iFF82E70B0EE1DFEA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22daoph_0-1762837917813.png%22%20alt%3D%22daoph_0-1762837917813.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2202335%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HardFault%20Error%20While%20Init%20Clock%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202335%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%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%3CSPAN%3EPlease%20configure%20the%20McuPeripheral%20-%26gt%3B%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EPeripheral%20Clock%20Enable%3C%2FSTRONG%3E%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EHope%20it%20helps.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%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%3CLINGO-SUB%20id%3D%22lingo-sub-2256629%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HardFault%20Error%20While%20Init%20Clock%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2256629%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20for%20your%20patience.%3CBR%20clear%3D%22none%22%20%2F%3EHere%20is%20the%20reply%20from%20Software%20Team%3A%3C%2FP%3E%0A%3CP%3EI%20checked%20the%20example%20after%20adding%20I2C%2C%20I%20see%20that%20the%20section%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eint_sram_no_cacheable%20was%20overflowed%20Because%20I2C%20used%20quite%20larger%20spaces%20in%20that%20section.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20solution%20is%20that%20reduces%20using%26nbsp%3Bint_sram_no_cacheable%3CBR%20clear%3D%22none%22%20%2F%3E%3CBR%20clear%3D%22none%22%20%2F%3EE.g%3A%20in%20the%20file%20ethif_port.c%2C%26nbsp%3B%20you%20can%20also%20remove%20the%20statement%3A%26nbsp%3B%20%22%26nbsp%3B__attribute__%20((section%20(%22.int_sram_no_cacheable%22)))%22%20as%20below%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%0A%3CP%3E%3CSPAN%3E__attribute__%20((section%20(%22.int_sram_%3C%2FSPAN%3E%3CSPAN%3Eno_cacheable%3C%2FSPAN%3E%3CSPAN%3E%22)))%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EVAR_ALIGN(%3C%2FSPAN%3E%3CSPAN%3Euint8%3C%2FSPAN%3E%3CSPAN%3E%20ethif_DataBuffer%5BETH_RXBD_NUM%20*%20ETH_43_ETH_MAX_RXBUFFLEN_SUPPORTED%5D%2C%2064)%3B%3CBR%20clear%3D%22none%22%20%2F%3E%3CBR%20clear%3D%22none%22%20%2F%3EBTW%2C%20Please%20remove%20the%20preprocessor%3A%20%22D_CACHE_ENABLE%22%20if%20ping%20cannot%20work%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Please%20remove%20D_CACHE_ENABLE%20if%20the%20ping%20cannot%20work%20LWIP_I2C.png%22%20style%3D%22width%3A%20952px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Please%20remove%20D_CACHE_ENABLE%20if%20the%20ping%20cannot%20work%20LWIP_I2C.png%22%20style%3D%22width%3A%20952px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F368866i14EB8445107AE469%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Please%20remove%20D_CACHE_ENABLE%20if%20the%20ping%20cannot%20work%20LWIP_I2C.png%22%20alt%3D%22Please%20remove%20D_CACHE_ENABLE%20if%20the%20ping%20cannot%20work%20LWIP_I2C.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E