Menu

#72 Failed to load MCU type and change mcu settings

unspecified_version
open
nobody
None
1
2020-04-11
2020-04-11
Thomas Coin
No

Hello,

I have installed this week Eclipse IDE and AVR plugin on Ubuntu.
I'm trying to get it work with my Arduino UNO (atmega328p).

I have created a new programmer configuration:
* -carduino
* -P/dev/ttyACM0
* -b115200

When I click on Load from MCU I get an Error Could not find a valid Signature in the avrduded output. Here is the avrdude log:

Launching /usr/bin/avrdude -carduino -P/dev/ttyACM0 -b115200 -pm16 
Output:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: Expected signature for ATmega16 is 1E 94 03
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

avrdude finished


Launching /usr/bin/avrdude -carduino -P/dev/ttyACM0 -b115200 -px128a3 
Output:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: Expected signature for ATxmega128A3 is 1E 97 42
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

avrdude finished

What I understood is that avrdude is firstly started with -pm16 arg to then find the correct MCU. But it look like there is a parsing issue (see second avrude launch command, arg -px128a3, I guess it should be something like -pm328p).

Ok, so automatic MCU configuration is not working, but I can't set it manullay, because the MCU type combo box is disabled in Properties->AVR->Target Hardware.

I have then tried to modify AVRDUDEOPTIONS variable, set to -pm328p -carduino -P/dev/ttyACM0 -b115200 and AVRTARGETMCU set to atmega328p. But it does not affect the build:

14:57:09 **** Incremental Build of configuration Debug for project TestAvr ****
make all 
Building file: ../main.c
Invoking: AVR Compiler
avr-gcc -Wall -g2 -gstabs -O0 -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega16 -DF_CPU=16000000UL -MMD -MP -MF"main.d" -MT"main.o" -c -o "main.o" "../main.c"
Finished building: ../main.c

Building target: TestAvr.elf
Invoking: AVR C Linker
avr-gcc -Wl,-Map,TestAvr.map -mmcu=atmega16 -o "TestAvr.elf"  ./main.o   
Finished building target: TestAvr.elf

Invoking: AVR Create Extended Listing
avr-objdump -h -S TestAvr.elf  >"TestAvr.lss"
Finished building: TestAvr.lss

Create Flash image (ihex format)
avr-objcopy -R .eeprom -R .fuse -R .lock -R .signature -O ihex TestAvr.elf  "TestAvr.hex"
Finished building: TestAvr.hex

Create eeprom image (ihex format)
avr-objcopy -j .eeprom --no-change-warnings --change-section-lma .eeprom=0 -O ihex TestAvr.elf  "TestAvr.eep"
Finished building: TestAvr.eep

Invoking: Print Size
avr-size --format=avr --mcu=atmega16 TestAvr.elf
AVR Memory Usage
----------------
Device: atmega16

Program:     122 bytes (0.7% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)


Finished building: sizedummy

And deploy log:

Launching /usr/bin/avrdude -pm16 -carduino -P/dev/ttyACM0 -b115200 -Uflash:w:TestAvr.hex:a 
Output:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: Expected signature for ATmega16 is 1E 94 03
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

avrdude finished

My dummy code :

/*
 * main.c
 *
 *  Created on: 7 avr. 2020
 *      Author: thomas
 */

#include <avr/io.h>

int main()
{
    while (1)
    {

    }

    // should never go here
    return 0;
}

Thanks by advance

Discussion


Log in to post a comment.