"file format not recognized" when trying to debug

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

"file format not recognized" when trying to debug

ソリューションへジャンプ
3,102件の閲覧回数
mouser
Contributor I

I was unable to get a project of mine to debug on an MKL02Z32CAF4 via a J-link Ultra+ debug adapter using MCUXpresso 11.7.0 b9198. It was throwing errors I didn't understand so I tried to push the code to another board I have that uses the same processor, and that was known to work (but was developed back in the Kinetis Studio days). I got the same errors so that leads me to believe that the problem I am having is a toolchain issue and not one with the chip or the board. 

So, I reinstalled MCUXpresso and made a blank project targeting the same MCU and tried to upload it ang all I get is: 

Error in final launch sequence:

Failed to execute MI command:
-file-exec-file "D:\\Windows Libraries\\Documents\\Projects\\DIN\\DIN_MCU2_2\\DIN_MCU2_2\\Debug\\libDIN_MCU2_2.a"
Error message from debugger back end:
"016ff8c4s": not in executable format: file format not recognized
Failed to execute MI command:
-file-exec-file "D:\\Windows Libraries\\Documents\\Projects\\DIN\\DIN_MCU2_2\\DIN_MCU2_2\\Debug\\libDIN_MCU2_2.a"
Error message from debugger back end:
"016ff8c4s": not in executable format: file format not recognized
"016ff8c4s": not in executable format: file format not recognized

This is the same error I was getting when I tried to debug my actual project with real code in it, so now I think I've ruled out a hardware issue or a code problem... it's just the toolchain's configuration. I'm not sure how to proceed at this point. This is an empty default-configuration project created within MCUXpresso.  

Anyone have a hint as to where I should start looking?

mouser_0-1679940958948.png

 

 

0 件の賞賛
返信
1 解決策
3,090件の閲覧回数
ErichStyger
Specialist I

Did you build the project? If you build a library project, then you get a library (you will not be able to debug the library). You need to build an executable (maybe link with the library) and debug that output.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
3,093件の閲覧回数
ErichStyger
Specialist I

Your file

libDIN_MCU2_2.a

is an archive (.a) library file, and not an executable (ELF/Dwarf, e.g. .elf or .axf).

The file extension does not really matter, but .a is usually used for that file types, see https://mcuoneclipse.com/2017/07/23/how-to-use-custom-library-names-with-gnu-linker-and-eclipse/

0 件の賞賛
返信
3,092件の閲覧回数
mouser
Contributor I

Agreed, but I didn't ask it to make that file. This is literally a fresh project out of the box with whatever configuration was default.  There are no files in the project that weren't auto-generated by the IDE (and a main.c that just increments an integer forever).  

0 件の賞賛
返信
3,091件の閲覧回数
ErichStyger
Specialist I

Did you build the project? If you build a library project, then you get a library (you will not be able to debug the library). You need to build an executable (maybe link with the library) and debug that output.

0 件の賞賛
返信
3,086件の閲覧回数
mouser
Contributor I

Yep, looks like I had somehow created a library project.  <facepalm>  thanks for the assist. 

 

0 件の賞賛
返信