Commit graph

42567 commits

Author SHA1 Message Date
Anas Nashif 98c75038c8 tests: net: remove duplicate test
remove duplicate, no need to specify test twice (one for userspace,
another for default).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 22:36:17 -05:00
Nicolas Pitre 0ae04f01b6 lib/os/heap: make some checks more assertive
Some checks in sys_heap_init() depend on the externally provided size
parameter. If the check fails, this would be a bug outside of the heap
code and therefore should be flagged despite the value of
CONFIG_SYS_HEAP_VALIDATE.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-06-25 17:43:13 -07:00
Marcin Niestroj 3c55e1fcf3 lora: shell: use strtoul instead of strtoll
Parsed value is expected to be in range (0, UINT32_MAX). Use strtoul
instead of strtoll, so we better match its range. In a tested
configuration this saves 380 bytes of flash with newlib and arm32
target.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-25 16:17:27 -05:00
Anas Nashif 8aa3dc340d kernel: cleanup header inclusion
Remove unused header inclusion in kernel code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 16:12:36 -05:00
Anas Nashif 2c5d40437b kernel: logging: convert K_DEBUG to LOG_DBG
Move K_DEBUG to use LOG_DBG instead of plain printk.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 16:12:36 -05:00
Rajavardhan Gundi e71e803674 drivers: espi: Add support for ACPI_EC1 interface
This enables the ACPI_EC1 interface which is typically accessed
through ports 0x6A0 and 0x6A4 in Bios.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2020-06-25 17:05:43 -04:00
Enjia Mai d678d7a65f tests: adding test cases for device abstraction
Add three test cases of device abstraction for improving test coverage.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2020-06-25 17:02:27 -04:00
Frank Li d7279b14eb west.yml: Update nxp hal to fix spi interrupt issue
Updates the nxp hal to incorporate a fix
for other interrupts treated as a transfer completion.

Signed-off-by: Frank Li <lgl88911@163.com>
2020-06-25 16:01:16 -05:00
Carles Cufi 22be0d8fd5 tests: nvs: Disable running the 0x00 test suite
There is an issue when running the 0x00 erase value test suite, so
disable it temporarily.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-25 13:24:07 -05:00
Joakim Andersson 16763ff9b6 Bluetooth: host: Fix adv object not released on directed adv timeout
Fix the advertise object not release when a high-duty cycle directed
advertiser timeout happens. If the extended advertising feature has been
enabled in the host, but not supported by the controller then the
advertising object must be released in the connection complete event
since there will not be a advertising set terminated event.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-06-25 19:34:16 +02:00
Andrzej Głąbek a10edd538e samples/drivers/spi_flash_at45: Improve test case descriptions
Instead of whitelist, use a filter that checks if a required
"atmel,at45" compatible node is present.
Add a build-only test case to be used by CI and provide a harness
configuration so that execution of the sample can be also verified.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-06-25 19:33:41 +02:00
Andrzej Głąbek 4f1156d186 boards: nrf9160dk_nrf9160: Add "spi" as supported feature
Plus corresponding configuration file for the spi_loopback test that
will be activated for that board by this added capability.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-06-25 19:33:41 +02:00
Andrzej Głąbek c195085959 samples/drivers/spi_flash_at45: Update nrf9160_pca10090 board name
This sample still used the old name of the nrf9160dk_nrf9160 board,
both in documentation and sample.yaml. Because of the latter, this
sample was not picked up by sanitycheck, what resulted in compilation
errors in the spi_flash_at45 driver not caught by CI.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-06-25 19:33:41 +02:00
Andrzej Głąbek c79620b722 drivers/flash/spi_flash_at45: Fix compilation errors
For some reason, use of the DT_NUM_INST macro in this driver was not
replaced with DT_NUM_INST_STATUS_OKAY. In consequence, this driver
could not be compiled successfully. Furthermore, because this now
undefined macro had been used inside UTIL_LISTIFY, gcc was not even
able to report an error, instead the compilation just "froze".
This patch replaces UTIL_LISTIFY(DT_NUM_INST()) with more appropriate
in this context DT_INST_FOREACH_STATUS_OKAY. It also adds an apparently
missing inclusion of sys/byteorder.h.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-06-25 19:33:41 +02:00
Anas Nashif f42cddf083 boards: qemu_cortex_a53: do not run on net/bt tests
Those are covered by other qemu variants..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 11:05:29 -04:00
Anas Nashif 3791ec1491 tests: jwt: increase timeout for test
Some platforms need some more time here.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 11:05:29 -04:00
Wentong Wu 6fae53c044 sanitycheck: handle timeouts correctly with qemu
In some cases we were not handling return code correctly and evaluating
timeouts as a pass. Report failure correctly.

Fixes #26065

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-06-25 11:05:29 -04:00
Peter Bigot 1105aa521c west: update to fix littlefs report configuration problem
Reference an updated head that removes references to reporting
infrastructure when reporting is disabled.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-25 15:09:28 +02:00
Joakim Andersson f7f164468b templates: Encourage attaching log files over screenshots
Rewrite console log section to encourage bug-reporters to obtain the
console output in text-format over screenshots, as well as hinting
about other debug information that can be attached.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-06-25 08:53:42 -04:00
Marcin Niestroj 398f22b34a tests: eventfd: drop POSIX_API ifdeffery
Test is configured with CONFIG_POSIX_API=y, so there is no reason to
check for it being enabled in C. Additionally when CONFIG_POSIX_API=n a
much "bigger" posix/sys/socket.h was included instead of net/socket.h,
which should be rather opposite.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-25 12:14:40 +02:00
Martí Bolívar bd491fbb97 runners: promote --erase to common option
Move the --erase option to core.py from nrfjprog.py and jlink.py,
where it is currently supported.

Using the RunnerCaps option enforcement mechanism introduced earlier,
enforce that it will only be given to runners that support it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-25 12:14:25 +02:00
Martí Bolívar f8e8e9229d runners: enforce RunnerCaps via create() indirection
Require all implementations to provide a do_create(), a new
ZephyrBinaryRunner abstract class method, and make create() itself
concrete.

This allows us to enforce common conventions related to individual
runner capabilities as each runner provides to the core via
RunnerCaps.

For now, just enforce that:

- common options related to capabilities are always added, so runners
  can't reuse them for different ends

- common options provided for runners which don't support them emit
  sensible error messages that should be easy to diagnose and support

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-25 12:14:25 +02:00
Martí Bolívar 7b93bd54d4 scripts: runners: clean up super() calls
We can just call super() instead of super(MyClassName, self). The
original extra verbosity is likely due to old habits of mine from
Python 2 which are no longer necessary, but got copy/pasted around.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-25 12:14:25 +02:00
Dominik Ermel 4c122dd42a subsys/fs/fatfs: Fix missing memory free on error
fatfs_open and fatfs_opendir fail to free reserved memory on error
which may lead to memory exhaustion, when too many file/dir open errors
are caused, and will cause all subsequent open attempts to fail with
ENOMEM error.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-06-25 12:13:51 +02:00
Joakim Andersson 0b1af81daa Bluetooth: controller: Fix non-privacy directed advertiser
Fix issue with directed advertiser not accepting connection request
from non-privacy enabled peer that has given us a non-zero IRK.
When device privacy is enabled then ull_filter_lll_rl_addr_allowed will
return true, and update the rl_idx to entry in the resolving list.
When the directed advertiser is not privacy enabled then lll->rl_idx is
set to FILTER_IDX_NONE and will not use RPA for the target address.
The check rl_idx != lll->rl_idx will then fail (0 != 0xff) and the
connect request is denied, even though all addresses matches on-air.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-06-25 12:11:02 +02:00
Carles Cufi 363d3e53bc manifest: hal_stm32: Replace pull reference with SHA
This was merged with the pull reference by mistake.

Fixes #26424.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-25 12:10:33 +02:00
Anas Nashif 3f8bdf16f9 shell: kernel: select dependencies
The kernel shell module is useless without those options being enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-24 21:37:12 -04:00
Anas Nashif be0dff6844 test: remove TEST_SHELL
No need for this now, all shells are enabled if CONFIG_SHELL is set.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-24 21:37:12 -04:00
Anas Nashif de57d60732 pcie: shell: add subcommands
pcie has an all in one command for listing pci devices. Make it support
additional commands and move lspcie to `pcie ls`.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-24 21:37:12 -04:00
Anas Nashif ee985d81aa shell: enable modules by default if shell is enabled
If shell is enabled then enable all sub-shells if their dependencies are
satisfied. This was done for some modules and subsystems but was not
consistent.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-24 21:37:12 -04:00
Anas Nashif 7c85f4b2f5 samples: remove board_shell
This sample is not working on all boards anymore. Adding every single
shell we have to the prj.conf does not work on every board, due to
missing features.

Instead, we now change how shell modules are enabled and make it
possible to enable shell command and modules for any application when
CONFIG_SHELL is enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-24 21:37:12 -04:00
Ioannis Glaropoulos cd8f46b998 boards: arm: qemu_cortex_m0: remove ENTROPY_NRF_FORCE_ALT default set
No need to specify a default configuration for
ENTROPY_NRF_FORCE_ALT Kconfig symbol in the
qemu_cortex_m0 board definition.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Ioannis Glaropoulos 422ba1f11b tests: kernel: timer_api: add timer label for this test
Add timer label for this test suite, so it is included
in sanity check runs with -t timer.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Ioannis Glaropoulos 6209610820 tests: kernel: timer_api: enabling test-suite for Qemu Cortex-M0
After the Qemu Cortex-M0 timer driver rework, we may
enable the test-suite that had been (always) excluded
from running on this platform.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Ioannis Glaropoulos cfda90d32f tests: kernel: tickless: re-enabled test-suite for Qemu Cortex-M0
After the Qemu Cortex-M0 timer driver rework, we may
re-enable the test-suite that had been excluded for this
platform.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Ioannis Glaropoulos 6a3d460916 tests: kernel: common: re-enabled test-cases for Qemu Cortex-M0
After the Qemu Cortex-M0 timer driver rework, we may
re-enable the test-cases that had been skipped for this
platform.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Ioannis Glaropoulos 21ae8c177b boards: arm: qemu_cortex_m0: rework timer driver
We rework the timer driver for Cortex-M0 QEMU Board.
The driver is adapted to follow the (recent) nRF RTC
driver logic, and adaptations are made simply because
the driver is based on the TIMER peripheral instead of
the RTC.

A couple of tweaks are added due to QEMU issues with the
simulation of the TIMER peripheral.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Andrew Boie eec6b2673d tests: benchmarks: sched: remove icount notes
icount is on by default for all QEMU targets where it works
properly.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-24 20:28:36 -04:00
Andrew Boie a9670ab5cf boards: centralize QEMU icount management
Instead of endlessly repeating the same command line args,
centralize this and tune the shift value on a per-board
basis.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-24 20:28:36 -04:00
Andrew Boie 45979dafb4 linker: add iterable section macros
For iterable areas defined with Z_STRUCT_SECTION_ITERABLE(),
the corresponding output section in the linker script is just
boilerplate. Add macros to make these definitions simpler.

Unfortunately, we have a fair number of iterable sections not
defined with Z_STRUCT_SECTION_ITERABLE(), this patch does not
address this.

The output sections are all named <struct name>_area, update
sanitylib.py with this.

sys_sem with no userspace, and k_lifo/k_fifo are special cases
where different data types that are all equivalent need to be
put in the same iterable area. Add
Z_STRUCT_SECTION_ITERABLE_ALTERNATE() for this special case.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-24 17:09:22 -04:00
Andy Ross 973487fdad lib/os: Rework/shrink printk conversions, add 64 bit support
Add support for 64 bit conversions in a uniformly expressable way by
printing values backwards into a buffer on the stack first.  This
allows all operations to work on the low bits of the value and so the
code doesn't need to care (beyond the size of that buffer) about the
word size.  This trick also doesn't care about the specifics of the
base value, so in the process this unifies the decimal and hex printk
conversion code to a single function.

This comes at a mild cost in CPU cycles to the decimal converter and
somewhat higher cost to hex (because it's now doing a full div/mod
operation instead of shifting and masking).  And stack usage has grown
by a few words to hold the temporary.  But the benefits in code size
are substantial (e.g. ~250 bytes of .text on arm32).

Note that this also contains a change to tests/kernel/common to
address what appears to have been a bug in the original converters.
The printk test uses a format string that looks like "%-4x%-2p" and
feeds it the literal arguments "0xABCDEF" and "(char *)42".
Now... clearly both those results are going to overflow the 4 and
2-byte field sizes, so there shouldn't be any whitespace between these
fields.  But the test was written to expect two spaces, inexplicably
(yes, I checked: POSIX-compatible printf implementations don't have
those spaces either).

The new code is definitely doing the right thing, so fix the test
instead.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-06-24 13:43:40 -07:00
Jukka Rissanen da2db1ce53 drivers: eth: native_posix: Print errno when interface creation fails
Printing the file descriptor does not give any information when
the network interface creation fails, so print errno here instead.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-24 23:34:27 +03:00
Jukka Rissanen 6ecea4b3dd net: conn: Handle multi interface AF_PACKET recv() properly
If we have multiple network interfaces and we are waiting incoming
network packets, make sure to honor the bind of the socket so that
correct socket will receive data in certain network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-24 23:34:27 +03:00
Jukka Rissanen 4363c566ed doc: kernel: Add sys_sem APIs to kernel documentation
The kernel documentation was missing sys_sem APIs.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-24 15:38:47 -04:00
Michael Hope ad7ea0d498 drivers: usb: fix usb_dc_ep_mps() for the SAM0 for IN endpoints
The driver was returning zero due to accessing the, say, 0x81'th
endpoint instead of the 0x01'th endpoint.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-06-24 21:00:59 +02:00
Francois Ramu 1228a525c1 boards: arm: stm32f3 disco board enables the iwdg
This patch enables the Independent watchdog (iwdg)
so that the testcase tests/drivers/watchdog/wdt_basic_api
can run on this stm32f3_disco board

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-06-24 21:00:23 +02:00
Ningx Zhao d7d2cd5086 tests: queue modifying and adding test case
1.Add a new testcase to verify multiple queues can be defined
2.Add some code comments to describe function performance.

Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
2020-06-24 20:59:52 +02:00
Nicolas Pitre 8a6b02b5bf lib/os/heap: some code simplification in sys_heap_aligned_alloc()
It is clearer to apply the alignment in the memory address space
rather than the chunk space.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-06-24 11:53:50 -07:00
David Leach 5385d49029 doc: release: Document release quality metrics
Document the bug count metrics used to gate the release process

Signed-off-by: David Leach <david.leach@nxp.com>
2020-06-24 09:47:34 -04:00
Peter Bigot 5ea2eaa765 samples: usb: mass: do application configuration before usb starts
USB access to the flash device is not synchronized with the
application, so if the application needs to create a new file system
USB may read configuration state that is incorrect.  Wait until the
the application is done with the flash before starting USB.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-24 09:46:56 -04:00