![]() |
Problem using bootloader
(this is for 500A DC controller)
I'd like to tinker a little with firmware code so working bootloader would be much more comfortable to use in car than ISP; found Adam's instructions regarding RTD Explorer in this post but it doesn't work for me... Microcontroller is ATMega168P, it's programmed with "coug-unified-16k.hex" code v.1.9; fuses are set according to instructions in "bootload168" directory (E: 0xF8, H: 0xDC, L: 0xF7). Controller works fine in car and communicates with RTDexplorer on Windows XP. After clicking and confirming "Load firmware" controller seems to enter bootloader (error LED no longer blinks due to throttle not connected) but there's no further action - no messages like "avr_write_flash_block" etc. and after that I need to kill "avrboot.exe" process to regain access to COM port. What's interesting is that controller needs to have it's power cycled to start again; pulling low ISP reset pin doesn't bring back "blinking LED state" (maybe false result of initial CRC check causes stop in while(1) loop?) It looks to me like problem occurs during avrboot execution, do you have any ideas how to get it to work? |
I never used the bootloader successfully. Well, maybe a really really long time ago, but I never understood how it worked. Fran Sabolich wrote it I think, and I just loaded the bootloader/controller code with a programmer.
|
I think I've found it; it is about watchdog behaviour after reset (watchdog is used to restart microcontroller with "restart" uart command). It is mentioned in avr-libc documentation:
Quote:
This is where I need your help - I tried to add few lines for disabling wdt, but I can't successfully compile into working hex. I can't do it even with unchanged code; here's how I try it: - installed latest (20100110) WinAVR on Win XP laptop - copied bootload.c, misc.asm, autocrc.h, genautocrc and Makefile into C:\000 - run "make" - joined output file bootload.hex with couc-crc-16k.hex (yes, i know how to join hex files in Notepad) - checked fuses and uploaded joint hex into processor ...and nothing - while it should start blinking led :( Do you have any suggestions how to debug this thingy? I think I'll start with switching led in bootloader code to see where it's stuck. Any better ideas? |
OK, watchdog issue solved - I managed to compile bootloader with few lines added. Controller wakes up properly after restart but no success in firmware upgrade function - avrboot just hangs :(
|
All times are GMT -4. The time now is 02:42 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com