Go Back   EcoModder Forum > EcoModding > Fossil Fuel Free > Open ReVolt: open source DC motor controller
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 01-18-2017, 10:33 AM   #1 (permalink)
EcoModding Lurker
 
Join Date: Dec 2011
Location: Poland
Posts: 66
Thanks: 12
Thanked 27 Times in 22 Posts
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?

  Reply With Quote
The Following User Says Thank You to z_power For This Useful Post:
MPaulHolmes (01-18-2017)
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 01-26-2017, 06:50 PM   #2 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,368
Thanked 1,202 Times in 765 Posts
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.
__________________
kits and boards
  Reply With Quote
The Following User Says Thank You to MPaulHolmes For This Useful Post:
z_power (01-30-2017)
Old 02-11-2017, 03:33 PM   #3 (permalink)
EcoModding Lurker
 
Join Date: Dec 2011
Location: Poland
Posts: 66
Thanks: 12
Thanked 27 Times in 22 Posts
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:
Note that for newer devices (ATmega88 and newer, effectively any AVR that has the option to also generate interrupts), the watchdog timer remains active even after a system reset (except a power-on condition), using the fastest prescaler value (approximately 15 ms). It is therefore required to turn off the watchdog early during program startup
So after "software reset", either by direct command or firmware upgrade process watchdog timer is left at 15 ms until power-off because there's no wdt_disable nor wdt_reset in bootloader code.

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?
  Reply With Quote
Old 02-12-2017, 01:47 PM   #4 (permalink)
EcoModding Lurker
 
Join Date: Dec 2011
Location: Poland
Posts: 66
Thanks: 12
Thanked 27 Times in 22 Posts
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

  Reply With Quote
Reply  Post New Thread






Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com