Commit graph

41120 commits

Author SHA1 Message Date
Anas Nashif
d1bca4e056 ci: use set -x for verbosity
set -v was too verbose, so change to -x and remove extra sourcing of
zephyr-env.sh.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 13:00:02 -05:00
Anas Nashif
45cbc81160 ci: pass pull request number to CI script
For further processing, pass pull request number to the CI script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 13:00:02 -05:00
Anas Nashif
5dd2593bcd ci: remove sanitycheck options from .shippable
They are now defined in CI script directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 13:00:02 -05:00
Anas Nashif
d95ce03c1d ci: define BSIM_* variables in ci script directly
Rather than pass them as options, just set it directly in the CI script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 13:00:02 -05:00
Anas Nashif
a0a1bffd1c ci: move pos processing to the CI script
Move post processing to script and remove duplicatated code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 13:00:02 -05:00
Aurelien Jarno
6fd1691b94 kernel: Add a "nocache" read-write memory section
Add a "nocache" read-write memory section that is configured to
not be cached. This memory section can be used to perform DMA
transfers when cache coherence issues are not optimal or can not
be solved using cache maintenance operations.

This is currently only supported on ARM Cortex M7 with MPU.

Fixes #2927

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-03 09:54:31 -08:00
Yurii Hamann
2c363bddfe dts: arm: stm32: USART1 fix in device tree for STM32F7 series devices
Fixed mask value for RCC_APB1ENR register.

Signed-off-by: Yurii Hamann <yurii@hamann.site>
2018-12-03 11:36:01 -06:00
Andrew Boie
c7b7363da8 userspace: add additional debug to elf_helper
Devices are identified as belonging to a particular subsystem
by looking at device->driver_api.

Print some debug information if this is NULL or points to an
unrecognized API struct.

This is normal in a lot of cases, for example any use of SYS_INIT().
However, for real devices this may be an indication of mis-
configuration.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-12-03 09:26:20 -08:00
Peter A. Bigot
1fa00f3b36 kernel: remove outdated comment in _Cstart
The comment explaining why _IntLibInit was being invoked was left in
place after the invocation itself was removed.  Remove it too.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2018-12-03 09:18:06 -08:00
Andrzej Głąbek
965128bab1 drivers: usb_dc_nrfx: Align with nrfx version 1.4.0
A typo in the name of the bmRequest field in the nrfx_usbd_setup_t
structure was fixed in nrfx version 1.4.0. Update the driver to use
the new correct name: bRequest.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-12-03 17:56:15 +01:00
Andrzej Głąbek
b7b6e65885 ext: hal: nordic: Update nrfx to version 1.4.0
Updates nrfx to the recently released version. See
https://github.com/NordicSemiconductor/nrfx/blob/v1.4.0/CHANGELOG.md
for a list of changes that this version introduces.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v1.4.0
commit: 595e79f63f21224f6a42325095be9940a4a62ffb
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-12-03 17:56:15 +01:00
Bub Wei
a127984613 samples: net: zperf: Remove invalid forever sleep
We are not expecting forever k_sleep in multithreading.
And k_sleep is empty in non-multihreading.
So remove invalid forever sleep to avoid the below issue.

ASSERTION FAIL [duration != (-1)] @ zephyr/kernel/sched.c:807

Please refer to _impl_k_sleep api in zephyr/kernel/sched.c:807

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-03 14:43:49 +02:00
Håkon Øye Amundsen
d270f08956 soc: nordic: Add BPROT and MPU to list of supported HW.
Add configuration values for HAS_HW_NRF_BPROT and HAS_HW_NRF_MPU.
Select these configurations where applicable.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2018-12-03 13:39:27 +01:00
Jukka Rissanen
d641ac6eee drivers: eth: native_posix: Fix gPTP compile error
If compiling with gPTP support for native_posix board, then avoid
compile error that is seen with gptp sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-03 14:24:36 +02:00
Krzysztof Chruscinski
65b5e86c52 logging: Fix RTT backend being enabled with shell RTT
If USE_SEGGER_RTT option was enabled then LOG_BACKEND_RTT was
enabled by default. In case shell RTT was also used then both
write to RTT. Updated Kconfig to prevent such situation.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-03 11:55:33 +01:00
Vinayak Kariappa Chettimada
a2f2d23c9f Bluetooth: controller: Fix conn update assert in slave role
Explicitly track the connection update related ticker stop
and start to avoid asserting due to ticker update being done
at the same time for compensating the clock drift.

The compensation related ticker update failure in this case
can be safely ignored as new anchor point is used anyway
at the instant of the connection update.

Fixes #8796

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-12-03 10:38:57 +01:00
Paweł Zadrożniak
1da367b5bf drivers: nordic: usbd: Fix long (fragmented) control OUT transfers
Fragmented long CTRL OUT transfers does not work properly, because
they were not handler properly by the shim. In such transfers,
a special call (nrfx_usbd_setup_data_clear()) must be performed
before every data packet and not just before the first one.
This patch adds a byte counter which is set while processing setup
packet (host->device only) to be able to decide whether there will
be more data packets coming (and to call_data_clear() or not).

Fixes #11232 .

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2018-12-03 10:28:11 +01:00
Anas Nashif
0754c67b3d samples: http_server: fixed test dependencies
depend on USB device and increase RAM requirements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-02 22:36:41 -05:00
Anas Nashif
f3f91f88d6 samples: zperf: expand test coverage
depend on USB device and increase RAM requirements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-02 22:36:41 -05:00
Jukka Rissanen
e9364d52fe net: Discard received extra data at the end of the IP message
If we receive extra data at the end of the IP message, then
discard that data and accept the packet.

Fixes #11649

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-02 14:23:13 -05:00
David B. Kinder
b645194cd3 doc: add sphinx extension improving only directive
The Sphinx ``.. only::`` directive is limited to handling only
conditional text and can't handling conditional use of directives
For example,

```
.. only:: test

   .. automodule:: west.runners.core
      :members:
```

is not handled. This PR monkey patches the handling of the existing
``.. only::`` directive done by Sphinx.

See https://github.com/pfalcon/sphinx_selective_exclude for details.
Licensing amended to Apache 2.0 with permission from the author.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-02 14:17:24 -05:00
Aurelien Jarno
6ed2ea66d0 drivers: usb_dc_sam: add support for SoF event
Add support for SoF events to the USB SAM device driver. When
CONFIG_USB_DEVICE_SOF is enabled, enable the corresponding interrupt
and call the callback function from there.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-02 10:39:39 -05:00
Aurelien Jarno
1e9ed85de9 arm: nRF5x: select ENTROPY_NRF5_RNG if ENTROPY_GENERATOR is enabled
This is done on other SoCs and is important for some of the net samples.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-02 09:39:32 -05:00
Rajavardhan Gundi
7765c1adaf drivers: flash: spi_nor: Remove unused block_size parameter
Only page and sector size is used by the driver.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-02 09:27:16 -05:00
Rajavardhan Gundi
826a7cdca8 drivers: flash: spi_nor: Remove page alignment requirement for R/W
For flash R/W, the start address need not be aligned on a page size.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-02 09:27:16 -05:00
Michael Scott
2291be6668 boards: arm: reel_board: select BT_CTLR if BT is enabled
Reel Board doesn't enable BT by default like many of the nRF52
boards do.  So let's make enabling BT a bit easier, by selecting
the BT_CTLR config when BT is enabled.  This allows a sample
overlay to merely set:
CONFIG_BT=y

And the end result should be close to correct.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-12-02 09:26:27 -05:00
Stig Bjørlykke
ece520c6ff boards: doc: Remove 802.15.4 support
The nRF51822 and nRF52832 does not support 802.15.4, so remove this
statement from documentation.

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
2018-12-02 09:24:05 -05:00
Stig Bjørlykke
9c955b3719 boards: doc: Remove empty table rows
Remove the initial empty row in the supported features table.

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
2018-12-02 09:23:17 -05:00
Jan Van Winkel
55f091f43f i2c: sensor: Replace static_assert by BUILD_ASSERT_MSG
Replace static_assert in NRFX TWI, TWIM and QDEC drivers by
BUILD_ASSERT_MSG

fixes: #11754

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-01 18:37:16 +01:00
Michael Scott
d39d5881c3 drivers: i2c: fix build break for nrfx_twi* with newlib
When running sanitycheck for reel_board which selects
CONFIG_NRFX_TWIM it fails the following tests:
tests/misc/test_build/test_newlib
tests/kernel/errno/kernel.common.errno.newlib
tests/lib/mem_alloc/libraries.libc.newlib

/zephyr/drivers/i2c/i2c_nrfx_twim.c:144:3: error: expected declaration
specifiers or '...' before '(' token
   (bitrate == I2C_BITRATE_STANDARD ? NRF_TWIM_FREQ_100K         \
   ^
/zephyr/drivers/i2c/i2c_nrfx_twim.c:151:3: note: in expansion of macro
'I2C_NRFX_TWIM_FREQUENCY'
   I2C_NRFX_TWIM_FREQUENCY(           \
   ^~~~~~~~~~~~~~~~~~~~~~~
/zephyr/drivers/i2c/i2c_nrfx_twim.c:184:1: note: in expansion of macro
'I2C_NRFX_TWIM_DEVICE'
 I2C_NRFX_TWIM_DEVICE(0);
 ^~~~~~~~~~~~~~~~~~~~
/zephyr/drivers/i2c/i2c_nrfx_twim.c:154:3: error: expected declaration
specifiers or '...' before string constant
   "Wrong I2C " #idx " frequency setting in dts");         \
   ^
/zephyr/drivers/i2c/i2c_nrfx_twim.c:184:1: note: in expansion of macro
'I2C_NRFX_TWIM_DEVICE'
 I2C_NRFX_TWIM_DEVICE(0);
 ^~~~~~~~~~~~~~~~~~~~
zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/build.make:62: recipe
for target
'zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj'
failed

To fix this, let's replace the use of static_assert() with a more
generic macro: BUILD_ASSERT_MSG()  This should work across minimal
libc, newlibc and c++.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-12-01 18:35:21 +01:00
Vikrant More
089d18b403 samples: mesh: nrf52: upgrade re-transmission parameters
Upgrade NODE's transmission parameters.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-01 15:14:43 +02:00
Vikrant More
cb0b52837b samples: mesh: update Kconfig parameter for better performance
Upgrade & add few Kconfig parameters to improve Bluetooth Mesh
performance.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-01 15:14:43 +02:00
Tomasz Bursztyka
10c4841835 net/net_if: Do not set TCP related flags on non-INET/6 family
Such sent flag is in a union in net_pkt, shared with a gptp flag.
Tweaking it when the family is not AF_INET or AF_INET6 will generate
corrupted gptp packets.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
5fb9a7bc4a net/gptp: Let Ethernet setting up the header
Instead of redoing what Ethernet L2 already does, let just create the
gptp message without any Ethenet header. Which one will be done as
sending phase by Ethernet L2 relevantly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
f964f3f8dc net/pkt: Add a gptp marker to know whether pkt is a gptp message or not
Like ARP, GPTP works on top of Ethernet but is considered as a layer 2
protocol, so we cannot set an AF_* family type. Instead let's have a bit
telling that current packet is a gptp message (family has to be
AF_UNSPEC).

The bit is unionized with a TCP related bit: TCP cannot be present on an
AF_UNSPEC packet so there will not be any collision.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
ee9dedd5a7 net/iface: Finally remove the send function from net_if_api
And apply that to modem driver setting that pointer to NULL.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
72e1c2b4c1 tests/net: Apply L2 change everywhere where relevant
Many tests use either Ethernet or Dummy L2 and as such require
modifications towards the driver API on their fake devices.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
2b3046df70 net/bluetooth: Switch to L2 sending path
This is a much more trivial move than in Ethernet or ieee802154 L2s.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
ebb40ba338 net/ieee802154: Switch to L2 sending path
As for Ethernet, up to ieee802154 L2's send to actually sent the packet.
It's currently unoptimized as 6lo compression, 15.4 fragmentation and so
on will reallocate net_buf etc... but it's the first step towards
removing ll reserve space and more.

Applying changes to Openthread L2 as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
7f2cb02720 net/dummy: Switch to L2 sending path
And adapt loopback and slip drivers relevantly

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
9464ec3343 net/iface: Switch fully to a one-pass sending logic in net_if
Now instead of such path:

net_if_send_data -> L2's send -> net_if tx_queue -> net_if_tx -> driver
net_if's send

It will be:

net_if_send_data -> net_if tx_queue -> net_if_tx -> L2's send -> driver
net_if's send

Only Ethernet is adapted, but 15.4 and bt will follow up.
All Ethernet drivers are made compatible with that new scheme also.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
114521c4bf net/arp: ARP packet can be queued right away
Now that sending is done at last time, in one pass, no need to go
through net_if_send_data here.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
500eca745d net/ethernet: Move sending to a one-pass logic
Currently, first part is done in L2's send, then the next one in
ethernet device driver net_if send function. That last one was already
moved to a L2 based implementation. Let's just move forward and place
the whole logic of the L2's send in that second function.

This is the first step, ethernet centric only, to move towards a
one-pass sending logic in net stack. In future, net_if's send will
disappear.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
dcc6eddfef net/ethernet: Centralize where and when header is filled in
Current code generating Ethernet header is scattered all over the place,
sometimes in functions that are supposed to check something (and not
filling the header). Not to say about innefficiency.

Src ll address does not need to be set in L2 as net_if.c handles that
already.

Broadcast dst ll address is the same in ipv4 or ipv6, thus factorizing.
In each case, multicast is filled in only at the relevant place.

This is the first step towards changing L2 sending logic, when L2 send
API function will be the only point of sending. The redirection from
driver to L2 again (which finally uses the right device API function to
send) it a temporary hack.

This simplifies the code but will also enable using statically
allocated net_buf and ethernet header payload buffer afterwards.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tomasz Bursztyka
94e89a11b7 net/ethernet: Make ethernet allocating its own frag for the header
This is currently unoptimized, as all frags are allocated with relevant
ll reserve for such header space. However, this is the first step
towards getting rid of that ll reserve concept everywhere.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-30 11:12:13 -08:00
Tavish Naruka
df07e093ce samples: net: mqtt_publisher: Update for latest net_config and TLS setup
Remove adhoc handling of BLE connection setup, rely on net_config for
that. Remove board-specific configs, instead have prt.conf and overlay
configs. Perform TLS setup once before main loop, to avoid errors.

Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
2018-11-30 11:05:10 -08:00
Marek Pieta
788210816d debug: tracing: Add CPU stats module
Change adds CPU stats module for tracing hooks. Module provides
information about percent of CPU usage based on tracing hooks
for threads switching in and out, interrupts enters and exits.
cpu_stats only distinguishes between idle thread, non idle
thread and scheduler.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2018-11-30 11:01:32 -08:00
Alexander Polleti
58b51dd0c5 pinmux: stm32f4: add MII interface
Add Pin multiplexing for MII ethernet interface for STM32F4.

Signed-off-by: Alexander Polleti <metapsycholo@gmail.com>
2018-11-30 10:59:49 -08:00
Alexander Polleti
daf1ba6e52 ethernet: stm32: add MII mode
Add MII mode for STM32 Ethernet in Kconfig. Default is still RMII.

Signed-off-by: Alexander Polleti <metapsycholo@gmail.com>
2018-11-30 10:59:49 -08:00
Krzysztof Chruscinski
4d94257162 logging: Make logging thread priority fixed
Removed kconfig option for setting logging thread priority
and fix it to K_LOWEST_APPLICATION_THREAD_PRIO.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-30 10:59:02 -08:00