cancel
Showing results for 
Search instead for 
Did you mean: 

Hardfault Error While Debugging in Systemview

Anil1472
Associate II

The SystemView is running properly when I don't integrate TouchGFX into STM32CubeIDE. However, when I integrate TouchGFX into my code, I'm able to debug with ST-Link. On the other hand, when I use J-Link, I'm getting a hardfault error while debugging. Below, I have attached screenshot .i will send the detailed problem if someone is willing to help me regarding this.

9 REPLIES 9
FBL
ST Employee

Hello @Anil1472 

 

Which product do you use? Toolchain/version? Do you see the same behavior without RTOS? Can you step by step in debug and check in the code the memory accesses that are not aligned to the data size being accessed?

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Look at what's actually faulting. The code and the registers to provide context.

Seems to be an unaligned read? Not clear what MCU you're using.

With System Bring-Up I strongly recommend getting a UART and printf() working, and you have a Hard Fault and Error Handler that output actionable data so you can identify what's going wrong quickly.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Dear @FBL ,

Thank you for your response.

We are using STM32H743BI MCU in our project and the application is running on freertos platform of version 10.3

The application has UI which is integrated with touchgfx and the screens data are mapped to external flash through QSPI interface.

The code works fine in below 2 ways,
1. When we switch the debugging tool to ST LINK the code debugs and works fine with touchgfx and application code
2. When we switch the debugging tool to Segger J Trace Pro it works fine but without touchgfx.

The problem for us is debugging through Segger J Trace Pro along with touchgfx enabled is leading to hard fault error since we do not have any information to map the screen data to external flash throught QSPI when we are using Segger J Trace Pro.Below i have attached the screenshot of  faults i'm getting when i debug through ozone.

Please support us in solving this issue as soon as possible.

Thank you
Anil

Dear @Tesla DeLorean  ,

Thank you for your response.

We are using STM32H743BI MCU in our project and the application is running on freertos platform of version 10.3

The application has UI which is integrated with touchgfx and the screens data are mapped to external flash through QSPI interface.

The code works fine in below 2 ways,
1. When we switch the debugging tool to ST LINK the code debugs and works fine with touchgfx and application code
2. When we switch the debugging tool to Segger J Trace Pro it works fine but without touchgfx.

The problem for us is debugging through Segger J Trace Pro along with touchgfx enabled is leading to hard fault error since we do not have any information to map the screen data to external flash throught QSPI when we are using Segger J Trace Pro.Below i have attached the screenshot of  faults i'm getting when i debug through ozone.

Please support us in solving this issue as soon as possible.

Thank you
Anil

Hello @Anil1472 

 

I have escalated the issue to our dedicated experts internally. I will get back to you as soon as possible.

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Anil1472
Associate II

Hello @FBL ,

 Thank you for the support will be waiting for your response.

Hello @FBL @Tesla DeLorean 

As this project is crucial your support would solve my problem waiting for your response.

Faulting on the read of QSPI at 0x9000DB90, I would perhaps dump out the QSPI peripheral context, and insure it is in Memory Mapped mode. Are you changing modes of the QSPI and sending direct commands? The debugger is not interacting with the memory device?

Double check MPU_Config settings for QSPI region

Instrument HardFault Handler properly so you can observed failure outside of the debugger. while(1) loops just fail in darkness..

https://github.com/cturvey/RandomNinjaChef/blob/main/KeilHardFault.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
FBL
ST Employee

Hello @Anil1472 

I would like to reproduce the issue on myside.

  1. Could you share a minimum project using CubeIDE with J Link (not J Trace) ? Could you please share also the log of GDB server?
  2. Have you checked the trace pins?

It is possible that the issue is caused by J Trace. This link may be helpful ST STM32H7 - SEGGER Wiki 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.