Commit Graph

43690 Commits

Author SHA1 Message Date
Carles Cufi f8ad4d5f87 scripts: size_report: Fix colorized output
Colorama needs to be initialized, and for colors to display correctly on
Windows one needs to use the `USES_TERMINAL` option in CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-03 09:54:21 -04:00
Carles Cufi cf2b3596f7 scripts: size_report: Fix reporting on Windows
Certain symbols do not contain a valid path, instead showing
`<built-in>` in the filename attribute. This leads to the resolve() call
failing on Windows, since the `<>` characters are not allowed in
filenames there. Fix this by catching the exception and skipping the
call in that case.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-03 09:54:21 -04:00
Jennifer Williams e7eb428b01 samples: add missing sample.yaml files
Some samples were without sample.yaml. This adds
them.

Fixes #27813

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-09-03 09:49:28 -04:00
Peter Bigot d3e8d6c3f3 i2c_shell: restore documentation on scan technique
When this code was moved from a standalone sample to an optional shell
feature the documentation on how this works and caveats was lost.  Put
it back so it can be referenced in issue explanations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-03 08:52:19 -04:00
Joakim Andersson e997c46e6d Bluetooth: GATT: Handle bt/ccc setting with CCC lazy loading
When lazy loading of CCCs are enabled there is no settings set handler
register for the 'bt/ccc' key, this means that the settings set handler
for 'bt' key is called instead. This handler does not know what to do
for the 'ccc' subkey, and returns -ENOENT for the entry.
This results in an error message logged by the settings subsystem.
  "E: set-value failure. key: bt/ccc/f8c39e2f98210 error(-2)"

Fix this by providing an empty handler for the 'bt/ccc' key when
Lazy Loading feature is enabled.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-03 13:56:10 +02:00
Krzysztof Chruscinski 0617e1aebd samples: bluetooth: hci_uart: Improve RX path
Receiver part reworked to not block in interrupt and rely on assumption
that uart_fifo_read is capable of reading incoming data from the HW.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-03 10:45:43 +02:00
Vinayak Kariappa Chettimada eafb6aece1 Bluetooth: host: Fix periodic advertising delete
Fix periodic advertising delete implementation, to not
NULL the callback pointer when deleting the instance so
that the application's terminate callback can be called
thereafter.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-03 10:40:35 +02:00
Vinayak Kariappa Chettimada c895e3650f Bluetooth: host: minor code style cleanup
Minor cleanup to use reverse christmas tree declarations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-03 10:40:35 +02:00
Robert Lubos b79f538adc net: sockets: tls: Add Kconfig option to disable offloaded TLS
This new option allows to include `sockets_tls.c` into the build when
socket offloading is enabled.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-09-03 11:00:01 +03:00
Robert Lubos 968a3101a2 net: sockets: tls: Add support for offloaded poll
Given that the offloaded poll handling differs from the poll handling of
native sockets (entire poll function call is offloaded), some
adjustements were needed to make TLS socket work with offloaded poll
calls.

To achieve this, in case socket offloading is used, instead of jumping
directly to the offloaded poll call, a TLS wrapper for the offloaded
poll will be called. This wrapper will do additional checks at the
mbedtls level, to verify that the event is only notified to the caller
when the application data is available (i. e. not to report events
during handshake or when partial data is received, not ready to
decrypt).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-09-03 11:00:01 +03:00
Robert Lubos b700c2a0ba samples: net: sockets: Increase FD count for TLS echo samples
Given that TLS/DTLS socket now creates an underlying TCP/UDP socket, the
FD consumption is increased in echo_client and echo_server.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-09-03 11:00:01 +03:00
Robert Lubos 27211cf112 net: sockets: tls: Decouple TLS sockets from net_context
Separate TLS sockets implementation from net_context layer. Instead of
calling net_context functions directly, create an underlying TCP/UDP
socket, and call socket functions on it instead. This results in a
simpler design, where we don't need to duplicate specific parts of code
from the native socket implementation. Additionally, this allows to use
a different TCP/UDP stack underneath (i. e. when sockets offloading is
used).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-09-03 11:00:01 +03:00
Robert Lubos 7d77307c5c net: sockets: tls: Add helper function to verify protocol
This commit adds helper function to verify protocol, which was done in
two different places in the code. The function returns the underlying
protocol information on success.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-09-03 11:00:01 +03:00
Jukka Rissanen 747d2f4483 tests: net: af_packet: Fix the test when run in fast hw
If the recvfrom() in the test returns EAGAIN, try again in order
to make sure that we have really received the data.

Fixes #27963

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-03 10:59:11 +03:00
Flavio Ceolin 49f7e2411e doc: debugging: Add information about gdbstub
An overview about gdbstub and available features.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 20:54:57 -04:00
Flavio Ceolin 7f9cc2359e x86-32: Allow set DPL value for an exception
In order to be possible to debug usermode threads need to be able
issue breakpoint and debug exceptions. To do this it is necessary to
set DPL bits to, at least, the same CPL level.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 20:54:57 -04:00
Flavio Ceolin 1b4ae345de debug: gdbstub: Send an error code when accessing invalid memory
GDB on host may ask the guest to read the a pointer contents even if
it is pointing to NULL. Send an error code when this occurs.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 20:54:57 -04:00
Flavio Ceolin 179e184e30 samples: debug: Add a simple gdbstub sample
Sample example built with gdbstub enabled. Two serials are used, one for
normal output and another one that is used talk with gdb in the host
machine.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 20:54:57 -04:00
Flavio Ceolin 5408f3102d debug: x86: Add gdbstub for X86
It implements gdb remote protocol to talk with a host gdb during the
debug session. The implementation is divided in three layers:

1 - The top layer that is responsible for the gdb remote protocol.
2 - An architecture specific layer responsible to write/read registers,
    set breakpoints, handle exceptions, ...
3 - A transport layer to be used to communicate with the host

The communication with GDB in the host is synchronous and the systems
stops execution waiting for instructions and return its execution after
a "continue" or "step" command. The protocol has an exception that is
when the host sends a packet to cause an interruption, usually triggered
by a Ctrl-C. This implementation ignores this instruction though.

This initial work supports only X86 using uart as backend.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 20:54:57 -04:00
Andrew Boie ffc1da08f9 kernel: add z_thread_single_abort to private hdr
We shouldn't be copy-pasting extern declarations like this.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-02 15:02:06 -07:00
Andrew Boie 3425c32328 kernel: move stuff into z_thread_single_abort()
The same code was being copypasted in k_thread_abort()
implementations, just move into z_thread_single_abort().

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-02 15:02:06 -07:00
Andrew Boie e34ac286b7 arm: don't lock irqs during thread abort
This isn't needed; match the vanilla implementation
in kernel/thread_abort.c and do this unlocked. This
should improve system latency.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-02 15:02:06 -07:00
Andrew Boie 0a99011357 arm: thread_abort: clarify what's going on
A check was being done that was a more obscure way of
calling arch_is_in_isr(). Add a comment explaining
why we need to trigger PendSV.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-02 15:02:06 -07:00
Dominik Ermel d7b0ceb6a1 west.yml: Snapshot update of mcumgr from upstream
This commit updates mcumgr with latest snapshot from the upstream.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-09-02 15:44:18 -05:00
Henrik Brix Andersen a625d48836 CODEOWNERS: add additional code owner for EEPROM tests
Add myself as code owner for the EEPROM test suites.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-09-02 16:22:52 -04:00
Peter A. Bigot 0839f38451 drivers: console: fix Kconfig DTS inference for mcumgr uart
The conversion last year mixed up uart-pipe with uart-mcumgr.  Revert
to the pre-conversion relationship.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-09-02 14:56:19 -05:00
Fabio Utzig eb2854aabe west: update mcuboot revision
Update MCUBoot to latest revision to fix issue with const struct
device.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-09-02 15:28:24 -04:00
Peter Bigot 669a0d6f5b drivers: eeprom: reduce priority of at2x initialization
The default priority for I2C controller initialization is POST_KERNEL
60 (SPI 70), while the default priority for device configuration is
POST_KERNEL 50.  Thus the EEPROM is being initialized before its
controller.  While for this driver that wouldn't be an issue recent
changes mean the device lookup returns NULL before the device is
initialized.

Change the AT2X priority to 75 so it falls between the I2C and SPI
drivers and the default ethernet priority (80), since some ethernet
controllers may store the MAC address in EEPROM.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-02 15:27:57 -04:00
Peter Bigot 039e3edcda Revert "posix: linker: Wrap rodata and rwdata in sections."
This reverts commit b51eeb03f4.

The linker script is now putting read-only material in writable
segments, which causes glib with -D_FORTIFY_SOURCE=2 to abort.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-02 14:46:01 -04:00
Kumar Gala 69b5445016 CODEOWNERS: Update for dts/scripts
@ulfalizer hasn't been active for several months, remove him and add
@mbolivar-nordic.  We can add @ulfalizer back if he comes back to the
project.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-02 14:44:57 -04:00
Kumar Gala 7d04c2ef86 CODEOWNERS: Fix github username change
Change @mbolivar to @mbolivar-nordic.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-02 14:44:57 -04:00
Flavio Ceolin 03d70b2ca3 lib: hex: Remove constant expression
Part of an else expression was constant, just removing it.

Code guideline rule 14.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 13:45:50 -04:00
Flavio Ceolin 1396e89e6c os: work_q: Use NULL instead of 0
Code guideline rule 11.9 says to use macro NULL for null pointers.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 13:45:50 -04:00
Flavio Ceolin 86d8475850 osdp: Remove invald serial option
SERIAL_HAS_DRIVER and UART_INTERRUPT_DRIVEN should be selected by the
driver. If something needs is should dependson these options.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 13:45:26 -04:00
Flavio Ceolin 2fde557e14 osdp: Do not select ENTROPY_GENERATOR
Entropy generator is not used in this subsystem so there is no need to
select it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 13:45:26 -04:00
Flavio Ceolin 61b2cdd0dd osdp: Do not use TEST_RANDOM_GENERATOR
TEST_RANDOM_GENERATOR should not be used in subsystems because it does
not generate truly random numbers. This is indented to be used only
for tests purpose.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 13:45:26 -04:00
Anas Nashif 209e4ee1a1 boards: mec1501modular: build without image gen tool
Do not quit if there is no image generation tool, just report the issue
and continue. Happens on MacOS where there is no tool for generation the
SPI image.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-02 13:28:13 -04:00
Peter Bigot 478577e04a driver: interrupt_controller: miwu: fix build errors from device const
Declaration within a macro was missed during conversion.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-02 19:01:28 +02:00
Jukka Rissanen 4f6145a478 net: tcp2: Fix connection close seq values
When connection is closed and we send ACK flag, use proper seq
values so that any data that is still in flight will get acked too.
Currently this assumes that window is still open.

Fixes #27876

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-02 18:49:35 +03:00
Hake Huang 24acf1024d board: mimxrt685_evk update flash command
add reset after download, which will trigger board to run

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-09-02 09:42:29 -05:00
Henrik Brix Andersen 73288835ec tests: arch: arm: irq_advanced_features: remove Arty Cortex-M1 handling
Remove special handling of the ARM Cortex-M1 DesignStart FPGA reference
design running on the Digilent Arty after CONFIG_NUM_IRQS was reduced
from 8 to 7.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-02 15:02:03 +02:00
Henrik Brix Andersen ba2bafc80d boards: arm: arty: reduce number of IRQs from 8 to 7
The ARM Cortex-M1/M3 DesignStart FPGA reference designs both use IRQ 7
(the last IRQ line) as a level-detect non-interrupt signal to determine
whether the V2C-DAPLINK shield is installed. Thus IRQ 7 cannot be used
as a regular IRQ line.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-02 15:02:03 +02:00
Henrik Brix Andersen db6737b34a tests: arch: arm: irq_advanced_features: check irq is not always pending
Extend check to determine a usable ARM NVIC IRQ line to verify that the
IRQ line is not always pending.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-02 15:02:03 +02:00
Henrik Brix Andersen aab95f09f2 samples: drivers: spi_flash: add support for arty_a7_arm_designstart_m3
Add support for running the JEDEC SPI NOR flash sample on the ARM
Cortex-M3 DesignStart FPGA reference implementation.

Special care is needed to avoid overwriting part of the FPGA
configuration bitstream, which is stored in the onboard QSPI flash.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-02 15:02:03 +02:00
Henrik Brix Andersen 80cb465a89 boards: arm: arty: add arm cortex-m3 designstart fpga board definition
Add board definition for the ARM Cortex-M3 DesignStart FPGA reference
design running on the Digilent Arty development board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-02 15:02:03 +02:00
Henrik Brix Andersen 77da848d7b boards: arm: arty: add missing cpu node to devicetree
Add the missing Cortex-M1 CPU node to the devicetree.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-02 15:02:03 +02:00
Henrik Brix Andersen 4fe779848f boards: arm: arty: refactor board definition to prepare for cortex-m3
Refactor the ARM Cortex-M1 DesignStart FPGA/Digilent Arty A7 board
definition to prepare for Cortex-M3 support.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-02 15:02:03 +02:00
Henrik Brix Andersen 140841fc73 soc: arm: arm: designstart: add cortex-m3 designstart fpga support
Add support for the ARM Cortex-M3 DesignStart FPGA SoC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-02 15:02:03 +02:00
Ioannis Glaropoulos acfb66b6f4 tests: arch: arm: add test for IRQ Target state management
We add a simple test-case for verifying the behavior of the
Cortex-M IRQ target state management. We add an additional
test only for TrustZone-enabled Cortex-M targets running
in Secure mode. We explicitly exclude ARMv8-M platforms that
enable Non-Secure FW build by default from running the test.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-09-02 15:01:30 +02:00
Ioannis Glaropoulos e08dfec77c arch: arm: cortex-m: add ARM-only API to set all IRQS to Non-Secure
We implement an ARM-only API for ARM Secure Firmware,
to set all NVIC IRQ lines to target the Non-Secure state.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-09-02 15:01:30 +02:00