The generic approach of calling avrdude to perform a reset with `make reset`
does also work on board with a bootloader, but only if no other process is
also accessing the serial (e.g. via `make term`). `make test` first accesses
the serial and then performs `make reset` to not miss any output on the serial.
This however blocks when `make reset` also wants to access that serial.
As workaround, `make reset` is no only provided if the ATmega device is not
programmed via bootloader. Normally, those boards reset anyway upon `make term`,
which allows `make test` to work normally again.
miniterm.py is a simple terminal program that is included with pyserial.
This means that it is available wherever pyterm can work. It allows raw
access, does line translation and passes through special characters.
Co-authored-by: Juan Carrano <j.carrano@fu-berlin.de>
In order to flash AVR devices, avrdude needs the ability to reset them:
Those using a bootloader will only enter it after a reset, and those programmed
via ISP also need a reset to enter ISP mode.
Sadly, avrdude has no option to reset the board. But running it without commands
will read and print the boards identification and fuse settings. For this, as
reset is needed. This commit uses this side-effect reset to implement make reset
for all AVR based boards
- Move serial.inc.mk in mega-xplained/Makefile.include after
PROG_DEV so PROG_DEV can still default to PORT
- Add deprecation warning for arduino-leonardo and mega-xplained
By ensuring the PORT auto-detection worked, we can give meaningful
error messages and fail earlier.
This uses ensure_value from makefiles/utils/checks.mk. An include was
added to Makefile.include to make this fuction available to all other
makefiles.
This script can detect [Black Magic Probes](https://github.com/blacksphere/blackmagic/wiki) and act as a flashloader (and more).
It is compatible with Linux and macOS.
All important options that can be set via the monitor command are available as arguments.
Makefiles for using `make flash`, `make erase`, `make debug` and `make term` with the script are included.
This commit overrides the default flash recipe with an edbg specific
one.
The new recipe first verifies the flashfile agains the device flash. If
it is already on there, it won't get overridden.
edbg takes care of resetting the device in any case.
pic32prog is a program for flashing pic32 boards from command line on Linux.
It works with:
* Microchip PICkit2
* Microchip PICkit3 with script firmware.
* Other ones: https://github.com/sergev/pic32prog/wiki
Add a variable for `pyterm` specific flags that are not handled by other
terminals.
This will prevent issues with boards that have options only supported by
`pyterm` and setting `pyterm` options from the environment.
This variable is only used for the term recipe (and maybe for flashing). They
should not be evaluated if they are not needed and the user should not see a
warning that the port is not set if he does not use port (for example in make
all.)
DEBUGGER/DEBUGGER_FLAGS/DEBUGSERVER/DEBUGSERVER_FLAGS are evaluated by the
main Makefile.include or by file included by it.
Their value does not need to be exported.
Testing
-------
`git diff --word-diff` only reports `export` being removed.
`git show --stat` reports `55 insertions(+), 55 deletions(-)`
Which is the same amount as lines that where matching
`export[[:blank::]]\+VARIABLE`.
RESET and RESET_FLAGS are evaluated by the main Makefile.include or by file
included by it. Their value does not need to be exported.
This will also prevent evaluating 'PORT' for RESET_FLAGS when not needed.
Testing
-------
`git diff --word-diff` only reports `export` being removed.
`git show --stat` reports `24 insertions(+), 24 deletions(-)`
Which is the same amount as lines that where matching
`export[[:blank::]]\+VARIABLE`.
FLASHER and FFLAGS are evaluated by the main Makefile.include or by file
included by it. Their value does not need to be exported.
This will also prevent evaluating 'PORT' for FFLAGS when not needed.
Testing
-------
`git diff --word-diff` only reports `export` being removed.
`git show --stat` reports `84 insertions(+), 84 deletions(-)`
Which is the same amount as lines that where matching
`export[[:blank::]]\+VARIABLE`.
In UniFlash 4.4.0 the directory where 'xds110reset' is changed.
Try to use the newest one available. If none is found in UNIFLASH_PATH,
try to use one from the PATH to be sure to have a value.
./uniflash_4.1/simplelink/gen2/bin/xds110reset
./uniflash_4.3.0/simplelink/gen2/bin/xds110reset
./uniflash_4.4.0/simplelink/imagecreator/bin/xds110reset
./uniflash_4.5.0/simplelink/imagecreator/bin/xds110reset
Modern versions of GDB support multiple targets with the same gdb binary.
At least Ubuntu and Debian have dropped the gdb-arm-none-eabi package in favour
of gdb-multiarch.
Here, no $(PREFIX)-gdb binary is availiable, instead gdb-multiarch should be used.
This patch tries to automatically detect the presense of gdb-multiarch and uses it
instead of arm-none-eabi-gdb.
The CPU variable in the boards Makefile.include file already contains the target
CPU, so there is no reason to provide it in each board again as avrdude flag.
This commit automatically sets the avrdude target from the CPU variable and
removes the unneeded flags.
Currently the flag "-P ${PORT}" is added to avrdude regardless of the programmer
used. But this flag should only be set for programmers that operate over a
serial port - e.g. like the various Arduino bootloaders. This commit changes
the behaviour so that the "-P flag" is only set for only of the default
programmers of the various AVR boards supported by RIOT. This allows to use
ICSP programmers (e.g. like the usbtiny) like this:
make BOARD=arduino-uno PROGRAMMER=usbtiny
Due to a recent fix in shell.c, remote echo is now working as originally
intended. Local echo must be disabled or otherwise it will add up to the
remote one, causing a character-by-character double echoing.
TERMPROG and TERMFLAGS variables do not need to be exported as they are
used directly by a make receipe.
Exporting them prevents overwriting 'RIOT_TERMINAL' in the test.
Allows to use avrdude as a flashing tool in any context
(e.g. not dependent on arduino or atmega) though it only
works (AFAIK) on atmega, but I thought it's better to
have it here as we have other flashing tools.
Get FLASH_FILE and ELFFILE from command line instead of environment variable.
The documentation was claiming ELFFILE was given as a command line argument
already, but is was not.
Get BINFILE and ELFFILE from command line instead of environment variable.
Rename 'HEXFILE' to 'BINFILE' in the script as the binary file is used.
The documentation was already talking about 'BINFILE' but 'BINFILE'
was never exported by the build system and it was using 'HEXFILE' in the
implementation.
Handle that `IMAGE_OFFSET` can be set to something that contain spaces.
With 'IMAGE_OFFSET=$$((0x1000 + 0x1000))' we had in the command line when doing
'flash'
--offset $((0x1000 --offset + --offset 0x1000))
With the change we correctly have
--offset $((0x1000 + 0x1000))
Allow flashing with an offset in ROM from the rom base address.
It reuses `IMAGE_OFFSET` configuration variable name from `openocd.sh`.
This will allow flashing multiple images with different flash operations.
Attempt to decouple board configuration from debugger interface
configuration by specifying the DEBUG_IFACE variable for the debug
hardware interface to use.