Commit graph

50928 commits

Author SHA1 Message Date
Gerard Marull-Paretas
3fde4af4d4 gitignore: add common Python venv directories
Add common directory names used for Python virtual environments to
gitignore.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-20 11:30:40 -05:00
Bradley Bolen
92a3209c5c arch: arm: aarch32: cortex_a_r: Dump callee saved registers on fault
Some of these registers may contain nuggets of information that would be
beneficial when debugging, so include them in the fault dump.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2021-04-20 17:20:15 +02:00
Bradley Bolen
c96ae584bf arch: arm: aarch32: cortex_a_r: Correct syntax for srs
The writeback specification should be after the register, not after the
mode according to the documentation at

Link: https://developer.arm.com/documentation/dui0489/h/arm-and-thumb-instructions/srs

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2021-04-20 17:20:15 +02:00
Bradley Bolen
18ec84803c arch: arm: aarch32: Use ARRAY_SIZE in for loop
Do not hardcode the array size in the loop for printing out the floating
point registers of the exception stack frame.  The size of this array
will change when Cortex-R support is added.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2021-04-20 17:20:15 +02:00
Øyvind Rønningstad
ef5ed3f88b samples: Add a sample for running PSA tests
Use the Kconfigs in TFM to enable the different suites.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-04-20 16:13:40 +02:00
Øyvind Rønningstad
b220374633 CMakeLists.txt: Add support for running PSA tests
Add necessary libs and files to the build
Add support for new kconfigs
Add Zephyr-only implementations of tfm_log and tfm_ns_interface.
Add zephyr_tfm_psa_test.c for easily running PSA tests.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-04-20 16:13:40 +02:00
Øyvind Rønningstad
a0eecfd7f4 tfm: Kconfig: Add configs for PSA tests
Allow adding a PSA test suite to the NS app.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-04-20 16:13:40 +02:00
Krzysztof Chruscinski
ae4adea463 arch: arm: cortex_m: z_arm_pendsv in vector table when multithreading
When CONFIG_MULTITHREADING=n kernel specific pendsv is not used. Remove
from vector table.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-20 16:00:39 +02:00
Peter Bigot
20f502288a samples: mesh_badge: conversion of k_work API
Replace all existing deprecated API with the recommended alternative.

Be aware that this does not address architectural errors in the use
of the work API.

Fixes #34097

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-20 15:13:19 +02:00
Johann Fischer
1787644930 tests: intel_s1000_crb: remove unused and wrong implemented callbacks
This test has implemented USB HID class callbacks that
actually have no function and should not return 0.
Remove unused and wrong implemented callbacks.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-20 15:06:35 +02:00
Johann Fischer
2075cf1cf0 samples: intel_s1000_crb: remove unused and wrong implemented callbacks
This sample has implemented USB HID class callbacks that
actually have no function and should not return 0.
Remove unused and wrong implemented callbacks.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-20 15:06:35 +02:00
Johann Fischer
583334b606 drivers: usb_dc_nrfx: clear endpoint flags during ep_disable()
If a loaded endpoint was disabled and then reconfigured,
it is not possible to start an IN transfer and
usb_dc_ep_write() returns -EAGAIN.

Call ep_ctx_reset() to clear endpoint operations flags
and reset buffer after endpoint is disabled.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-20 15:04:47 +02:00
Anas Nashif
05ccdd7c40 doc: move 'getting help' to contrib guidelines
Move this standalone page into the contribution guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 14:53:52 +02:00
Anas Nashif
541b261ca1 doc: reorder sections in contribution guidelines
Minor changes to order of sections in contribution guideline grouping
section based on content.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 14:53:52 +02:00
Anas Nashif
bf9ceac2ef doc: move env_vars into application development
No reason why we are duplicating this information in a standalone guide
when we already talk about env variables in the application developer
guide.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 14:53:52 +02:00
Anas Nashif
f63c9b1893 codeowner: path updates
path updates after moving directories.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 08:45:05 -04:00
Anas Nashif
8a8c681393 portability: move cmsis api samples/tests
Move all sampels and tests of CMSIS OS APIs into samples/subsys and
tests/subsys.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 08:45:05 -04:00
Anas Nashif
3b3e858c50 portability: move cmsis api headers
Move cmsis OS api headers under include/portability. Those are not
libraries and only serve to provide a level of abstraction using the
CMSIS OS APIs to existing Zephyr interfaces.

Removed one level and put them directly under include/portability.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 08:45:05 -04:00
Anas Nashif
a15f32f58c portability: move cmsis APIs to subsys/portability
Move cmsis OS apis under subsystem/portability. Those are not libraries
and only serve to provide a level of abstraction using the CMSIS OS APIs
to existing Zephyr interfaces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 08:45:05 -04:00
Anas Nashif
077447a52b doc: consolidate api status and guidelines
Move all docs related to APIs and the guidelines around them into one
page.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 14:38:16 +02:00
Bradley Bolen
6734c6e874 arch: arm: aarch32: Fix spurious interrupt handling
The GIC can return 0x3ff to indicate a spurious interrupt.  Other
interrupt controllers could return something different.  Check that the
pending interrupt is valid in order to avoid indexing past the end of
the isr_table.

This fixes #30465 and is based on the aarch64 fix in 9dd2731d.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2021-04-20 08:30:41 -04:00
Lukasz Majewski
a186fabb56 arm: ip_k66f: Introduce board specific linker.ld file
This patch introduces linker.ld file specific for ip_k66f board.
It reuses the "common" linker script for other NXP SoCs with defined
NETWORK_RAM_SECTIONS() macro for explicit placement of network
interfaces on ip_k66f board.

grep -A13 net_if_area zephyr/zephyr.map
net_if_area 0x00000000200012a0 0x820 load address 0x0000000000024ac4
            0x00000000200012a0                _net_if_list_start = .
*(SORT_BY_ALIGNMENT(._net_if.static.dts*))
._net_if.static.dts_ord_51
          0x00000000200012a0 0x208 zephyr/libzephyr.a(eth_mcux.c.obj)
*(SORT_BY_NAME(SORT_BY_ALIGNMENT(._net_if.static.dsa_slave*)))
._net_if.static.dsa_slave_port_DT_N_S_soc_S_spi_4002d000_S_dsa_0_S_lan_1
          0x00000000200014a8 0x208 zephyr/libzephyr.a(dsa_ksz8794.c.obj)
._net_if.static.dsa_slave_port_DT_N_S_soc_S_spi_4002d000_S_dsa_0_S_lan_2
          0x00000000200016b0 0x208 zephyr/libzephyr.a(dsa_ksz8794.c.obj)
._net_if.static.dsa_slave_port_DT_N_S_soc_S_spi_4002d000_S_dsa_0_S_lan_3
          0x00000000200018b8 0x208 zephyr/libzephyr.a(dsa_ksz8794.c.obj)
          0x0000000020001ac0                _net_if_list_end = .

As a result the eth0 (master DSA interface) is explicitly placed as the
first one (with the 'dts_ord_51' automatically assigned name) followed
by lan{123} interfaces (with 'dsa_slave_port' name assigned in
dsa_ksz8794.c).

After this patch network interfaces are explicitly placed in correct
order, so 'net_if_get_by_index()' will work correctly.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-04-20 08:29:49 -04:00
Lukasz Majewski
f302be3e92 net: Introduce new NETWORK_RAM_SECTIONS() macro for common-ram.ld
This NETWORK_RAM_SECTIONS() macro can now be overridden (in board
specific linker.ld file) when one needs to force explicit placement
of network interface' related elements.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-04-20 08:29:49 -04:00
Lukasz Majewski
46ea8bf00c net: Append device name to linker generated symbols for struct net_if
Before this change all struct net_if objects accessed by for example
net_if_get_by_index() are placed in one linker area (i.e. net_if_area)
with the same "name" - '_net_if.static.net_if'. This may cause problems
when the order of struct net_if elements is important.

With the same names for all elements there is no guarantee of placement
order. After this change the unique device name is appended, so
SORT_BY_NAME() linker command places objects in reproductible manner.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-04-20 08:29:49 -04:00
Lukasz Majewski
b9f5ba2730 test: Rename interfaces defined in virtual networks test
This work is similar to one performed for ./net/ptp/clock/ test.

However, there is one notable extension - the check in iface_cb()
callback also checks for virtual interfaces defined in
subsys/net/l2/virtual/ipip/ipip.c. Those 'virtual' interfaces are
required for this test to be run.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-04-20 08:29:49 -04:00
Lukasz Majewski
d1b6a80191 test: Lookup for struct net_if interface defined in ipv6 test
The tests/net/ipv6/src/main.c uses net_if_get_default() to get the
interface for testing. This is problematic when board introduces its own
linker script, which places board's network interface on the "default"
position - i.e. the first one.

To fix this issue - the lookup for network device defined for this test
is used instead.

Moreover, interfaces rename has been performed in a manner, which would
allow working with 'eth_native_posix' interface being added as linker
object when drivers/ethernet/eth_native_posix.c file is linked for
./zephyr/tests/net/ipv6 test on 'native_posix' board.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-04-20 08:29:49 -04:00
Lukasz Majewski
f25dd77df2 test: Rename interfaces in ptp clock test
This change is required to allow correct tests operation after changing
the definition of linker script placement rule (to be more strict and
using the device name).

The struct net_if interfaces have been renamed to preserve correct
order.
Moreover, the iface_cb() function now immediately returns for
interfaces, which are not supposed to be used in this tests - for
example ones already defined on board on which the test is run.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-04-20 08:29:49 -04:00
Lukasz Majewski
b8148922ee test: Rename interfaces defined in checksum offload test
The struct net_if object placement in linker 'net_if_area' section
now depends on the order of ETH_NET_DEVICE_INIT() macros in the source
code (for the same object file - like app/libapp.a(main.c.obj)).

Currently the 'eth_offloading_enabled_test' device is placed first,
followed by 'eth_offloading_disabled_test'.

This placement is important when one would like to access those
interfaces with net_if_get_default() function.

After the rename the order is explicit, when we append the device name
to the ._net_if.static.<dev name> object in linker's net_if_area.

The code now works as all struct net_if interfaces are placed as
'._net_if.static.net_if' objects.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-04-20 08:29:49 -04:00
Lukasz Majewski
a18be0cdbb test: Lookup for struct net_if interface defined in arp test
The struct net_if object placement in linker 'net_if_area' section
now depends on the order of liked libraries (like
app/libapp.a(main.c.obj). As a result interfaces defined in testing
applications are placed first in the 'net_if_area' section.

Problem arises when board has other interfaces, which are placed on the
first (i.e. default) position. In this case the test just fails as wrong
network interface is used.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-04-20 08:29:49 -04:00
Daniel Leung
e6dd22113d linker: clarify CONFIG_KOBJECT_TEXT_AREA too small message
The assert error message when CONFIG_KOBJECT_TEXT_AREA is
too small is confusing. Probably the original idea is for
the linker to substitue CONFIG_KOBJECT_TEXT_AREA with
the actual value. However, linker does not do that.
So change the message to say that the kconfig value needs
to be increased.

Fixes #34387

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-04-20 08:29:22 -04:00
Kumar Gala
335c88f4d0 ci: create a merged junit report
Upload a build artifact that is the merged junit report in both xml and
html format.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-20 06:55:16 -05:00
Francois Ramu
bce0d52664 drivers: flash: stm32wb: Flush caches after erase
This commit fixes sporadic kernel panics when writing big data chunks
to the flash. (data bus errors). Just like the stm32g4 does.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-04-20 12:44:14 +02:00
Francois Ramu
3620f3fcee drivers: flash: stm32g0: Flush caches after erase
This commit fixes sporadic kernel panics when writing big data chunks
to the flash. (data bus errors). Just like the stm32g4 does
but on instruction cache.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-04-20 12:44:14 +02:00
Jordan Yates
df66cca6b6 lorawan: always wait for MAC ops to complete
Wait for MAC operations to complete when transmitting. Unconfirmed
messages still open receive windows and can cause error conditions,
which are currently dropped.

It is also possible for a second send to be requested before the first
one has finished processing, which results in `LORAMAC_STATUS_BUSY`.
Empty frames (due to insufficient payload space) now also block until
the MAC layer is ready to accept new commands.

This change means the application no longer needs to guess-and-check
when it is possible to send unconfirmed messages.

Fixes #33456.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-04-20 12:42:56 +02:00
Ying ming
facd0f57db test: schedule_api : test some negative test
Add error test of api to improve
branch and line coverage in sched.c.

Signed-off-by: Ying ming <mingx.ying@intel.com>
2021-04-19 16:23:12 -04:00
Sylvio Alves
f59cba3315 west.yml: update hal version to remove libhal
updated hal to remove pre-built libhal
Moved windowspill to IRAM

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-04-19 13:04:51 -04:00
Sylvio Alves
df5b22b264 linker: esp32: moved windowspill to IRAM
xthal_window_spill call has to be placed into IRAM
in order to allow flash cache disabled operation, otherwise
it will crash.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-04-19 13:04:51 -04:00
Sylvio Alves
56d4e835b9 linker: esp32: remove libhal dependency
libhal.a is not used and can be removed from linker

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-04-19 13:04:51 -04:00
Robert Lubos
0b63a9618b net: telnet: Fix character mode handling
If the telnet client operates in a character mode, it may send
individual characters in packets. Such packets were dropped in the
telnet shell backend instead of being process by the shell engine.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-04-19 17:12:23 +02:00
Guillaume Paquet
d3d789d7ee boards: arm: Add RAK4631 Wisblock Core LPWAN board
Add rak4631 board from RAKWireless based on nrf52840 and SX1262.
Board Documentation is completed

Signed-off-by: Guillaume Paquet <guillaume.paquet@smile.fr>
2021-04-19 11:01:24 -04:00
Nicolas Pitre
29c8e9bf66 arm64: decrustify and extend SMP boot code
The SMP boot code depends on physical CPU #0 to be first to boot and
subsequent CPUs to follow suit in a linear fashion. Let's decouple
physical and logical numbering so that any physical CPU can be the
boot CPU. This is based on a prior code proposal from
Jiafei Pan <Jiafei.Pan@nxp.com>.

This, however, was about to turn the boot code into some hairy mess.
So let's clean things up and simplify the code as well while at it.
Both the extension and the clean up aren't separate commits because
they actually depend on each other.

The BOOT_PARAM_*_OFFSET defines are locally hardcoded as there is no
point exposing the related structure widely. Build time assertions
ensure they don't go out of sync with the struct definition. And
vector_table.h is repurposed into boot.h to gather boot related
definitions.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2021-04-19 11:00:05 -04:00
Jiafei Pan
7889364771 arm64: refine the code for primary core checking
We can find caller of z_arm64_mmu_init is on primary
core or not, so no need to check mpidr, just add a
function parameter.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2021-04-19 11:00:05 -04:00
Joakim Andersson
a7daeebf0e Bluetooth: host: Document default behavior of le_param_req with no cb
Document the default behavior of LE connection parameters request when
the application has not defined a callback.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-04-19 10:59:43 -04:00
Krzysztof Chruscinski
320f7c3808 net: lib: openthread: logging: Refactor logging function
Refactor logging function to avoid multiple macro calls.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski
be80109719 manifest: Temporary point to sof repo with MAX workaround
Point to commit which contains temporary fix for sof redefining
MAX macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski
7bae59481e shell: Add support for logging v2
Extended shell to support logging v2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski
bb64419a29 logging: Adapt ADSP backend to v2
Added support for v2 backend interface to ADSP.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski
da31e09f2b logging: Add v2 support to RTT backend
Add support for logging v2 to RTT backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski
e767bf6377 logging: Add v2 support to native_posix backend
Add support for logging v2 to native_posix backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski
7ce3f7a25a logging: backend_uart: Adapt to support v2 api
Adapted to handle processing of v2 log messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00