Skip to content

Firmware too large for microcontroller (atmega32u4) #5546

@UnlimitedKaos

Description

@UnlimitedKaos

Hello, I am trying to use a Pro Micro (atmega32u4) as an adxl345 module, meaning I just connect a USB cable, bolt this module on to my print head and be good to go.

To generate the firmware, I am doing this:

  1. make menuconfig:
    Micro-controller Firmware Architecture: Atmel AVR
    Processor Model: atmega32u4
    Processor Speed: 16mhz
    Manually Clear CPU prescaller: checked
    Communication interface: USB
    USB ID's: default settings
  2. make clean
  3. make

At this point I am using ftp to copy the klipper.elf.hex file from the ./out on the pi to my laptop to use avrdude to flash.

  1. avrdude -C avrdude.conf -p m32u4 -P COM6 -c avr109 -U flash:w:klipper.elf.hex

AVRDude now fails, here's the output:

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "klipper.elf.hex"
avrdude: input file klipper.elf.hex auto detected as Intel Hex
avrdude: writing flash (29292 bytes):

Writing | ################################################## | 100% 2.18s

avrdude: 29292 bytes of flash written
avrdude: verifying flash memory against klipper.elf.hex:
avrdude: input file klipper.elf.hex auto detected as Intel Hex

Reading | ################################################## | 100% 0.27s

avrdude: verification error, first mismatch at byte 0x7000
         0x55 != 0x80
avrdude: verification error; content mismatch

avrdude done.  Thank you.

So the 32u4 only has 32kb total flash space, and it appears that the sparkfun bootloader uses the last 4k, which leaves only 28k for programs. Is there a smaller bootloader that I should be using? Otherwise, how do I upload to klipper to a pro micro? Interestingly, when building klipper.elf.hex for my atmega2560/ramps controller board, that uses 28610kb of flash, which would fit on the 32u4. Basicity what im getting at is why is the 32u4 firmware like 1k larger than the 2560 firmware, because that difference is currently preventing me from being able to upload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    not on githubNot a topic tracked on github

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions