Go Down

Topic: custom Atmega2560 bootloader (Read 173 times) previous topic - next topic

KushlaVR

Mar 01, 2017, 04:00 pm Last Edit: Mar 01, 2017, 04:17 pm by KushlaVR
Hi.
I whant to make some chahnges in functionality of standart arduino Mega2560 bootloader.
I decide to modify stk500V2 bootloader
First of all, I whant to compile this bootloader using Atmel studio. If this bootloader become work then I start to modify it.

This task looks easy.
1) I create new project for Atmega2560 mcu
2) import source files (C:\Users\myuser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.15\bootloaders\stk500v2) Setup memory - add option .text=0x7000 in FLUSH segment   (project propertie/toolcain/AVR/GNU linker/memory settings)
4) make some defines
#define F_CPU 16000000UL
#define _MEGA_BOARD_
#define BLINK_LED_WHILE_WAITING

5)  Build project.

IMPORTANT:
I don't make any changes is source code. All voids, and function is original!!! I Just add 3 defines (from step #4). Thet are present in original Makefile. I dont use original Makefile becouse i whant to build bootloader in Atmel studio.


After thet I burn bootloader to Mega board using my arduino UNO boar as programmer (Examples/ArduinoISP)

My Mega board looks like alive. After powerup -> led become blink (as it is programmed is bootloader)
When I open Serial monitor and send !!! command => bootloader answer to me....
Code: [Select]
!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
Arduino explorer stk500V2 by MLS
Bootloader>




BUT When I try to upload Blink scatch to My Mega board - Arduino IDE report error

Code: [Select]
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Произошла ошибка при загрузке скетча


When i burn original bootloader (C:\Users\myuser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.15\bootloaders\stk500v2\stk500boot_v2_mega2560.hex) - sketch uploads without any problem.

Is there any people who make working mod of thes bootloader? or any other bootloader? Can you help me to understand what the problem is?

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy