"Failed to Load ELF Executable"... even with the minimal code?

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just got myself the Atmel-Ice Basic for programming and debugging a Weemos development board I have that uses the SAM D21 G18A, (Link at the end of the post, in case you wanna watch it out) I am actually working with Atmel Studio 7 . I am able to write code on it, the fuses etc. but when I try to do debugging this error always appears:

 

Failed to Load ELF Executable

 I am trying with this code now:

 

#include "sam.h"


int main(void)
{
    /* Initialize the SAM system */
    SystemInit();

    /* Replace with your application code */
    while (1) 
    {
    }
}

Uploaded it and all... still doesn't work.

I don't know where this problem could come from... any suggestions?

 

https://www.banggood.com/Wemos-SAMD21-M0-32-bit-ARM-Cortex-M0-Core-Compatible-With-Arduino-Zero-Arduino-M0-p-1176168.html?rmmds=search&cur_warehouse=CN

Victor

Last Edited: Fri. Apr 27, 2018 - 09:18 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the ELF file being generated? Maybe not as you don't really have any code or there is an error, look at the build window.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, sorry for replying this late, now I am trying this code:

 

#include "sam.h"

#define F_CPU 48000000UL

int main(void)
{
    /* Initialize the SAM system */
    SystemInit();
	
	PORT->Group[0].DIRSET.reg = PORT_PA09;
	
    /* Replace with your application code */
    PORT->Group[0].OUTSET.reg = PORT_PA09;
	
	while (1) 
    {	
		
    }
	return 0;
}

At the build window I do get this line:

 

Building target: samd21gpio.elf

 

Invoking: ARM/GNU Linker : 6.3.1

 

"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe" -o samd21gpio.elf  Device_Startup/startup_samd21.o Device_Startup/system_samd21.o main.o   -mthumb -Wl,-Map="samd21gpio.map" -Wl,--start-group -lm  -Wl,--end-group -L"..\\Device_Startup"  -Wl,--gc-sections -mcpu=cortex-m0plus -Tsamd21g18a_flash.ld  

Finished building target: samd21gpio.elf

And still after it builded the .elf file, I get the same error and can't do debbugging.

Victor