strange thing in the makefile!

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

Hi guys,

I just found out that my old code in makefile for my bootloader doesn't work anymore.

# MCU name
MCU = atmega2561


# The compiled bootloader code will be downloaded to one of the following bootloader flash locations
# if ((MCU == atmega128) || (MCU == atmega1281)
# {
#     bootloader_start = 0x1E000;
# }
# else
# {
#     bootloader_start = 0x3E000;
# }

ifneq ("", $(or $(findstring atmega128, $(MCU)), $(findstring atmega1281, $(MCU))))
  LDSECTION  = --section-start=.text=0x1E000
else
  LDSECTION  = --section-start=.text=0x3E000
endif

This code now will only put the BL to 0x1E000, not the correct 0x3E000.

Anyone have idea?

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

Well drop the entire if() statement and just use:

LDSECTION  = --section-start=.text=0x3E000

You should then find a type 2 record at the top of the .hex file positioning it into the 0x3???? segment.

Cliff

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

hehe, yes, Cliff, that will work. But I'm wondering why this one stoped working

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

Well did you change the MCU= name ?

Cliff

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

yes, sure

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

Was there a version change in make? Are you using GNU make?

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

I use the makefile template from WINAVR 20070122.

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

No,not the *makefile* that you are using, the "make" program, make.exe. This should be "GNU make". What version are you using? Has there been a change in the make program?

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

no, I don't think so, except for I have updated WINAVR from 20070101 to 20070122 some time ago.