HardFault Issue When Integrating Ethernet and FlexSPI Modules in Baremetal Project

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

HardFault Issue When Integrating Ethernet and FlexSPI Modules in Baremetal Project

2,670 Views
PavanKumarS
Contributor II

Hello,

I’m working on a baremetal project that integrates both the Ethernet module and the FlexSPI module on the MIMXRT1180-EVK. I am facing a HardFault issue when trying to initialize the Ethernet module.

The program execution crashes at the following line:

enet_config.srcClockHz = EXAMPLE_CLOCK_FREQ;

Observations:

  1. When I test the Ethernet module in a separate project, it works without any issues.
  2. However, when integrating it with the FlexSPI module in the same project, I encounter this HardFault.

I’ve attached a screenshot of the HardFault state for reference.

Any debugging tips or insights into resolving this issue would be highly appreciated.

Thank you in advance!

 

Labels (1)
0 Kudos
Reply
3 Replies

2,644 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @PavanKumarS 

The line enet_config.srcClockHz = EXAMPLE_CLOCK_FREQ; suggests that the source clock for the Ethernet module might be incorrectly configured or conflicting with the FlexSPI module’s clock settings.

Verify the clock configurations for both Ethernet and FlexSPI in your project.

BR

Harry

0 Kudos
Reply

2,604 Views
PavanKumarS
Contributor II

Hi,

Initially, I used the "Hello World" example project as the base for implementing my code, where I encountered a hard fault issue during the clock initialization of the FlexSPI. However, when I switched to using the "FlexSPI" example project as the base and initialized both the FlexSPI and Ethernet modules, the hard fault issue no longer occurred.

I’ve compared the clock configurations between the "Hello World" and "FlexSPI" base project setups, but I couldn’t find any significant differences.

While this workaround has solved the issue, I would like to understand the root cause behind this behavior.

Could there be any additional settings or configurations that is required for the FlexSPI initialization? Any insights or suggestions would be greatly appreciated!

The same code was used in both the projects, I've attached the code for your reference.

Tags (3)
0 Kudos
Reply

2,576 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @PavanKumarS 

Before clock initialization, there are no any additional settings or configurations that is required for the FlexSPI initialization.

So I think it's still a problem with the clock configuration, but there's no clock configuration in the file you gave me. Can you share the code that caused the hard fault?

BR

Harry

0 Kudos
Reply