Commit Graph

98 Commits

Author SHA1 Message Date
Stefan Rueger b178deef5f
Handle n_page_erase in urclock for parts t441, t841 and t1634 2022-11-11 01:33:42 +00:00
Stefan Rueger 6a6d333849
Update urclock documentation 2022-11-08 15:18:30 +00:00
Stefan Rueger e6c26d8db4
Provide urclock programmer 2022-11-06 01:29:07 +00:00
Stefan Rueger 418cf08e84
Change avrdude.conf.in comment on location of per-user config file 2022-10-25 18:13:28 +01:00
Stefan Rueger 3769332afd
Merge pull request #1142 from MCUdude/stk600-pdi
STK600 supports programming using PDI
2022-10-23 23:10:10 +01:00
Stefan Rueger 4f6bab6303
Merge pull request #1138 from MCUdude/pic-detect-mode-cherry
Detect PICkit4 and SNAP in PIC mode
2022-10-23 21:57:26 +01:00
steelman 34fa2faba5
Look for ~/.config/avrdude/avrduce.rc configuration file (#1131)
* Look for ~/.config/avrdude/config configuration file

Traditionally per-user configuration files have been placed
in user's home directory with their names beginnig with a dot
to hide them from some tools like ls(1). However, the number
of programs following this convention have grown over time
to the point where the number of hidden files becomes inconvenient to
some users. For this reason the XDG Base Directory Specification[1]
specifies an alternate place to store configuration files under
~/.config directory.

This patch enables avrdude to look for ~/.config/avrdude/config
configuration file, if ~/.avrduderc doesn't exist.

[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html

* Safely concatenate directories and configurations files and minor changes in docs

* Make stats variable available for WIN32 again in main.c

* Utilise full usr_config[] array space

* Check for xdg-style avrdude.rc file first before fallback ~/.avrduderc

Co-authored-by: Stefan Rueger <stefan.rueger@urclocks.com>
2022-10-23 21:52:54 +01:00
MCUdude 992e9666a3 STK600 supports programming using PDI 2022-10-22 12:51:03 +02:00
MCUdude b083416e3b Let Avrdude use the valid SNAP USB PID first 2022-10-20 12:19:10 +02:00
Stefan Rueger 2503ae03ce
Merge pull request #1125 from MCUdude/updi-lock-fix
Fix UPDI erase when target is locked
2022-10-17 14:17:32 +01:00
Dan Applegate 946b701b08
Fix writing of last word on DWORD TPI parts (#1115)
* Fix writing of last word on DWORD TPI parts

* Add n_word_writes AVRMEM config option

* TPI word chunk mode in avr_write_mem

* Simplify addition of n_words_write mem component to grammar

Co-authored-by: Stefan Rueger <stefan.rueger@urclocks.com>
2022-10-17 14:15:50 +01:00
MCUdude bfec594ffd Fix issue where locked UPDI devices couldn't be erased
Resolves issue #1124
2022-10-13 14:14:46 +02:00
Hans da275f8ef2 Adjust prog_modes on a few chip variants
Now variants of chips that the JTAG ICE supports will not cause a warning when used with the original JTAG ICE mkI.
Also, The ATmega165 isn't officially supported by the ICE mkI, so this should be properly tested with the ICE mkI first.
2022-10-05 19:24:40 +02:00
Stefan Rueger 94203eb441
Merge pull request #1099 from stefanrueger/prog_modes
Print compatible parts for programmer and vice versa using -c? or -p?
2022-09-24 13:23:12 +01:00
Stefan Rueger db8b04f423
Merge pull request #1094 from papazoga/main
avrdude.conf.in: Adds digilent-hs2 dongle
2022-09-24 13:22:14 +01:00
Stefan Rueger 9e836d7988
Ensure avrdude.conf (programmer, part) pairs allow max one programming mode 2022-09-21 12:12:06 +01:00
Stefan Rueger 97c5ac312a
Shorten redundant programmer description for -c \? -p part 2022-09-20 21:37:49 +01:00
Stefan Rueger 4070ca9012
Distinguish different JTAG programming modes 2022-09-20 18:36:46 +01:00
Stefan Rueger 07f1f60020 Make cosmetic changes to avrdude.conf.in 2022-09-16 19:10:39 +01:00
Stefan Rueger 7a76967851 Clarify desc lines for SPM programmers in avrdude.conf.in 2022-09-16 16:14:18 +01:00
Stefan Rueger 669796119a Add prog_modes lines for par programmers in avrdude.conf.in 2022-09-16 16:13:18 +01:00
Stefan Rueger 0d411f2879
Add prog_modes lines for programmers in avrdude.conf.in 2022-09-14 18:36:37 +01:00
Stefan Rueger a5f3885b50 Add and modify programmers for gemmaBoot in avrdude.conf.in 2022-09-07 09:56:28 +01:00
Stefan Rueger b99df388bd
Change comment for diligent-hs2 in avrdude.conf.in 2022-09-01 13:08:44 +01:00
Alex Papazoglou bf70b5fc8c avrdude.conf.in: Cosmetic changes
Corrected formatting using /s. Added a URL for the
reference manual.
2022-08-31 20:43:27 -07:00
Alex Papazoglou 4af49bb5fb avrdude.conf.in: Adds digilent-hs2 dongle
Adds support for Digilint JTAG HS2 in MPSSE mode.
2022-08-31 11:45:08 -07:00
Stefan Rueger a536a01ebf
Create a bespoke bootloader programmer for gammaBoot trinkets 2022-08-31 18:15:35 +01:00
Stefan Rueger 40896802af
Allow integer expressions in config file where numbers are expected
Notable exceptions are for pin numbers and where numbers are separated by
space only, eg, in signature and readback assignments.
2022-08-31 11:29:06 +01:00
Stefan Rueger b328067f87
Remove has_jtag, has_debugwire, etc assignments in avrdude.conf.in
These assignments have been removed as they are redundant and only
imitate the single prog_modes = PM_... | PM_....; assignment. They
are still allowed in the grammar, and would still work.
2022-08-30 23:25:00 +01:00
Stefan Rueger 626a43b139
Add avrintel.[ch] to the project and warn if mcuid incompatible with avrintel.c 2022-08-30 19:48:17 +01:00
Stefan Rueger 0df8b87eda
Set part prog_modes, mcuid, n_interrupts and n_page_erase in avrdude.conf.in 2022-08-30 02:31:57 +01:00
Stefan Rueger ed2b8342df
Prepare for new components in avrdude.conf incl prog_modes
- Add prog_modes to part and programmer definitions; prog_mode is a bitwise
   or of programming modes
     + PM_SPM: Bootloaders, self-programming with SPM/NVM Controllers
     + PM_TPI: t4, t5, t9, t10, t20, t40, t102, t104
     + PM_ISP: SPI programming for In-System Programming (typ classic parts)
     + PM_PDI: Program and Debug Interface (xmega parts)
     + PM_UPDI: Unified Program and Debug Interface
     + PM_HVSP: High Voltage Serial Programming (some classic parts)
     + PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts)
     + PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
     + PM_JTAG: some classic parts, some xmega
     + PM_aWire: AVR32 parts
 - Add mcuid, a unique id in 0..2039, to part definition for urclock programmer
 - Add n_interrupts, the number of interrupts, to part definition
 - Add n_page_erase to part definition (# of pages erased during NVM erase)

 - Implement a simple calculator in config_gram.y so numeric values can be
   expressed as simple expressions such as PM_SPM | PM_UPDI

 - Introduce a new method of assigning simple components to the grammar without
   touching config_gram.y via an eligible-component list in config.c; numeric
   expressions on the rhs of an assignment resolve to integer values

 - Update documentation in avrdude.conf.in and avrdude.texi
2022-08-30 02:08:15 +01:00
Stefan Rueger cddf2943eb
Line up assignment operators in avrdude.conf.in 2022-08-30 01:10:45 +01:00
Stefan Rueger c97eb85cd8
Fix reset=dedicated|io; in avrdude.conf.in
Done by adding code in developer_opts.c that allows to inject part
or memory parameters into a semi-automated rewrite of avrdude.conf
This is a generic method, whereby an external program can, eg.,
scrape atdf files for the right parameters and put them into a
source table into developer_opts.c
  - Then write parts description with -p*/i
  - Use the output in a new avrdude.conf
  - Output again with -p* (no /i) and use that for final avrdude.conf
  - Remove table entries
2022-08-24 12:55:00 +01:00
Stefan Rueger 7fab75336e
Replace tabs in avrdude.conf.in with spaces 2022-08-24 11:46:24 +01:00
Stefan Rueger 716984dbb1
Reformat conditional programmers in avrdude.conf.in using -c* 2022-08-24 10:57:25 +01:00
Stefan Rueger 57ebd36a01
Rewrite avrdude.conf.in file from avrdude -c* -p* output
Some manual editing is still necessary to cater for the
@HAVE_PARPORT_BEGIN@ etc sections. This commit also fixes
superfluous whitesapce at the end of avrdude.conf.in lines

Although the avrdude.conf file has changed much, the internal
representation in avrdude has not. This can be verified by
exporting the raw internal data through

  avrdude -c*/r -p*/r >/tmp/avrdude.raw

before the change and by comparing again after the change:

  avrdude -c*/r -p*/r | diff - /tmp/avrdude.raw
2022-08-24 01:10:51 +01:00
Stefan Rueger 09d14601af
Fix 4 parts wrt to their interfaces in avrdude.conf 2022-08-24 00:54:11 +01:00
Stefan Rueger c03f4a7925
Use const in PROGRAMMER function arguments where appropriate
In order to get meaningful const properties for the PROGRAMMER, AVRPART and
AVRMEM arguments, some code needed to be moved around, otherwise a network of
"tainted" assignments risked rendering nothing const:

 - Change void (*enable)(PROGRAMMER *pgm) to void (*enable)(PROGRAMMER *pgm,
   const AVRPART *p); this allows changes in the PROGRAMMER structure after
   the part is known. For example, use TPI, UPDI, PDI functions in that
   programmer appropriate to the part. This used to be done later in the
   process, eg, in the initialize() function, which "taints" all other
   programmer functions wrt const and sometimes requires other finessing with
   flags etc. Much clearer with the modified enable() interface.

 - Move TPI initpgm-type code from initialize() to enable() --- note that
   initpgm() does not have the info at the time when it is called whether or
   not TPI is required

 - buspirate.c: move pgm->flag to PDATA(pgm)->flag (so legitimate
   modification of the flag does not change PROGRAMMER structure)

 - Move AVRPART_INIT_SMC and AVRPART_WRITE bits from the flags field in
   AVRPART to jtagmkII.c's private data flags32 fiels as FLAGS32_INIT_SMC and
   FLAGS32_WRITE bits

 - Move the xbeeResetPin component to private data in stk500.c as this is
   needed by xbee when it saddles on the stk500 code (previously, the flags
   component of the part was re-dedicated to this)

 - Change the way the "chained" private data are used in jtag3.c whilst
   keeping the PROGRAMMER structure read-only otherwise

 - In stk500v2.c move the STK600 pgm update from stk500v2_initialize() to
   stk500v2_enable() so the former keeps the PROGRAMMER structure read-only
   (for const assertion).

 - In usbasp change the code from changing PROGRAMMER functions late to
   dispatching to TPI or regular SPI protocol functions at runtime; reason
   being the decision whether to use TPI protocol is done at run-time
   depending on the capability of the attached programmer

Also fixes Issue #1071, the treatment of default eecr value.
2022-08-17 16:05:28 +01:00
Stefan Rueger e91f73392c
Merge pull request #1048 from MCUdude/jtagmkii-updi
Add `jtagmkii_updi` programmer option
2022-08-02 18:32:12 +01:00
MCUdude 104dcf6052 Add new jtagmkii_updi programmer type option
in order to resolve issue #1037
2022-07-26 11:36:50 +02:00
Stefan Rueger 4ada98a1a8 Udate the avrdude.conf introductory documentation 2022-07-20 00:57:35 +01:00
Stefan Rueger db37c9d286 Extend rather than reset memory entries in avrdude.conf
This commit changes the philosophy whenever avrdude.conf encounters the
same memory of a part for the second time or whenever a memory is
described that, through inheritance, already existed: AVRDUDE no longer
zaps the memory, it rather extends it.

Therefore, avrdude.conf.in's entry for ATmega128RFA1, which inherits from
the ATmega2561, needs a line `load_ext_addr = NULL;` in its flash memory
description to zap the inherited load_ext_addr SPI command.

Other than this, avrdude.conf.in needs no other change in order to effect
the same internal representation proving earlier updates to the .conf.in
file correct that manually ensured inheritance of memory contents.
2022-07-19 20:00:17 +01:00
Stefan Rueger 6fa7400e4e
Merge pull request #1015 from MCUdude/hv-updi
Add support for high-voltage UPDI
2022-07-18 14:28:39 +01:00
Stefan Rueger 1d3a7591ea
Merge pull request #933 from MCUdude/linuxspi-default-port-fix
Fix linuxspi default port
2022-07-18 14:25:52 +01:00
Jan Egil Ruud 91310e6f50 Move hvupdi_support list to a new prog_parm_updi group, and initialize the list. 2022-07-07 12:23:05 +02:00
Ruud, Jan Egil 9e5ea25b9e Add HVUPDI_SUPPORT list for programmers. 2022-07-05 14:14:37 +02:00
Stefan Rueger 00ea21597e
Merge pull request #1001 from MCUdude/add-missing-bits-and-pieces
Add missing delays in avrdude.conf
2022-07-05 00:05:32 +01:00
Ruud, Jan Egil 65763b5700 Correct hvupdi_variant for AVR DD devices. 2022-06-29 17:12:57 +02:00
MCUdude ba98e48880 add "hvupdi_variant" property to avrdude.conf 2022-06-29 17:12:52 +02:00