how can i compile the stk500v2 bootloader on windows?
Try “make mega2560”, with your current setup…
You can install Atmel Studio 7, open an “AS7 Command Prompt” window, and use “make mega2560”
(but I also got weird errors with just “make”)
(You really OUGHT not to need all of AS7 to do this. But it will take me a while to see what’s needed on an otherwise “virgin” windows 10…)
Um:
C:\Users\User\Desktop\arduino-1.8.9\hardware\arduino\avr\bootloaders\stk500v2>
try making a copy outside of the Arduino install, where you’re certain that you have all of the needed file and directory write permissions…
C:\Users\billw\Documents\stk500v2>dir
Volume in drive C has no label.
Volume Serial Number is 76D1-5C84
Directory of C:\Users\billw\Documents\stk500v2
06/05/2019 03:07 PM .
06/05/2019 03:07 PM …
06/05/2019 02:59 PM .dep
10/16/2017 04:20 AM 27,394 avrinterruptnames.h
10/16/2017 04:20 AM 7,044 avr_cpunames.h
10/16/2017 04:20 AM 4,591 command.h
10/16/2017 04:20 AM 15,424 License.txt
10/16/2017 04:20 AM 17,482 Makefile
10/16/2017 04:20 AM 53,331 stk500boot.c
10/16/2017 04:20 AM 83 stk500boot.ppg
06/05/2019 02:59 PM 4,652 stk500boot.sym
10/16/2017 04:20 AM 190 STK500V2.pnproj
10/16/2017 04:20 AM 61 STK500V2.pnps
10 File(s) 130,252 bytes
3 Dir(s) 14,260,985,856 bytes free
C:\Users\billw\Documents\stk500v2>make mega2560
-------- begin --------
avr-gcc (AVR_8_bit_GNU_Toolchain_3.6.1_1750) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling: stk500boot.c
avr-gcc -c -mmcu=atmega2560 -I. -gdwarf-2 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-jump-tables -Wall -Wstrict-prototypes -Wa,-adhlns=stk500boot.lst -std=gnu99 -D_MEGA_BOARD_ -MD -MP -MF .dep/stk500boot.o.d stk500boot.c -o stk500boot.o
Linking: stk500boot.elf
avr-gcc -mmcu=atmega2560 -I. -gdwarf-2 -DF_CPU=16000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-jump-tables -Wall -Wstrict-prototypes -Wa,-adhlns=stk500boot.o -std=gnu99 -D_MEGA_BOARD_ -MD -MP -MF .dep/stk500boot.elf.d stk500boot.o --output stk500boot.elf -Wl,-Map=stk500boot.map,–cref -lm -Wl,–section-start=.text=3E000
Creating load file for Flash: stk500boot.hex
avr-objcopy -O ihex -R .eeprom stk500boot.elf stk500boot.hex
Creating load file for EEPROM: stk500boot.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom=“alloc,load”
–change-section-lma .eeprom=0 -O ihex stk500boot.elf stk500boot.eep
C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe: --change-section-lma .eeprom=0x00000000 never used
Creating Extended Listing: stk500boot.lss
avr-objdump -h -S stk500boot.elf > stk500boot.lss
Creating Symbol Table: stk500boot.sym
avr-nm -n stk500boot.elf > stk500boot.sym
Size after:
AVR Memory Usage
Device: atmega2560
Program: 5928 bytes (2.3% Full)
(.text + .data + .bootloader)
Data: 18 bytes (0.2% Full)
(.data + .bss + .noinit)
-------- end --------
mv stk500boot.hex stk500boot_v2_mega2560.hex