Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug #17487] AVR RC oscillator calibration routine not supported by JTAGICE mkii #71

Closed
avrs-admin opened this issue Dec 10, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@avrs-admin
Copy link

John Voltz ninevoltz@metalink.net
Mon 21 Aug 2006 12:05:01 PM UTC

This is a feature request rather than a bug.

AVRDUDE currently does not support RC oscillator calibration as outlined in the AVR053 appnote.

file #10564: RC calibration.pdf
file #10757: avrdudeupdate.tar.gz
file #12867: arbitrary_rw.patch
file #12868: mistake.patch
file #12869: fixed_arbitrary_rw.patch

This issue was migrated from https://savannah.nongnu.org/bugs/?17487

@avrs-admin avrs-admin added the bug Something isn't working label Dec 10, 2021
@avrs-admin
Copy link
Author

John Voltz
Wed 13 Sep 2006 09:12:20 PM UTC

Here is my update patch

@avrs-admin
Copy link
Author

Joerg Wunsch <joerg_wunsch>
Mon 18 Sep 2006 09:51:29 PM UTC

I promised to handle that before releasing 5.2.

@avrs-admin
Copy link
Author

Joerg Wunsch <joerg_wunsch>
Mon 09 Oct 2006 02:38:41 PM UTC

The part of the patch implementing the -O option has been
committed.

I still feel we should seek for a more general method to
transfer the result to an arbitrary location.

@avrs-admin
Copy link
Author

John Voltz
Sat 26 May 2007 06:46:24 PM UTC

I just submitted a patch to allow avrdude to read and write at arbitrary memory locations. You simply specify a block length (in bytes) followed by the byte offset in the hex file then finally the byte offset in flash or eeprom.

Here's a command line example:

avrdude -cstk500v2 -B4 -pm16 -P/dev/ttyS0 -v -e -Uflash:w:main.hex:i,10,0,6

this will write 10 bytes from byte offset 0 in main.hex to byte offset 6 in flash

values can be in decimal or hex, and all are optional (will default to zero). Values must be multiples of two since the AVR memory is arranged in 16-bit words.

@avrs-admin
Copy link
Author

John Voltz
Sat 26 May 2007 07:08:28 PM UTC

I forgot to mention how my last patch is useful. It can be used for RC oscillator calibration by first reading the AVRs EEPROM to a temporary file, then you can write it back to the AVR in an arbitrary location in the flash or EEPROM.

It can also be used to store configuration constants in flash, which is my latest interest since I have been having a lot of trouble lately with EEPROM corruption, and yes, I am using the brown-out detector in my application! :oP

@avrs-admin
Copy link
Author

John Voltz
Sat 26 May 2007 07:49:33 PM UTC

Not long after submitting my patch I discovered a nasty mistake in my code. Here's patch #3

(file #12868)

@avrs-admin
Copy link
Author

Charles Goyard
Fri 28 Aug 2009 07:51:09 PM UTC

Hi,
the documentation states JTAG ICE mkII is supported for calibration, but it is not.
According to the AVR067, the programmer has to issue a  CMND_ISP_PACKET containing the ISP CMD_OSCCAL.
A quick fix is to change the manual page. A nice thing would be to add the support.
Regards,
Charles

@mcuee mcuee added the enhancement New feature or request label Jun 19, 2022
@mcuee
Copy link
Collaborator

mcuee commented Nov 6, 2022

Since -O has been implemented, the enhancement porting has been done. So the only remaining issue is with JTAGICE mkii calibration, I will remove the enhancement label now.

@mcuee mcuee removed the enhancement New feature or request label Nov 6, 2022
@mcuee mcuee changed the title [bug #17487] AVR RC oscillator calibration routine not supported (feature request) [bug #17487] AVR RC oscillator calibration routine not supported by JTAGICE mkii Nov 28, 2022
@mcuee
Copy link
Collaborator

mcuee commented Jun 3, 2023

Given that this issue has been there for so long and JTAG ICE mkII has been obsolete for quite some time, I am going to cloe this one. We can always re-open if PR is raised.

@mcuee mcuee closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2023
@mcuee
Copy link
Collaborator

mcuee commented Oct 18, 2023

John Voltz Sat 26 May 2007 07:49:33 PM UTC

Not long after submitting my patch I discovered a nasty mistake in my code. Here's patch #3

(file #12868)

The contents of the patch is attached here for easier reference.

Only in avrdude-5.4: ac_cfg.h
Only in avrdude-5.4-orig: arbitrary_rw.patch
Only in avrdude-5.4: avrdude.conf
Only in avrdude-5.4: avrdude.conf.tmp
Only in avrdude-5.4: avrdude.kdevelop
Only in avrdude-5.4: avrdude.kdevelop.pcs
Only in avrdude-5.4: avrdude.kdevses
Only in avrdude-5.4: config.log
Only in avrdude-5.4: config.status
Only in avrdude-5.4: debug
Only in avrdude-5.4: .deps
Only in avrdude-5.4-orig/doc: avrdude.info
Only in avrdude-5.4/doc: Makefile
Only in avrdude-5.4-orig/doc: stamp-vti
Only in avrdude-5.4-orig/doc: version.texi
Only in avrdude-5.4: Doxyfile
Only in avrdude-5.4: main.hex
Only in avrdude-5.4: Makefile
Only in avrdude-5.4: stamp-h1
diff -rup avrdude-5.4-orig/update.c avrdude-5.4/update.c
--- avrdude-5.4-orig/update.c	2007-05-26 15:49:50.000000000 -0400
+++ avrdude-5.4/update.c	2007-05-26 15:47:32.000000000 -0400
@@ -25,7 +25,6 @@
 #include <errno.h>
 #include <string.h>
 #include <time.h>
-
 #include "avrdude.h"
 #include "avr.h"
 #include "config.h"
@@ -36,7 +35,7 @@
 UPDATE * parse_op(char * s)
 {
   char buf[1024];
-  char * p, * cp, c, ** end;
+  char * p, * cp, c, * end;
   UPDATE * upd;
   int i;
   size_t fnlen;
@@ -166,7 +165,7 @@ UPDATE * parse_op(char * s)
       upd->moffset = 0;
     } else {
       p++;
-      upd->length = (int) strtol(p, end, 0);
+      upd->length = strtol(p, &end, 0);
       if ((upd->length % 2) == 1) {
         fprintf(stderr, "\n%s: length specifier must be a multiple of two, you specified %d\n",
                 progname, upd->length);
@@ -187,7 +186,7 @@ UPDATE * parse_op(char * s)
       upd->moffset = 0;
     } else {
       p++;
-      upd->foffset = (int) strtol(p, end, 0);
+      upd->foffset = strtol(p, &end, 0);
       if ((upd->foffset % 2) == 1) {
         fprintf(stderr, "\n%s: file offset specifier must be a multiple of two, you specified %d\n",
                 progname, upd->foffset);
@@ -208,7 +207,7 @@ UPDATE * parse_op(char * s)
       upd->moffset = 0;
     } else {
       p++;
-      upd->moffset = (int) strtol(p, end, 0);
+      upd->moffset = strtol(p, &end, 0);
       if ((upd->moffset % 2) == 1) {
         fprintf(stderr, "\n%s: memory offset specifier must be a multiple of two, you specified %d\n",
                 progname, upd->moffset);
Only in avrdude-5.4/windows: .deps
Only in avrdude-5.4/windows: Makefile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants