Commit Graph

17 Commits

Author SHA1 Message Date
Stefan Rueger 8da9c2bbf6 Correct bit number for lone 'a' in config_gram.y
When an SPI command has a lone 'a' the initialisation now is as would be
expected by all commands that take an address. Atmel's opcodes for SPI
programming are consistent in this respect. This commit makes specifying
the bit number in avrdude.conf optional. Instead of

 read_lo = "0 0 1 0 0 0 0 0  0 0 a13 a12 a11 a10 a9 a8  a7 a6 a5 a4 a3 a2 a1 a0  o o o o o o o o";

one can now use

 read_lo = "0 0 1 0 0 0 0 0  0 0 a a a a a a  a a a a a a a a  o o o o o o o o";
2022-07-19 14:46:08 +01:00
Stefan Rueger e52bd2b99b Move realpath() compatibility definition from config_gram.y to config.h 2022-07-19 08:05:42 +01:00
Stefan Rueger eba67e56fc Make realpath() available for MSC and MINGW32 2022-07-19 07:42:44 +01:00
Stefan Rueger f95a1d3448 Cache config_file components in AVRPART and PROGRAMMER structures
Some 90% of the space of AVRPART and some 50% of PROGRAMMER is occupied by a
4 kB array config_file[] that contains the configuration file name. In
preparation of developer options that output a raw dump of the part
descriptions, this commit changes the config_file components from a large
array, which is duplicated in each part and programmer description, to a
cached string for each config file allowing for smaller raw dumps.

This commit also changes the config file name to its realpath(), eg, shortens
unwarranted `/bin/../etc/` file name components. It also changes the global
variable names `infile` and `fileno` to cfg_infile and cfg_fileno for an ever
so slight improvement of code clarity.
2022-07-18 18:10:09 +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
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
MCUdude ba98e48880 add "hvupdi_variant" property to avrdude.conf 2022-06-29 17:12:52 +02:00
MCUdude 6fceea8f71 Fix linuxspi default port
If no port is specified, Avrdude will try to use the default port specified in avrdude.conf. If not present, use port specified in linuxspi.c
2022-04-11 22:28:12 +02:00
Joerg Wunsch 452f673f38 Back out the last "alias" commit (search for existing alias).
It breaks the alias handling completely as the search happens
way too late. So instead, just keep any possibly duplicate
name as it won't be in our way anyway.
2022-02-10 21:26:05 +01:00
Jörg Wunsch d134dc8fff
Alias keyword (#868)
Implementation for an "alias" keyword.

By now, only applied inside memory descriptions.

* Make "mem_alias" a separate nonterminal.

The previous implementation attempt caused a syntax error in
yacc code, and separating mem_alias on the same level as
mem_spec appears to be the cleaner solution anyway.

* Maintain real memory aliases.

Instead of duplicating the aliased memory with a new name, maintain a
second list of memory aliases (per device) that contains a pointer to
the memory area it is aliased to. That way, a memory name can be
clearly distinguished between the canonical one and any aliases.

* Check p->mem_alias != NULL before touching it

* Add avr_find_memalias()

This takes a memory region as input, and searches whether an
alias can be found for it.

* We need to add a list structure for the mem_alias list, always.

By that means, mem_alias won't ever be NULL, so no need to check
later.

Also, in avr_dup_part(), duplicate the alias list.

* In a memory alias, actually remember the current name.

* In avr_dup_part(), adjust pointers of aliased memories

While walking the list of memories, for each entry, see if there is an
alias pointing to it. If so, allocate a duplicated one, and fix its
aliased_mem pointer to point to the duplicated memory region instead
of the original one.

* Add avr_locate_mem_noalias()

When looking whether any memory region has already been defined for
the current part while parsing the config file, only non-aliased names
must be considered. Otherwise, a newly defined alias would kick out
the memory definition it is being aliased to.

* When defining a mem_alias, drop any existing one of that name.

* Actually use avr_find_memalias() to find aliases

* Add declaration for avr_find_memalias()

* When defining a memory, also search for an existing alias

If the newly defined name has the same as an existing alias, the alias
can be removed.

Note that we do explicitly *not* remove any memory by the same name of
a later defined alias, as this might invalidate another alias'es
pointer. If someone defines that, the alias name just won't ever be
found by avr_locate_mem().
2022-02-10 20:39:19 +01:00
Joerg Wunsch 8c6c6a14ec Remove the "safemode" feature.
This feature has been designed with the sometimes quite flakey direct
(parallel or serial port attached) bitbang programming adapters in
mind that were quite common about two decades ago.

With parallel ports vanishing from modern PCs almost completely, and
the advent of various USB-attached low-cost programming devices,
this class of programmers disappeared almost completely.

Furthermore, the fuse combinations that were covered by the feature
are no longer around on all recent AVR devices, so for an ever
increasing number of devices, safemode already became meaningless and
was turned off anyway.

With the prospective version 7.x release, it's a good point in time to
introduce a major change like this one.
2022-01-31 20:44:32 +01:00
Marius Greuel f67cb3c224 Preserve the insertion order of programmers and parts when parsing the avrdude.conf file 2022-01-09 11:52:52 +01:00
Jörg Wunsch 6a737a0c13
Merge pull request #798 from mariusgreuel/pr-msvc
Add MSVC builds and better WinUSB/FTDI support
2022-01-07 18:30:19 +01:00
Marius Greuel fc54ef5e59 Clean up legacy code 2022-01-07 17:57:02 +01:00
Yegor Yefremov f29b2a283a Fix typos all over the code 2022-01-07 11:31:16 +01:00
Marius Greuel 5633a6d88a Move source files to 'src' folder 2021-12-17 09:17:42 +01:00