Handle putting the final error message by prepending the output.
This removes issue with errors being concatenated and gives an
interractive output.
The errors are now send to stderr.
The example in the tool documentation contains several things that are
wrong:
- exports PORT.
- Defines the port using :=.
- Defines PORT instead of PORT_LINUX, PORT_DARWIN
- ifeq-based logic (which will force an evaluation).
I have not tested the new example script.
Handle differently variables that are exported in `vars.inc.mk` from the
ones that should not.
This is needed for the upcoming variables change that should also be
removed from `vars.inc.mk` right now.
Keeping the old behavior will help migrating other variables more easily
by keeping them only exported in vars.inc.mk in the first time.
Some boards have a configuration of the flash bank with an address of 0
when it actually starts as 0x08000000 but openocd relies on probing
the hardware at runtime.
This now allows to first probe the board to get the actual value.
If probing fail for any reason, return the value from the configuration.
This can happen when the board is unreachable so at least give a valid
output instead of an error.
This will allow correct flash detection on for example the `stm32f3` and
`stm32l4` which have a configured address of 0.
4a6f93c961/tcl/target/stm32f3x.cfg (L64)4a6f93c961/tcl/target/stm32l4x.cfg (L51)
Remove the check that directory are git tracked or not.
This should not be done by the script and was a mistake.
If need be to be checked it should be moved to RIOT 'info-applications'
and running tests should be done in a clean environment anyway.
Currently giving an absolute or outside of RIOT application breaks the
result directory evaluation which can lead to deleting the application.
Add an assertion to detect it.
Check that some variables are not exported in the build system.
This should track variables that managed to not be exported anymore so
that they do not reappear in a BSP.
It is not a whitelist but just a way to keep things cleaned in the
future.
Otherwise, when an error occurs (e.g. credentials wrong on git push)
the worktree and the release branch still exists, which might be hard to
remove for a newcomer not knowing about `git worktree`.
The init_cmd feature is quite handy for automated pyterm runs but there
is no delay between the commands that are executed.
This adds a /sleep function that can be added between init_cmd commands
to prevent them from overflowing the RX buffer on the target.
On error Jlink exits with a no error code by default.
From the JLink User Guide:
'-ExitOnError' has the same meaning as the 'exitonerror' command
'exitonerror' command
This command toggles whether J-Link Commander exits on error or not.
1: J-Link Commander will now exit on Error.
0: J-Link Commander will no longer exit on Error.
Executing 'flash/reset' without a board connected now correctly returns an
error. For 'term' it does not show an error due to the way it is handled
internally.
It also returns an error when the board fails to do an operation when it
is in a state where it cannot be flashed for example.
Use the new 'test/available' target to detect if there are tests.
This prevents issues where calling make would print unrelated debug
messages that would be taken as an output.
The targets executed to check if there are tests can be set with
'--test-available-targets'.
The build system contains several instances of
INCLUDES += -I$(RIOTBASE)/sys/posix/include
This is bypassing the module management system, by directly accesing
headers without depending on a module. The module is the posix module.
That line is also added when one of the posix_* modules is requested.
According to the docs, the posix module provides headers only, but in
reality there is also inet.c.
This patch:
- Moves `inet.c` into `posix_inet`, leaving `posix` as a headers-only
module.
- Rename `posix` as `posix_headers` to make it clear the module only
includes headers.
- Makes `posix_*` modules depend on `posix_headers`, thus removing the
explicit `INCLUDES+=...` in `sys/Makefile.include`.
- Ocurrences of `INCLUDES+=...` are replaced by an explicit dependency
on `posix_headers`.
The lastest version of edbg solves a double-reset issue that was
hindering testing (see #11125 and https://github.com/ataradov/edbg/issues/77)
It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU
port.
When local echo is enabled, pexpect will also match on send lines to the
node. So could think a node is echoing when it is only seeing the sent
message.
The sent messages are still written to `logfile` but now only once.
This may show issues with our current tests implementation that expected
this behavior.
Update the help message in the docstring.
It should reflect the content of `--help`.
I replaced the manual line wrapping by disabling the warning on the
docstring.
This script provides functionality to easily backport a merged pull request to
a release branch.
It relies of having a `github` API token stored in `~/.riotgithubtoken` by
default.
The script works by fetching information from the supplied **merged** pull
request. It then looks for the last release branch.
A temporary git `worktree` with a new branch is created based on this release
branch. All commits from the pull request are then cherry-picked into this
branch which is then pushed to `origin`.
It then creates a new pull request on `github` with a reference to the original
pull request. It optionally puts a comment under the original pull request to
the new backport pull request.
Co-authored-by: Gaëtan Harter <gaetan.harter@fu-berlin.de>
Python3 has been the default in our scripts for some time now, but pyterm still
requested python which uses python2 on ubuntu stable.
This pushes toward only needing to install `python3` python
dependencies.
I had this idea when implementing #10382 and #10392 as I introduced a
very similar structure to python's standard unittests in those and it
could also reduce some code duplication between those two tests.
If not defined it was raising a KeyError. Use the 'get' function to
handle non defined value.
It did not put the value in the `default` case as it would have changed
the behavior when `RIOTBASE` is defined but empty.
If the flake8 executable is not found, the static test script reports
the tool as missing. It may happen that the flake8 module is installed,
but the console entry point is not.
In the flake8 shell script, flake is invoked via `python -m`. The result
is a confusing error message where static-test reports the tools as missing,
yet the flake8 tests are run.
This patch makes the toolchain version script use the same command as the
flake8 script.
Detect command line tool versions without using "command".
Command may be a builting in some shells, leading to unportability.
The new version uses the status code to correctly detect a non-existent
command. This allows it to differentiate between error in the tool and
not-found errors.
It also works with compound commands, for example `python -m callable_module".
In order to use the RIOT bootloader (riotboot) a header needs to
be created and placed before the firmware. This tool generates
such a header with the expected information by the bootloader.
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
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.
The previous doccheck would give a false negative when doxygen does
not even run (for example, because of misconfiguration).
Also, when doxygen fails to run, print the full output.
Add a script to execute sanity checks on build system files.
It should prevent bad patterns to re-appear after being cleaned.
Currently adds a check for using the content of `FEATURES` instead of
`USEMODULE`.
Modules should not check the content of FEATURES_PROVIDED/_REQUIRED/OPTIONAL
Handling specific behaviors/dependencies should by checking the content of:
* `USEMODULE`
* maybe `FEATURES_USED` if it is not a module (== not a periph_)
https://stackoverflow.com/a/24276470
In replacement strings used with the s command, assume that NO
control-character escape sequences are supported (ex '\n')
Replace with an escaped newline character. Current form works in 'bash'.
https://stackoverflow.com/a/24276470
Labels and branching commands (e.g., b) must be followed by an actual
newline or continuation via a separate -e option.
This removes all non-application based driver/devices and replaces with riot_pal.
riot_pal (riot protocol abstraction layer) can be installed with pip install riot_pal.
The purpose is ti simplify and modularize the interfaces and tests.
All tests using the if_lib interface are updated too.
In [#10030][1] it was decided to rename all labels to reflect their
respective category. The labels "NEEDS SQUASHING" and "Waiting For Other
PR" are used in the `dist/tools/pr_check/pr_check.sh` script however, so
that script needs to be adapted.
[1]: https://github.com/RIOT-OS/RIOT/issues/10030
This new tool allows configuring the reset pin for nRF52-based
boards. As the reset pin configuration is persistent, it does not
make sense to include it into the board code...
Cppcheck was (correctly) warning here that concat to strings might
result in buffer overflow because the terminating `\0` was not considered.
This is fixed here, making the cppcheck suppression also obsolete.
Extend the cppcheck suppression example to show that each suppression
should have a reason describing the intentional suppression of a
cppcheck warning or error.
Currently version information of commands and tools is only parsed
from STDOUT, however some tools like openocd print version info
to STDERR only. This commits adds parsing of STDERR for version
infos if STDOUT does not contain such info.
When executing `make test` on devices using JLink, testrunner
launches `make term` which calls `jlink.sh term_rtt`. When finished
the father process is killed but `setsid` has launched JLinkExe
as another subprocess, which is not killed by `os.killpg` from
testrunner since it doesn't belong to the same group.
While running `make term` JLinkExe is expecting commands and thus
can be disturbed by other JLink commands, e.g. `make reset`.
This enable `make test` (which runs those two commands at the same
time) on target using JLinkExe as a programmer/debugger.
Add the rom base address to the flash address when flashing binaries.
This allows flashing binaries with the default openocd configuration.
It is an API change to IMAGE_OFFSET with binary files as it should now
only be an offset to the base address.
Force openocd type to '.bin' in case we want to flash hex/elf objects or
files not automatically recognized as bin.
This allows getting the ROM base address.
It may not be available in the build system directly so better extract it from
openocd. Also openocd is board specific and this address is cpu specific
so would have definition order issue in the build system.
When flashing with an IMAGE_OFFSET, it should also be passed to
verify_image. It is handling the base address in the image too.
This works with both elf files and binaries with the base address added.
This PR add deprication warning to notify anyone using the if_lib files that it is being removed from RIOT repo and making it's own repo (RIOT-OS/lib_if).
This is intended to help wil modularization since it is not only being used within RIOT but in other areas as well.
README files are updated to indicate the change and if the if_lib is used it will throw a warning indicating the deprecation.
Write stdin to <outfile> if it is different from the previous content.
If data provided in stdin is the same as the data that was in <outfile>, it is
not modified so `last modification date` is not changed.
Introduce dist/pythonlibs directory to store RIOT python packages.
This directory is exported via PYTHONPATH by the build system to
make it commonly available.
Create if_lib package containing all the modules and adapt the *.py files
to import each other using the intra-package references.
The idea behind a package is to invoke test.py either by permanently
modifying PYTHONPATH in user profile via adding path to $RIOTBASE/dist/tests
or make temporary PYTHONPATH changes during the invocation:
PYTHONPATH=$PYTHONPATH:$RIOTBASE/dist/tests python3 test.py
Leave periph_i2c_if.py in the same folder as test.py as this file is
just a Python wrapper around periph specific main.c.
Update BPT memory map. Use definitions generated with the latest code
generator. Both routine names and mapping have changed.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Since the `iotlab-term` target uses `tmux` error messages are not really
printed, so it took me a while to find out why at some sites this target
wasn't working for me anymore.
If the IoT-LAB password was changed, just checking if `.iotlabrc`
exists isn't enough, so I use `iotlab-experiment` to check if I'm logged
in properly to prompt the password input in case I'm not.
update to the current lastest version of EDBG to allow user to reflash a bricked board due to sleep mode or wrong clock assignment. this avoid the use of Atmel Studio to erase flash.
The new tool (mkconstfs2) features:
* more robust filename handling: no need for mangling,
and works on Windows.
* Better output generation: nothing is written in case
of failures.
* Allows more control over the files that are included:
- does not traverse directories, filenames must be explicitly
given.
- The "root" can be explicitly given (thus the tool can get
the same result independently of the CWD).
Thanks to MichelRottleuthner for making it work with Windows paths.
Add support to do flash/reset/term on an IoT-LAB node.
It also allow running test using 'testrunner'.
Configuration variables are:
* `IOTLAB_NODE` which should be set to your node url
* The full url including site to use from your computer `m3-1.grenoble.iot-lab.info`
* The short url when used on the IoT-LAB frontend `m3-1`
* `IOTLAB_EXP_ID` for your experiment id for flash and reset.
By default it tries to use your currently running experiment if you have only one
* `IOTLAB_USER`: is read from `${HOME}/.iotlabrc` as saved by `iotlab-auth`
* It is expected to have run `iotlab-auth` beforehand.
Add a specific case of EOF on stdin to avoid situations where the
message `error reading from stdio. res=0` is repeated forever if stdin
is not a terminal. When ethos is started as a background process with
stdin redirected to /dev/null, e.g. `ethos ... < /dev/null &`, then
reading stdin will always result in a 0 length read (EOF).
If stdin is a tty we close the program on EOF (CTRL+D in the terminal),
otherwise, we stop reading from stdin after EOF was reached, but
continue tunneling traffic as usual.
The doccheck script reports reports a false positive when executed from
any directory but `RIOTBASE`. With this fix, `make doc` changes into
the currently unused `RIOTBASE` variable.
This is an alternative approach to #7217, which removes this variable,
but keeps the false positive aspect of the script untouched.
When installing the `serial` package (in contrast to `pyserial`)
the pyterm script will print a cryptic error message and fail.
This is because both packages, though unrelated, expose a `serial`
package (whereas pyserial should expose `pyserial`).
This change catches the error and might save some precious lifetime
of unsuspecting RIOT users, such as myself.
Attempt to decouple board configuration from debugger interface
configuration by specifying the DEBUG_IFACE variable for the debug
hardware interface to use.
The object-like access to frame information in the traceback was only
introduced in Python 3.5. Before that version it was a 4-tuple [[1]].
The indexed way to access the frame seems to be upwards-compatible for
newer versions (tested with python 3.5, maybe some of the Arch crew can
test with even newer versions), so I used that one.
[1]: https://docs.python.org/3.4/library/traceback.html#traceback.extract_tb