FreedomStudio on MacOS: file format not recognized

I’m brand new to this board and development environment, and I’m trying to get the sifive-welcome program to run via the debugger. I’m able to build the project successfully and get . elf, hex, .map, and .lst files. When I try to run the debugger though with a breakpoint set at main (via Jlink), I get the follow errors:

Error in final launch sequence
Failed to execute MI command:
symbol-file /Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c
Error message from debugger back end:
/Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c': can't read symbols: file format not recognized. ,Failed to execute MI command: load /Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c Error message from debugger back end: "/Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c" is not an object file: file format not recognized Failed to execute MI command: symbol-file /Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c Error message from debugger back end: /Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c’: can’t read symbols: file format not recognized.

This makes sense, that file is the source file and not a symbol file. Also, I get this error:

>     `/Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c': can't read symbols: file format not recognized.
>     Failed to execute MI command:
> load /Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c
> Error message from debugger back end:
> "/Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c" is not an object file: file format not recognized
>     "/Users/bryan/wsFreedomStudio/sifive_hifive1_revb_sifive_welcome/src/sifive-welcome.c" is not an object file: file format not recognized

I would also tend to agree that the source file is not the object file…

Is there a guide the goes up how to setup FreedomStudio to work? The quickstart guide doesn’t go over any of this. I’ve been poking around all of the menu’s for the SiFive GDB SEGGER J-Link Debugging, but I don’t see any fields where I can specify the object file or the symbol file.

I’m guessing that I’ll have to add this as manual options to the debugger command line as parameters? Seems like this would be an option in FreedomStudio though.

Hi Bryan,

I don’t have a Mac but I believe the problem is with your debug launch configuration. Please open that panel from the “Run - Debug Configurations” menu item.

You should have a GDB Segger J-Link Debugging entry for the HiFive1 on the left hand tree. It appears that the C/C++ Application being targeted is your source file and not the executable. Can you check that it is set to “sifive-welcome.elf” as shown here:

Once you set that, you can also confirm that the Debugger tab has proper entries shown below. Your version of Freedom Studio (and absolute path) will be different, but the executable names should be the same:

We have a few Freedom Studio tutorial videos available here:

The videos are from previous releases of FreedomStudio so the GUI has changed a bit as new features were added, but fundamentally these will help a newcomer to the product.

Please let us know if you are able to make any progress.