RudolfGeosits / MSP430-Emulator

Providing a software model of the TI MSP430
GNU General Public License v3.0
87 stars 20 forks source link

objcopy:firmware.elf: File format not recognized #13

Open jony543 opened 4 years ago

jony543 commented 4 years ago

Hello, I compiled my code but the emulator can't recognize the format when loading the file. Is there instrcution as to which format should I use?

Thanks

RudolfGeosits commented 4 years ago

Hi, yes you must use the ELF format, what is the error you are getting? Compiling with CCS or GCC toolchain directly should work but I can help you troubleshoot the issue you're having. Do the example programs work for you?

jony543 commented 4 years ago

Thanks! I am using Code Composer studio and the output format is set to ELF. Is this expected to be okay?

Thanks.

RudolfGeosits commented 4 years ago

Yes it's expected to be O.K. but there might be a bug. Which version of CCS are you using? What is the error you're experiencing and do the example programs work for you? Feel free to attach your file here so I can analyze the issue. You can also try to compile using GCC directly by:

msp430-gcc -mmcu=msp430g2553 YourProgram.c -o YourProgram.elf

jony543 commented 4 years ago

I changed the compiler from TI to GNU and now the firmware is loaded, but when running both sample projects (hello world, blink) from code studio I get INVALID INSTRUCTION error.

RudolfGeosits commented 4 years ago

Okay, I have an idea of what is going wrong; can you share the file you are trying to load and I can attempt to fix the problem.

jony543 commented 4 years ago

Thanks. Atached here. HelloWorld.zip

aLexBeGGy commented 4 years ago

Were you able to find a fix for this @RudolfGeosits ? Because I'm having the same problem (INVALID INSTRUCTION)

laksh225 commented 3 years ago

Could you share the .c file as that might helpful for anyone debugging the issue.