Commit graph

43899 commits

Author SHA1 Message Date
Jan Kowalewski 44bbd1ea3d modules: add Kconfig for QuickLogic EOS S3 module
Add proper Kconfig for external QuickLogic module.

Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
2020-09-04 14:48:49 -04:00
Jan Kowalewski d2fecc223b west.yml: add QuickLogic HAL module
Add QuickLogic HAL module to west manifest.

Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
2020-09-04 14:48:49 -04:00
Carles Cufi c37e167b8c drivers: eswifi: Fix macro names for offloading
When offloading only ZSOCK_POLLIN and DNS_EAI_MEMORY are available, so
use those instead of the standard ones.

Fixes #28069.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-04 14:47:57 -04:00
Anas Nashif 08b3e92662 buildkite: trap errors and do proper cleanup
On errors we were aborting immediately skipping any needed cleanup after
the error has occured. This will run the cleanup function and upload
reports of failure when something bad happens.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-04 20:41:26 +02:00
Torsten Rasmussen f160dee935 cmake: bintools abstraction, support <command>_flag_final property
This command add support for `<command>_flag_final` to all bintools
commands.

This allows users that has special use-cases to use a CMake script
for bintool command execution, and thereby have full control of command
invocation and argument processing.

Example of how to specify the property for such use:
Calling a custom script for elfconvert command:
set_property(TARGET bintools
             PROPERTY elfconvert_command ${CMAKE_COMMAND})
set_property(TARGET bintools
             PROPERTY elfconvert_flag "")
set_property(TARGET bintools
             PROPERTY elfconvert_flag_final     -P elfconvert.cmake)
set_property(TARGET bintools
             PROPERTY elfconvert_flag_strip_all "-DSTRIP_ALL=True")
set_property(TARGET bintools
             PROPERTY elfconvert_flag_infile    "-DINFILE=")
set_property(TARGET bintools
             PROPERTY elfconvert_flag_outfile   "-DOUT_FILE=")

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Torsten Rasmussen e0758c317c cmake: additional cleanup of flag. removal of flags were hard coded
This commit is to be squashed into compiler abstraction commit.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Torsten Rasmussen b94ce67899 cmake: get Zephyr settings for language extension
This commit updates the get Zephyr settings functions to be able to
handle settings if those settings are expressed using a generator
expression.

As example, zephyr_get_include_directories_for_lang(...) would prefix
each include property of zephyr_interface with `-I`, like this:
Property: include;include/generated;lib/libc/minimal/include
becomes: `-Iinclude -Iinclude/generated -Ilib/libc/minimal/include`

But if the property contains a generator expression:
Property: include;$<TARGET_PROPERTY:compiler,some_include>
becomes: -Iinclude -I$<TARGET_PROPERTY:compiler,some_include>
and in case that property is a list, this results in:
`-Iinclude -Iinclude/list_item1;include/list_item2;include/list_itemN`
and thus breaking the build.

This is fixed by using `$<JOIN:<list>>` expression instead, which
ensures all list item, regardless of provided as simple list or through
the usage another generator expression, will always expand correctly.

Functions updated in the commit:
- zephyr_get_include_directories_for_lang
- zephyr_get_system_include_directories_for_lang
- zephyr_get_compile_definitions_for_lang
- zephyr_get_compile_options_for_lang

The sample `application_development/external_lib` has been updated
according to those changes.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Torsten Rasmussen 9d501f4ba8 cmake: Remove SHELL: tag in process_flags function
When fetching include, system include, compiler options, or compiler
defines, then it is important to strip the SHELL: (no de-duplication)
tag of any flag.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Torsten Rasmussen 3c761e8180 cmake: fixed regex handling in process_flags function extensions.cmake
This commit fixes an issue in the process_flags function.
The function check a list of flags for generator expression for provided
language, for example:
$<$<COMPILE_LANGUAGE:C>:--flag>
and then converts that into a single compile flag, `--flag`

This works as long as $<COMPILE_LANGUAGE:[language]> is the only
generator expression present in the flag.

In case the flag contains multiple generator expression, then the
current substitution fails.

This commit keep existing behaviour for simple cases, but extends the
more complex cases into a always enabled generator expression, that is
$<$<COMPILE_LANGUAGE:C>:$<ADDITIONAL_EXPRESSION>> into
$<1:$<ADDITIONAL_EXPRESSION>>
and
$<$<FIRST_EXPRESSION>$<COMPILE_LANGUAGE:C>:--flag> into
$<$<FIRST_EXPRESSION>$<1:--flag>

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Torsten Rasmussen 73117e7cad toolchain: Xtensa C compiler using new abstraction pattern
The Xtense xcc compiler now uses the new compiler abstraction.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Torsten Rasmussen f109e6839b cmake: toolchain disable -imacro deduplication
This commit introduces disabling of de-duplication for imacro.
Disabling of de-duplication allows for a space between the imacro flag
and arguments.
This allows for broader range of compiler support in future.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Torsten Rasmussen 31a1411cbd cmake: toolchain: Toolchain abstraction templates
As part of toolchain abstraction three template files to facilitate
additional toolchain support development has been introduced.

Those covers:
- bintools
- compiler flags
- linker flags

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Torsten Rasmussen c060b075a6 cmake: toolchain: bintools abstraction
GNU/bintools abstraction completed.
The following commands and flags are now available in bintools:
- memusage
- elfconvert
- dissassembly
- readelf
- strip

The bintools template has now been updated with more description which
will be useful when adding support for more toolchains in future.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Torsten Rasmussen c55c64e242 toolchain: improved toolchain abstraction for compilers and linker
First abstraction completed for the toolchains:
- gcc
- clang

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 20:36:59 +02:00
Richard Osterloh e917c6c0bc samples: sensor: Add VCNL4040 sample
Add sample to show usage of VCNL4040 sensor driver

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2020-09-04 13:03:12 -05:00
Richard Osterloh 0a0026afe2 drivers: sensor: Add VCNL4040 driver
Add support for Vishay VCNL4040 proximity and light sensor

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2020-09-04 13:03:12 -05:00
Øyvind Rønningstad 2be0086e87 cortex_m: tz_ns.h: Various fixes (late comments on PR)
Fix dox and restructure ASM.
No functional changes.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-09-04 19:05:58 +02:00
Guillaume Lager f5cb887a79 bluetooth: Allow immediate logging with software-based LL
Some logging configuration are compatible with software-base Link
Layer. Currently only one configuration is supported:
RTT back-end in drop mode and no clean output

Signed-off-by: Guillaume Lager <guillaume.lager@gmail.com>
2020-09-04 18:48:32 +02:00
Kamil Piszczek be7e2fc5ab bluetooth: services: ots: use multi-instance macro from gatt.h
Used multi-instance macro defined in gatt.h for OTS instance
definitions.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2020-09-04 18:37:27 +02:00
Kamil Piszczek f3c6b6eeff bluetooth: gatt: add macro for declaring multi instance services
Added macro that helps to declare multi-instance services. The macro
allows to statically define service structure array. Each element of
the array is linked to the service attribute array that is provided
by the user.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2020-09-04 18:37:27 +02:00
Joakim Andersson 48606a2dcd Bluetooth: shell: Add "add-subscription" command
Add the command add-subscription to the shell to test the
bt_gatt_add_subscription API.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-04 18:34:18 +02:00
Joakim Andersson 76119c526e Bluetooth: GATT: Allow application to add subscription.
Allow the application to add subscription without resubscribing.
This is needed for persistent bonds that can go to deep sleep and
turn of the RAM or power-cycle.
In this case the application as a GATT client must have a way to add
the subscription callbacks back to the stack before the GATT server
sends notifications.
This should preferable be able to be done before even connecting
since the notifications can arrive immediately after connecting to
the peer.
The stack cannot persist this on it's own since it must remember the
function pointers for the callback functions. Storing these in
persistent storage would not be compatible with a Device Firmware
Upgrade (DFU) solution.

Fixes: #21798

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-04 18:34:18 +02:00
Joakim Andersson ae5489085f Bluetooth: GATT: Refactor gatt_sub_add to add withouth conn object
Refactor the gatt_sub_add function to be similar in structure to how
find_cf_cfg is implemented. This is so that a subscription can be added
without an active connection.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-04 18:34:18 +02:00
Joakim Andersson 14b9f351a9 Bluetooth: GATT: Clarify subscribe note about valid params
Clarify the note about the lifetime of the subscribe parameters.
The note uses subscribe procedure lifetime, but the parameters
must remain valid after having subscribed as well, until the
subscription is removed.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-04 18:34:18 +02:00
Torsten Rasmussen 212c336400 cmake: extend support for conf file and board overlays
Fixes: #27934

This commit introduces additional naming support of config files.

It is now possible to create a config file of the form
`prj_<build>.conf` and automatically have a corresponding
`boards/<BOARD>_<build>.conf` config file merged.

As example, one can create a structure as:
|-- prj.conf
|-- prj_debug.conf
|-- boards
      |-- nrf52840dk_nrf52840.conf
      |-- nrf52840dk_nrf52840_debug.conf

when building: (existing behavior)
cmake -DBOARD=nrf52840dk_nrf52840 ...
prj.conf is merged with nrf52840dk_nrf52840.conf

when building: (new behavior)
cmake -DBOARD=nrf52840dk_nrf52840 -DCONF_FILE=prj_debug.conf ...
prj_debug.conf is merged with nrf52840dk_nrf52840_debug.conf

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-04 17:52:27 +02:00
Emil Obalski 31587ca6ef usb: Do not check usb_dev.configured in is_dev_configured()
Flag name usb_dev.configured is misleading as it does not
mean the device is configured. This flag indicates whenever
endpoints for the device were enabled. For all classes
except for audio endpoints are enabled on set_configuration
request. This sets the configured flag true. For Audio this
will never happen as what enables audio endpoints is
set_interface request. Without this patch audio samples
will STALL all interface requests.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-04 17:51:45 +02:00
Francois Ramu fafb72f8ed drivers: dma: dmamux init needs k_malloc
The dmamux requires HEAP size definition, so that k_malloc
is valid. The HEAP size config is defined in the common for
any stm32 soc instead of specific to dma Kconfig

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-09-04 10:42:18 -05:00
Henrik Brix Andersen 40c71cbe47 boards: arm: arty: add reference to the v2c_daplink shield
Add a reference to the V2C-DAPLink shield from the Digilent Arty board
documentation.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-04 17:37:22 +02:00
Henrik Brix Andersen c29c1cceb8 boards: shields: add support for the ARM Ltd. V2C DAPLink shield
Add support for the ARM DesignStart DAPLink board for Digilent Arty
S7/A7 (V2C DAPLink) shield.

This shield is designed to be used along with the ARM Cortex-M1/M3
DesignStart FPGA reference designs running on the Digilent Arty.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-04 17:37:22 +02:00
Henrik Brix Andersen 3ffb779865 boards: arm: arty: add missing default for enabling SPI support
Add missing default for enabling CONFIG_SPI if CONFIG_FLASH is
enabled. This is needed for CONFIG_SPI_NOR.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-04 17:37:22 +02:00
Henrik Brix Andersen 4c57f3400a boards: arty: add support for daplink qspi mux
The ARM Cortex-M1/M3 DesignStart FPGA reference designs support booting
from an off-board, memory-mapped QSPI NOR flash device. The V2C DAPlink
shield from ARM Ltd. provides support for this feature.

If the board/shield is not configured for booting from the QSPI NOR
device, that same device is available as a regular QSPI NOR flash
device.

The presense of a shield configured for QSPI NOR flash boot is indicated
through an IRQ line used as a level-detect, non-interrupt signal.

Introduce a board specific devicetree binding for the DAPLink QSPI MUX
and provide a board specific API accessing it. Automatically set the
QSPI MUX to to provide regular QSPI NOR flash access if the board/shield
is not configured for memory-mapped QSPI NOR flash boot.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-04 17:37:22 +02:00
Andrei Gansari 217560d8e1 samples: tfm_integration: BL2 configurable
Make BL2 configurable via Kconfig.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-09-04 10:36:42 -05:00
Andrei Gansari 37d2ad68e8 modules: tfm BL2 configurable
Make BL2 setting configurable via Kconfig choice.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-09-04 10:36:42 -05:00
Andrei Gansari f0a9119e17 west.yml: update to 143df67
Updates west.yml to use modules/tee/tfm commit number
143df675557305b61f7930a50459a53a8d2bb097.
Change: make BL2 configurable.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-09-04 10:36:42 -05:00
Andrei Gansari b8b31f9a76 samples: tfm_integration: lpc55s69 support
Adds documentation on how to run TFM samples on LPCxpresso55S69 board.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-09-04 10:36:42 -05:00
Andrei Gansari 7ff38a9b6d boards: lpcxpress55s69: NS target with TFM support
Configures the Non-Secure target to work with TFM.
Memory (Flash and RAM) mapping according to TFM definitions.
How to build and flash the board.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
2020-09-04 10:36:42 -05:00
Andrei Gansari 3d6e6a9900 boards: lpcxpresso55s69 mcuboot and tfm partitions
Moved the flash partitioning to the shared device tree include so all
targets can benefit from the partitioning.
This is implemented to MCUboot can run TFM(S) with Zephyr
(lpc55s69 cpu 0 NS).
Also defines RAM partitions as TFM expects them, first part of ram for
S, second half for NS.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-09-04 10:36:42 -05:00
Andrei Gansari 097125f469 samples: tfm_integration: BL2 configuration
Configure build variable BL2 depending on board configuration. BL2 is
set to True by default. BL2 enabled building TFM with MCUboot.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-09-04 10:36:42 -05:00
Gerson Fernando Budke 7b8643e373 samples: net: updatehub: Increase shell stack
When running shell commands updatehub alloc data from shell stack.
Increase shell room stack to avoid shell issues.  Memory tuning
should be performed accord with available resources.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-09-04 17:32:29 +02:00
Gerson Fernando Budke d18f12de23 mgmt: updatehub: Enable flash sha verification
Currently updatehub trust on MCUboot to test a new image. The process
is executed on next boot after a validate the downloaded image.  To
have a more reliable system, is recommended run the SHA-256 algorithm
to attest that firmware was properly stored on the flash memory.  This
implements the use of flash_img_check to achieve that, and as a
consequence, add a new level of trust that avoids an useless reboot
on the system.

Updatehub uses two SHA-256 verification.  One is used to check the
data stream at download.  The second one, realise the verification
reading from flash.  Users have the possibility to chose only one
option or keep both verifications.  However, it is adviced keep
always both verifications enabled to get consistent reports on
back end.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-09-04 17:32:29 +02:00
Gerson Fernando Budke d0c3dfe093 mgmt: updatehub: Add hash var on context
Currently SHA-256 uses a temporary hash digest to calc final sha sum.
This moves temporary variable from local scope to updatehub context.
The motivation is to use the hash digest on future flash validation.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-09-04 17:32:29 +02:00
Vinayak Kariappa Chettimada 94d7469172 Bluetooth: controller: Add DEBUG_PINS support in nRF5340DK
Add support for BT_CTLR_DEBUG_PINS for nRF5340DK board.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-04 17:17:07 +02:00
Vinayak Kariappa Chettimada 03852a5f02 Bluetooth: controller: Fix DEBUG_PINS_CPUAPP dependency
Remove the BT_LL_SW_SPLIT dependency for
BT_CTLR_DEBUG_PINS_CPUAPP when building CPUAPP application
that is using Zephyr BLE HCI controller on the CPUNET core.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-04 17:17:07 +02:00
Kamil Piszczek 391730891b samples: bluetooth: adding peripheral_ots sample
Added a Bluetooth Peripheral sample that demonstrates how to use
GATT Object Transfer Service.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2020-09-04 17:06:17 +02:00
Kamil Piszczek 0a7a8fd137 bluetooth: services: add Object Transfer service
Added GATT Object Transfer Service implementation.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2020-09-04 17:06:17 +02:00
Kamil Piszczek aafb8a50bf bluetooth: uuid: adding object type identifiers for ots
Added Object Type identifiers for OTS.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2020-09-04 17:06:17 +02:00
Jukka Rissanen 3e5a4d79b2 net: tcp2: Make sure all incoming data is given to app at eof
When the connection is terminated, make sure that any pending
data is feed to the application.

Fixes #28057

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-04 11:04:27 -04:00
Jan Pohanka e4fe99590c drivers: clock_control: stm32h7 use a macro to define VCO_INPUT_RANGE
VCO input frequency can be checked and set during compile time.
It unfortunately does not work for output frequency because macros in
HAL are defined together with uint32_t type.

This also fixes wrong check in case of HSI used as PLL source.

Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
2020-09-04 17:03:57 +02:00
Krzysztof Chruscinski 8f2754e027 drivers: usb: device: nrf: Add support for hf192m clock
Added support for nrf53 where hf192m clock must be used.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-04 16:36:05 +02:00
Krzysztof Chruscinski 17f70df01e drivers: clock_control: nrf: Add support for clk192m
Add support for 192M clock.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-04 16:36:05 +02:00