Merge pull request #1139 from steelman/isp-clock-error-message

Mention -B in the error message and document -F better
This commit is contained in:
Stefan Rueger 2022-10-23 21:59:21 +01:00 committed by GitHub
commit 2c7083f001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 8 deletions

View File

@ -507,6 +507,8 @@ actual connection to a target controller), this option can be used
together with together with
.Fl t .Fl t
to continue in terminal mode. to continue in terminal mode.
Moreover, the option allows to continue despite failed initialization
of connection between a programmer and a target.
.It Fl i Ar delay .It Fl i Ar delay
For bitbang-type programmers, delay for approximately For bitbang-type programmers, delay for approximately
.Ar delay .Ar delay

View File

@ -598,6 +598,8 @@ Also, for programmers like the Atmel STK500 and STK600 which can
adjust parameters local to the programming tool (independent of an adjust parameters local to the programming tool (independent of an
actual connection to a target controller), this option can be used actual connection to a target controller), this option can be used
together with @option{-t} to continue in terminal mode. together with @option{-t} to continue in terminal mode.
Moreover, the option allows to continue despite failed initialization
of connection between a programmer and a target.
@item -i @var{delay} @item -i @var{delay}
For bitbang-type programmers, delay for approximately For bitbang-type programmers, delay for approximately
@ -3047,14 +3049,15 @@ See also: @url{http://www.libusb.org/ticket/6}
@item @item
Problem: after flashing a firmware that reduces the target's clock Problem: after flashing a firmware that reduces the target's clock
speed (e.g. through the @code{CLKPR} register), further ISP connection speed (e.g. through the @code{CLKPR} register), further ISP connection
attempts fail. attempts fail. Or a programmer cannot initialize communication with
a brand new chip.
Solution: Even though ISP starts with pulling @var{/RESET} low, the Solution: Even though ISP starts with pulling @var{/RESET} low, the
target continues to run at the internal clock speed as defined by the target continues to run at the internal clock speed either as defined by
firmware running before. Therefore, the ISP clock speed must be the firmware running before or as set by the factory. Therefore, the
reduced appropriately (to less than 1/4 of the internal clock speed) ISP clock speed must be reduced appropriately (to less than 1/4 of the
using the -B option before the ISP initialization sequence will internal clock speed) using the -B option before the ISP initialization
succeed. sequence will succeed.
As that slows down the entire subsequent ISP session, it might make As that slows down the entire subsequent ISP session, it might make
sense to just issue a @emph{chip erase} using the slow ISP clock sense to just issue a @emph{chip erase} using the slow ISP clock

View File

@ -1220,9 +1220,10 @@ int main(int argc, char * argv [])
init_ok = (rc = pgm->initialize(pgm, p)) >= 0; init_ok = (rc = pgm->initialize(pgm, p)) >= 0;
if (!init_ok) { if (!init_ok) {
pmsg_error("initialization failed, rc=%d\n", rc); pmsg_error("initialization failed, rc=%d\n", rc);
imsg_error("- double check the connections and try again\n");
imsg_error("- use -B to set lower ISP clock frequency, e.g. -B 200kHz\n");
if (!ovsigck) { if (!ovsigck) {
imsg_error("double check connections and try again or use -F to override\n"); imsg_error("- use -F to override this check\n\n");
imsg_error("this check\n\n");
exitrc = 1; exitrc = 1;
goto main_exit; goto main_exit;
} }