cancel
Showing results for 
Search instead for 
Did you mean: 

CMSIS, FFT, Compilation works, During Debug: "Can't find a source file...". Why?

DRums.1
Associate II

Hello,

I try to implement an FFT on the STM32F401CE controller. I followed a tutorial from youtube (https://www.youtube.com/watch?v=vCcALaGNlyw). It mainly consists of including arm_math.h and libarm_cortexM4lf_math.a. I succeeded in doing so and compilation worked fine in CubeIDE Version: 1.3.1.

However, when I try to debug the program, it goes into the HardFault_Handler() with BFSR = 0b10000010.

If I execute the program in singel stepping (pressing F5), I get the following information:

Can't find a source file at "D:\CMSIS\CMSIS_Setup_V4.xx\CMSIS\DSP_Lib\Source\GCC/../TransformFunctions/arm_rfft_q15.c" 

I have absolutely no Idea, why there is a file expected on that location, especially as I have no drive D.

I have the following questions:

  • Why is some file needed, even if the compilation worked fine. I would expect, that the .hex file contains all needed code
  • What component is searching for the file and how can I set the search path correctly? I could click on "locate file" therby adding the correct path to "Debug Configuration - Source - Path Mapping". However, I don't understand what I am doing there...
  • This procedure is needed at least for arm_rfft_q15.c as well as cmsis_gcc.h. The program still compiles fine but is not running (neither in debug mode nor without debugger connected). At the current stage I don't reach a point where I get information about the next missing file (by single steppin).

Many thanks for your hints,

Best Regards,

Donald

2 REPLIES 2
DRums.1
Associate II

Hi,

here is, what I observed myself. Maybe it is helpful for others, having the same problem:

The HardFault has nothing to do with the "Can't find source file..." stuff.

Concerning the HardFault()

  • I had forgotten to run arm_rfft_init_q15(...) prior to calling arm_rfft_q15(...). This seems to result in the HardFault Exception
  • Also, if I run arm_rfft_init_q15(...) as required, but choosing not allowed FFT length (something different from 2^i, i = 5...13), results in the HardFault Exception

Concerning "Can't find source file..."

  • This is most likely related to the debug information data that is generated during compliation. The path "D:\..." is probably included in this data. And this path was used on the computer of the person that compiled the used library.

I have no better explanations, maybe they are wrong - if so, feel free to correct me.

Cheers

Donald

JayDev
Senior II

Did you end up finding a solution to this problem? I'm actually running into a similar issue on my end moving to a STM32wb55 project.

I actually got it working just fine in a fresh project but adding it to an existing project, there must be some difference (not sure what the difference might've been). Was just curious if you had made any progress with that.

Thanks!