[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] Bug in avr_tpi_poll_nvmbsy()?
From: |
Darell Tan |
Subject: |
Re: [avrdude-dev] Bug in avr_tpi_poll_nvmbsy()? |
Date: |
Wed, 1 May 2013 10:47:16 +0800 |
Hi Hannes,
Oh yes that's definitely a bug, since cmd_tpi just does dumb RX and TX. In
my testing, serial bitbanging was probably slow enough that it didn't
matter. Please fix it to make avrftdi work!
Thanks.
--
Regards,
Darell Tan
On Tue, Apr 30, 2013 at 10:54 PM, Hannes Weisbach
<address@hidden>wrote:
> Hello,
>
> I am currently implementing TPI for avrftdi and I stumbled across a
> possible bug in avr_tpi_poll_nvmbsy(). Since I am not that familiar with
> the TPI-code in avr.c I though I'd better ask. avr_tpi_poll_nvmbsy() reads
> out the NVMCSR register like so:
>
> cmd = TPI_CMD_SIN | TPI_SIO_ADDR(TPI_IOREG_NVMCSR);
> rc = pgm->cmd_tpi(pgm, &cmd, 1, &res, 1);
>
> But instead of reading the response the return code is checked for the
> busy flag:
> return (rc & TPI_IOREG_NVMCSR_NVMBSY);
>
> Shouldn't it rather be:
> return (res & TPI_IOREG_NVMCSR_NVMBSY);?
>
> (With that change avrftdi programs flash over TPI, so please say 'yes' ;))
>
> Best regards,
> Hannes
> _______________________________________________
> avrdude-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/avrdude-dev
>