Microchip offers ready-to-use modules with the mrf24j40 chip.
All but the MRF24J40MA integrate an external PA/LNA, they also come
with an RF shield.
If the PA/LNA is not enabled, the signal off these modules is really
poor.
This adds pseudomodules so that the PA/LNA is automatically enabled
when the appropriate module is used.
Do not remove the '-D' and '-U' values from CFLAGS.
This prevents issues where a '-D' could contain a space.
Some values way be duplicated from the 'riotbuild.h' header and the
command line but with the same value so without conflict.
To not put too many things in the command line, the -DMODULE_NAME are
only put in CFLAGS_WITH_MACROS.
Also, as now, the deferred value of CFLAGS is used for 'riotbuild.h',
macros set after the inclusion of `Makefile.include` will be taken into
account.
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
Depending on the PROGRAMMER used, the file used for flashing may be
different, like openocd/jlink, so the file being generated when
compiling should be different.
Because of this, when building in docker, the build system needs to know
for which programmer you are building for.
This manifested for 'nordic_softdevice' applications when using 'openocd'
but is not limited to this case.
This adds a new target "archive-check".
Thin archives should be created with relative paths so that archives created
in a build container are useful in the host. This check ensures there are no
absolute paths inside thin archives.
Normal, or thick archives contain a copy of the object code. Thin
archives, on the contrary, are just an index to the .o files.
This patch does two things:
1. Change ARFLAGS to enable the "T" options.
2. Call AR with all relative paths.
The second step is necessary because the build system handles all
absolute paths. If the index in the thin archive contains absolute
paths, archives created in docker are no usable outside, and moving
the objects breaks the archive.
If all arguments to AR are relative, the resulting archive contains
filenames *relative to the .a file* and nothing should break as long
as the relative location of the .a and .o remains unchanged.
Compilation time is unchanged, but disc usage is reduced by approximately
50%. These are the result of a full RIOT build:
| Thin Archive | no | yes | Savings (%) |
| -------------- | ------: | ----: | ----------- |
| pkg (10e6 KiB) | 1 790 | 905 | 49% |
| Non pkg | 71 | 71 | 1% |
| Total | 1 812 | 976 | 46 % |
The default channel configuration is managed within the Makefiles of many
examples and tests. This commit moves the default channel logic to
`makefiles/default-channel.ink.mk` to ease maintenance. All Makefiles that
previously managed the default channel configuration themself have been
updated to include that file.
The default channel configuration of the cc110x has been added
Use the -gz option to compress ELF sections containing DWARF information.
This saves around 50% of disk space, without any side effects.
See https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Debugging-Options.html#Debugging-Options
for more infomation on this option.
Some platforms have an outdated toolchain that does not support -gz so
the flag is blacklisted there. Even then, the results are quite impressive.
I used @cladmi's `buildtest` branch (https://github.com/cladmi/RIOT/tree/wip/du/buildtest)
with this change and compiled the `examples/default` application:
```
$ BUILD_IN_DOCKER=1 DOCKER="sudo docker" make -C examples/default buildtest-indocker
```
The size was obtained with:
```
$ find output -name "*.bin.bindirsize" -type f -exec tail -n1 '{}' \; | cut -f 1 | awk '{s+=$1} END {printf "%.0f", s}'
```
Results:
- Vanilla: 10328112 KB (~10GB).
- with -gz: 4982788 KB (~5GB).
This was inspired by #8496.
The current code for detecting whether colors should be used by default
was not working. Normally what programs such as git or grep do is check
if they are writing to a pipe.
To see the issue by yourself:
$ BOARD=samr21-xpro make -C tests/periph_qdec > I_SHOULD_NOT_HAVE_COLORS 2>&1
This commit uses MAKE_TERMOUT, MAKE_TERMERR and if ANY of them is NOT
a terminal, colors are disabled.
Update the optional flags to use 'OPTIONAL_CFLAGS' instead of evaluating
everytime.
They are now blacklisted by architecture/toolchain according to the
current docker reference image.
Handle declaring OPTIONAL_CFLAGS and blacklisting them with
OPTIONAL_CFLAGS_BLACKLIST.
This should replace checking everytime if options are supported.
Add make only function to convert strings to lowercase and uppercase.
This can replace the `$(shell echo $(var) | tr 'a-z-' 'A-Z_')` pattern.
Using the 'make' implementation results in being around 100 times faster.
CFLAGS_CPU is required for 'pkg/openthread'. So declare it as a global
compilation variable.
The goal is to move the export to `makefiles/vars.inc.mk` and remove the
local exports that could be in boards/cpu/arch.
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.
Rename TMP006 to TMP00x
Add TMP007 sensor support to TMP00X
Change uint8_t reg to uint16_t
Add to doxygen documentation group
Expose compile time configurations
Move defines from .c to .h
Change double to float, because double is not needed
Add TMP007 register information
The value must be saved from the original value to allow restoring it.
This has currently no impact on 'info-boards-supported' as it is
currently ignored.
By default if a test is available and not blacklisted it will be run by
murdock.
This will move from a whitelisting everything that works, to
blacklisting what fails. This way, failing tests will be easier to
track instead of being silently just not run.
It could even allow introducing failing tests before a fix is available.
Only set `TEST_ON_CI_ENABLED` if the application has tests.
Currently `TEST_ON_CI_WHITELIST` was only set if there were tests.
This is a pre-step to have `TEST_ON_CI_WHITELIST` being `all` by
default.
The cc110x driver has been re-written from scratch to overcome the limitations
of the old driver. The main motivation of the rewrite was to achieve better
maintainability by a detailed documentation, reduce the complexity and the
overhead of the SPI communication with the device, and to allow to
simultaneously use transceivers with different configuration regarding the used
base band, the channel bandwidth, the modulation rate, and the channel map.
Features of this driver include:
- Support for the CC1100, CC1101, and the CC1100e sub-gigahertz transceivers.
- Detailed documentation of every aspect of this driver.
- An easy to use configuration API that allows setting the transceiver
configuration (modulation rate, channel bandwidth, base frequency) and the
channel map.
- Fast channel hopping by pre-calibration of the channels during device
configuration (so that no calibration is needed during hopping).
- Simplified SPI communication: Only during start-up the MCU has to wait
for the transceiver to be ready (for the power regulators and the crystal
to stabilize). The old driver did this for every SPI transfer, which
resulted in complex communication code. This driver will wait on start up
for the transceiver to power up and then use RIOT's SPI API like every other
driver. (Not only the data sheet states that this is fine, it also proved to
be reliable in practise.)
- Greatly reduced latency: The RTT on the old driver (@150 kbps data rate) was
about 16ms, the new driver (@250 kbps data rate) has as RTT of ~3ms
(depending on SPI clock and on CPU performance) (measured with ping6).
- Increased reliability: The preamble size and the sync word size have been
doubled compared to the old driver (preamble: 8 bytes instead of 4,
sync word: 4 byte instead of 2). The new values are the once recommended by
the data sheet for reliable communication.
- Basic diagnostic during driver initialization to detect common issues as
SPI communication issues and GDO pin configuration/wiring issues.
- TX power configuration with netdev_driver_t::set() API-integration
- Calls to netdev_driver_t::send() block until the transmission has completed
to ease the use of the API (implemented without busy waiting, so that the
MCU can enter lower power states or other threads can be executed).
This allows passing other arguments as environment variables in
DOCKER_ENVIRONMENT_CMDLINE and as command line override in
DOCKER_OVERRIDE_CMDLINE without using the automatic detection.
This will allow passing USEMODULE to docker as its value is usually set
in an application Makefile so has its origin changed.
This allows setting other variables that should be exported to the
docker build.
As for other variables, they must still be unmodified before parsing
`docker.inc.mk` to be exported.
The value must be saved from the original value to allow restoring it.
This has currently no impact as 'makefiles/defaultmodules.inc.mk'
and 'DISABLE_MODULE' are ignored in this parsing.
This remove executing buildtest `for` loop in docker.
When building completely in docker, 'buildtest' would hide issues when
the host toolchain would be used when doing `make all` directly.
It has the consequence that it now starts a container for each
compilation which is slower.
The previous behavior can be reproduced by using
BUILD_IN_DOCKER=1 make buildtest-indocker
A side effect is also that now `BUILDTEST_MAKE_REDIRECT` would work when
doing `buildtest` with docker.
Add a 'buildtest-indocker' that forces executing 'buildtest' for loop
completely inside the container.
It prevents starting one container per compilation wich is slower but
it could hide errors where the host toolchain would be used
It is currently equivalent to `buildtest` but will change when the
`buidtest` handling will be move outside of `BUILD_IN_DOCKER`.
Display an error when executed without BUILD_IN_DOCKER=1.
Move git version evaluation to a separate file.
The definition has been updated it to a deferred only definition.
This way git is not called when GIT_VERSION is not used.
Document `BINFILE` in the same ways as `HEXFILE`.
The file does not need to be exported so no reason to do it though.
It also adds it in the `info-build` output in the same way as `HEXFILE`.
Previously, this was hard-coded to allow one file, hard-coded to be
called "flash file".
This commit allows multiple files to be specified via adding them to the
TEST_EXTRA_FILES variable. All files will be stored in the worker's
application bin directory.
Also, the existence check has been removed, as dwqc bails out on missing
file anyways.
... if the riotboot feature is used.
Previously, even an application that had "FEATURES_REQUIRED += riotboot"
set would still flash the non-riotboot binary on "make flash".
This is usualy not what the user wants.
This commit set's the FLASHFILE variable to the combined "riotboot
bootloader + slot0 + empty slot1" binary. This has the effect that make
all, flash and flash-only will compile and/or flash a working riotboot
setup.
tests/riotboot and tests/riotboot_flashwrite now default to flashing the
riotboot-extended binary. tests/riotboot was previously configured to
use the riotboot-combined binary. This has been changed in order to not
behave differently than how usual riotboot applications do.
Introduce a variable to set that a test is blacklisted.
This is a move toward enabling tests by default and adding a blacklisting
reason instead for a board instead of not whitelisting them which hides
the problem.
Currently, a test should be both whitelisted and blacklisted at the same
time to have a meaning. It is planned to whitelist all by default in
an upcoming pull request.
Refactor the handling to use a variable to store if a test is enabled.
Add a 'test-on-ci-enabled' target that test if the test on ci is enabled.
This is a first commit before changing the behavior.
Currently sam0 will always use OpenOCD, even when the JLink programmer is selected.
Instead, use JLinkExe when it's availiable and a J-Link programmer is used.
Evaluate BOARDS only once before going in all directories.
This uses the target specific 'export BOARDS ?=' to export the variable
with its value without evaluating during parsing.
* Add a variable to list all boards without using 'find'.
* By default 'BOARDS' is the list of all boards.
* Add the 'info-boards' target that lists BOARDS.
* Use in RIOT/Makefile
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.)
Rational: the periph_common module is required by (most) other periph drivers
and also during startup of the CPU/MCU to run periph_init. The latter is only
required if other periph drivers are used, hence periph_common should be a
depency of periph_* modules and *not* of the CPU/MCU. This PR fixes that
by making periph_common a depency of periph_* and removing the explicit
include in the CPU/MCU implementation.
Put the definition of `FEATURES_USED` in common and use the variable
instead of duplicating code.
This required defining 'FEATURES_OPTIONAL_ONLY|USED' to not overwrite
the value of 'FEATURES_OPTIONAL' as was done before.
Also add 'FEATURES_OPTIONAL_MISSING' to list optional features that were
not included as not provided.
This removes the need to print FEATURES_MISSING with the optional
features too.
Update the FEATURES_OPTIONAL meaning to be more in line since
FEATURES_USED is defined. Handle FEATURES_OPTIONAL as a configuration from
the BSP/build that should not be changed anymore after.
`FEATURES_OPTIONAL` are by definition optional so are not supposed to
cause a build to fail.
Only the 'REQUIRED' ones that are not 'PROVIDED' are 'MISSING'.
* Do not change FEATURES_OPTIONAL to remove REQUIRED features
* Prepare for having a different variable for the previous value
* Update dependency resolution/info-build as FEATURES_OPTIONAL cannot be missing
When '$(PREFIX)objdump' is not present fallback to native '(g)objdump'.
'objdump' is used when flashing for some boards but the toolchain may
not be installed when building in docker.
This will allow using 'objdump' in 'cpu/kinetis/dist/check-fcfield.sh'.
To read float number from stdin, add "-u scanf_float"
option to the linker.
This option is setup using a pseudomodule as it is already done for
printf_float.
Just add to your Makefile:
USEMODULE += scanf_float
Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
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`.
This will allow sharing it between Makefile.include and
makefiles/info-global.inc.mk.
Also some common variables definition can also be moved to here.
Part of moving CPU/CPU_MODEL definition to Makefile.features to have it
available before Makefile.include.
This enables "BUILD_IN_DOCKER=1 BOARDS='foo bar' make buildtest".
Without this line, when executed with BUILD_IN_DOCKER, "make buildtest"
would always build all boards.
Add a trivial shell program that scans for all slaves on an I2C bus by iterating
all of the possible 127 I2C addresses and checking for the ACK of the device.
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`.
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
Linkerscript for `nrf52dk` has been updated to use `cortexm.ld` so does
not need the configuration anymore for the removed
`cpu/nrf52/ldscripts/nrf52832xxaa.ld`.
JLink flasher used by the only supported board `nrf52dk` has been updated.
FLASHFILE must now be defined by the board to use this in case a new one
wants to be supported.
Refactor to define REALMODULES incrementally without overwriting
'NO_PSEUDOMODULES'.
This also allows an external makefile to maybe add something there if it really
needs to.
Factorize the reused value in a private variable.
I define it private as somehow 'USEPKG' is supposed to be removed so the
variables can be removed later.
BASELIBS is used only in the main Makefile.include or included files.
As it is not used in sub make executions or scripts it does not need to
be exported.
The canned recipe is preferred to using $(FLASHER) $(FFLAGS) as it
allows to specify additional action actions (like what preflash is
currently doing.)
A canned recipe had previously been defined to perform the flashing
procedure. The canned recipe is preferred to calling $(FLASHER) $(FFLAGS)
as there might be additional steps involved in flashing (this is handled by
preflash currently but with the canned recipe we will be able to fix it.)
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.
Using 'link' was working too but will introduce a circular dependency
when FLASHFILE is one of the slot files.
This trims down to the minimal required dependency to work. It is now
the same as `ELFFILE` dependencies.