Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - hudson

1
AVRDude / avrdude -x ascii -x cpufreq issues
I've had problems with avrdude-5.11 and a buspirate v3b with firmware 5.10 on my Mac.  My project requires an external clock, so my script runs avrdude with [tt:]-x ascii -x cpufreq=125[/tt:] since the recovery clock for XTAL1 on AUX is only supported in ASCII mode.

It looks like the GUI parsing is broken in ASCII mode -- the [tt:]buspirate_readline_noexit()[/tt:] function is waiting for a newline, which is not printed with the prompt, so it eventually times out with [tt:]avrdude: ser_recv(): programmer is not responding[/tt:].  Adding a break in the readline routine for [tt:]'>'[/tt:] fixed the prompt parsing.

The next problem is that after a chip erase the [tt:]pgm->initialize()[/tt:] function is called, which tries to reconfigure the PWM output.  This fails since the [tt:]g[/tt:] command both enables and disables the output, so the second time it turns it off rather than going back into the PWM menu.  Just disabling the second call seems to be ok and prevents this from happening.

This patch to the current SVN head of avrdude fixes both of these issues.  However, why is the recovery clock not supported in binary mode?  The ASCII mode is painfully slow -- almost five minutes to flash an 8 KB chip!

Code: [Select]
Index: buspirate.c
===================================================================
--- buspirate.c (revision 1126)
+++ buspirate.c (working copy)
@@ -195,6 +195,8 @@
  continue;
  if (*buf_p == 'n')
  break;
+ if (*buf_p == '>')
+ break;
  if (*buf_p == EOF) {
  *buf_p = '';
  break;
@@ -940,7 +942,7 @@
  avr_set_bits(p->op[AVR_OP_CHIP_ERASE], cmd);
  pgm->cmd(pgm, cmd, res);
  usleep(p->chip_erase_delay);
- pgm->initialize(pgm, p);
+ //pgm->initialize(pgm, p);
 
  pgm->pgm_led(pgm, OFF);
 

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01382271336session_write_close ( )...(null):0
20.01422402912ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01422403688Database_MySQL->query( ).../DatabaseHandler.php:119
40.05952542408Database_MySQL->error( ).../Db-mysql.class.php:273