Commit graph

41120 commits

Author SHA1 Message Date
Tobias Aschenbrenner
e99fb77620 sensors: lis3dh: Fix i2c burst read
The sensor enables the readout of multiple consecutive registers if
the MSb of the sub-address is set. The other 7bit are the register
address.

Signed-off-by: Tobias Aschenbrenner <taschenb@posteo.de>
2018-03-28 10:42:34 -04:00
29f4e18af4 cdc_acm: fix interrupt handling, API registration, and propgate errors.
As per uart_pipe.c, irq_is_pending should only return true if any
*unmasked* interrupts are pending.

The device_get_binding() code only checks devices that have an API.
Set the API at compile time so that other devices can refer to the CDC
ACM driver.

usb_write() may return EBUSY if the endpoint is full.  Propagate this
for future use.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-03-28 11:17:14 +02:00
Jukka Rissanen
e5ea7d2260 doc: net: Add websocket and websocket_console to net API docs
Websocket related groups were missing from network API documentation.

Fixes #6779

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-28 10:05:49 +03:00
Jukka Rissanen
9626cba0cb sample: net: echo-server: Cleanup config files
Combine several generic config file into prj.conf that can be
used by several boards and configurations.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-28 09:41:05 +03:00
91ff634d32 ethernet: fix an unaligned access fault by removing __packed.
__packed allows the struct to be linked at a non-word size boundrary
which causes an unaligned access fault on the Cortex-M0+.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-03-28 09:37:37 +03:00
4e7deb49b9 usb: netusb: implement the ethernet interface.
net_eth_get_hw_capabilities() calls .get_capabilities() which is part
of the ethernet API but not the net_if_api that netusb implements.
This causes a fault as .get_capabilities() was past the end of the
struct and resolved to a random address.

Also, make the API const and give it a unique name.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-03-28 09:36:55 +03:00
5a6271b08d usb: sam0: add the new usb_dc_ep_mps() function.
This was added as part of the USB transfer infrastructure.  Implement
for the SAM0.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-03-27 19:57:38 -04:00
Peter Gielda
1c60ba1459 drivers: serial: Add missing FE310 UART driver reference to CMakeLists
This commit adds a missing reference to uart_fe310.c to CMakeLists.txt.

Signed-off-by: Peter Gielda <pgielda@antmicro.com>
2018-03-27 19:52:28 -04:00
Jukka Rissanen
f947439fa1 net: Align the stack infos in net_stack linker section
There can be lot of traffic class threads and each will have
their own stacks. This can trigger issue when traversing the
stacks list in "net stacks" shell command. To overcome this issue,
we need to align each net_stack_info struct by 32 bytes. This is
the same issue that happened with net_if earlier.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
c609bd8fd7 tests: net: Increase the size of main stack
This avoids this crashing in qemu_x86

***** Stack Check Fail! *****
Current thread ID = 0x004015e0
Faulting segment:address = 0x0008:0x00003593
eax: 0x0041e930, ebx: 0x00000000, ecx: 0x004170bc, edx: 0x0000dff8
esi: 0xffffffff, edi: 0x0041e930, ebp: 0x00417010, esp: 0x00416ffc
eflags: 0x216
Fatal fault in essential thread! Spinning...
Terminate emulator due to fatal kernel error

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
ba3c0bb123 samples: net: Add traffic class sample application
This demostrates how to classify the network traffic when sending
data. The application will create similar functionality as
echo-client so user can use echo-server running in remote host to
test this sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
d114deadcf net: shell: Print TX and RX threads stacks with more info
The "net stacks" command was printing TX or RX thread values so
that it was not possible to use the values in debugging easily.
Add traffic class value when printing the info so that it is
easy to see what TX or RX queue is doing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
99e93db6b2 net: stats: Add traffic class statistics
Add statistics for number of packets and bytes to each traffic
class. Print this information in net-shell.

Also make sure that we do not calculate total packet length many
times. So calculate network packet total length once and then use
that value instead of calculating it many times in a row.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
2a3de97ce9 tests: net: Add unit test for traffic class support
Test that we can set the priority of the network packet and
that high priority packets are sent before low priority ones.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
6049207a29 net: Add initial TX and RX traffic class support
With this commit it is possible to add priority to sent or received
network packets. So user is able to send or receive higher priority
packets faster than lower level packets.
The traffic class support is activated by CONFIG_NET_TC_COUNT option.
The TC support uses work queues to separate the traffic. The
priority of the work queue thread specifies the ordering of the
network traffic. Each work queue thread handles traffic to one specific
work queue. Note that you should not enable traffic classes unless
you really need them by your application. Each TC thread needs
stack so this feature requires more memory.

It is possible to disable transmit traffic class support and keep the
receive traffic class support, or vice versa. If both RX and TX traffic
classes are enabled, then both will use the same number of queues
defined by CONFIG_NET_TC_COUNT option.

Fixes #6588

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
159aaf1740 net: core: Add array support to stack info helpers
Allow caller to create array of thread stacks using
NET_STACK_ARRAY_DEFINE() macro. This allows more debug information
to be printed by "net stacks" command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
81d8d5219c net: context: Add PRIORITY option support
Add context option support and implement PRIORITY option that
can be used to classify the network traffic to different trafic
classes according to said priority value.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
ca8b00a3cc net: if: Make interface IP configuration more flexible
Instead of always allocating both IPv6 and IPv4 address information
to every network interface, allow more fine grained address
configuration. So it is possible to have IPv6 or IPv4 only network
interfaces.

This commit introduces two new config options:
CONFIG_NET_IF_MAX_IPV4_COUNT and CONFIG_NET_IF_MAX_IPV6_COUNT
which tell how many IP address information structs are allocated
statically. At runtime when network interface is setup, it is then
possible to attach this IP address info struct to a specific
network interface. This can save considerable amount of memory
as the IP address information struct can be quite large (depends
on how many IP addresses user configures in the system).

Note that the value of CONFIG_NET_IF_MAX_IPV4_COUNT and
CONFIG_NET_IF_MAX_IPV6_COUNT should reflect the estimated number of
network interfaces in the system. So if if CONFIG_NET_IF_MAX_IPV6_COUNT
is set to 1 and there are two network interfaces that need IPv6
addresses, then the system will not be able to setup IPv6 addresses to
the second network interface in this case. This scenario might be
just fine if the second network interface is IPv4 only. The net_if.c
will print a warning during startup if mismatch about the counts and
the actual number of network interface is detected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
47dafffb67 net: if: Separate IP address configuration from net_if
Move IP address settings from net_if to separate structs.
This is needed for VLAN support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Sebastian Bøe
bdc5c72498 samples: Add sample that demonstrates a custom board definition
Add a sample that demonstrates a custom board definition. This proves
that BOARD_ROOT works and can be a useful reference when creating a
custom board definition.

Instead of spending time making up a board, the nrf52840_pca10056
board has been copied as-is. And the hello world sample has been used
as the basis for the application.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-27 09:35:35 -04:00
Sebastian Bøe
38f8e849b5 doc: Introduce the sample category app. dev. to the docs
There are currently two samples in the
~/zephyr/samples/application_development/ directory. This commit
allows them to be visible in the documentation.

It is not clear why this has not been done already.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-27 09:35:35 -04:00
Andrzej Głąbek
c4122bb6c1 ext: hal: nordic: Import SVD files for nRF5 SoCs
These files contain addresses of memory-mapped registers and their
bitfields definitions. They may become very useful in debugging.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v1.0.0
commit: cf78ebfea1719d85cf4018fe6c08cc73fe5ec719
Purpose: Facilitate debugging on nRF5 SoCs
Maintained-by: External

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-03-27 09:35:21 -04:00
Andrzej Głąbek
3dd8b903d2 ext: hal: nordic: Update nrfx to version 1.0.0
Updates nrfx to the recently released version and adjusts its glue
layer accordingly.
License headers are slightly corrected to match the license text at
https://opensource.org/licenses/BSD-3-Clause.
Deprecated MDK files nrf51xxx_peripherals.h are removed, since they
are replaced by a common file named nrf51_peripherals.h.

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

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-03-27 09:35:21 -04:00
Andrzej Głąbek
ad24576501 usb: device: nrf5: Remove support for the ACCESSFAULT event
This event is no longer exposed for the USBD peripheral,
and the newest MDK version (and consequently new nrfx HAL)
does not contain its definition and related bitfields.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-03-27 09:35:21 -04:00
Carles Cufi
82f85c6565 doc: samples: hci_uart: Expand instructions for the Controller
Cover the required steps to use the Controller with Linux's BlueZ and
QEMU, and link to the relevant sections in the subsystem developer
guide.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-27 09:45:08 +02:00
Carles Cufi
9ba007e878 doc; bluetooth: Rework and expand the Bluetooth doc
In order to avoid duplication, move all information relating to QEMU and
BlueZ from samples to subsystems, and expand to cover BlueZ installation
and usage of Controllers with BlueZ and QEMU in detail.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-27 09:45:08 +02:00
Erwan Gouriou
1ee8eeaccc scripts: extract_dts_include: convert inherited 'id' to 'node_type'
During yaml collapse step, convert inherited 'id' key to 'node_type'.
With this new 'node_type', it's is more easy to apply common treatment
to all bindings that include the same base yaml file but might not
have similar bindings/constraint naming convention.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-03-26 14:48:49 -04:00
Bobby Noelte
b6005bfb2a scripts: extract_dts_includes.py: factorize globals for module usage
Prepare to split extract_dts_includes in modules.

extract_dts_includes design is based on globals. Every module must be
able to use (import) them.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
dfd92b0602 script/dts: Remove unnecessary empty return on functions
No need to use return at the end of a function when it's not returning
anything.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
7ef3ddee0b scripts/dts: De-clutter main function in extract_dts_includes
Moving logical parts into dedicated functions for clarity.
Factorizing a bit the code for potential future changes (more
'zephyr,xxxx' directives related to CONFIG_ option).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
1134393ac1 scripts/dts: Make extract_dts_includes generating both files by itself
Thus no need to parse twice the .dtsi, .dts and .yaml files.
Simplify provided arguments relevancy, letting argparse generating usage
message by itself.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
b34d156693 scripts/dts: Use 4-spaces tabs instead of 2-space tabs in devicetree.py
Mandated by Python PEP-8.
(And normalize the way we write python in dts scripts also)

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
6a9ebdcd18 scripts/dts: Fix Copyright headers
One was missing it and the other was not the new format.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Spoorthi K
f37507604d tests: kernel: mem_protect: Update platform whitelist
Remove arduino_101 from platform whitelist in testcase.yaml as all the
test cases are not meant to run on Arduino_101.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-03-26 14:24:34 -04:00
Sebastian Bøe
0da61744fb device.h: doc: Refactor to keep documentation infront of impl.
The ifdef'ing is re-ordering things so that the documentation is
either to far away from the implementation, or in the wrong
order (implementation and then documentation).

This commit reorders the macros and documentation so that we avoid
long-spanning #ifdef's and we keep the documentation at the head of
the implementation.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-26 13:17:39 -04:00
Sebastian Bøe
f816c39300 init.h: Fix english in comment
Minor fix to broken english in a comment.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-26 13:17:39 -04:00
Sebastian Bøe
8356045633 docs: Fix reference to non-existent SYS_INIT_PM macro
The documentation is referencing the macro SYS_INIT_PM, but
SYS_INIT_PM does not exist, the correct name is SYS_DEVICE_DEFINE.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-26 13:17:39 -04:00
Sebastian Bøe
0de21f8a9b doc: drivers: Include device_config declaration in documentation
There are several references to config_info in this documentation, but
no introduction to what it is. Including this declaration makes it
possible to understand the documentation.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-26 13:17:39 -04:00
Sebastian Bøe
917d8e2f7b doc: drivers: Re-order error-handling section
The paragraphs on error handling are out-of-place, as they are
abruptly explained in the middle of a section that is about the cruft
involved in declaring and implementing drivers.

This commit moves them into their own section.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-26 13:17:39 -04:00
Sebastian Bøe
b07cb2924b docs: Use simple english
Simplify the sentence by using simple english.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-26 13:17:39 -04:00
Anas Nashif
993c350b92 cleanup: replace old jira numbers with GH issues
Replace all references to old JIRA issues (ZEP) with the corrosponding
Github issue ID.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-26 13:13:04 -04:00
Anas Nashif
788aa45888 drivers: timer: remove unkown jira ID
Remove RTOS-2676 from the comment, this is a jira issue number that was
used with zephyr in the past and not available anywhere for reference.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-26 13:13:04 -04:00
Kumar Gala
ca5964d66d board: x86: tinytile: Enable I2C through DTS
For some reason tinytile was missed in the conversion of quark_se boards
to use DTS for I2C.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-03-26 10:51:35 -04:00
Vinayak Kariappa Chettimada
4c49df98e5 Bluetooth: controller: Fix missing device filter clear
Fix missing device filter clearing for cases where whitelist
was used and then in subsequent adv/scan enable it was
unused.

This fixes an assert in ll_filter.c at line 248.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-03-26 16:44:35 +02:00
Carles Cufi
8761bf05d1 samples: mgmt: Remove unnecessary mbedTLS reference
Since the base64 encoding and decoding functionalit is now provided by a
separate library, remove the line in the CMakeLists.txt file that refers
to it.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-26 16:29:27 +02:00
Carles Cufi
ab2d3e70c6 samples: mgmt: Remove unneeded DTC overlay
With the new CONFIG_BOOTLOADER_MCUBOOT option there is no longer a need
to define custom overlays in order for a project to be bootable by
MCUboot. Remove therefore those unnecessary complications in the sample.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-26 16:29:27 +02:00
Youvedeep Singh
43383701ca include: posix: correcting the return type of sleep.
Currently return type of sleep is int, but as per POSIX 1003.1 it
should be unsigned.

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2018-03-26 09:50:17 -04:00
Jukka Rissanen
5afa30ccef drivers: eth: native_posix: No need to sleep in select
We can just use polling mode with 0 timeout when waiting data
to arrive from host OS. The 50ms timeout is not needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-26 15:47:48 +03:00
Tomasz Bursztyka
185ff16675 net/mgmt: Remove spurious k_sem_give()
Caller of that function is the one giving the semaphore.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 15:07:00 +03:00
Tomasz Bursztyka
807f3e335b net/mgmt: Reenforce pushing events into notification list
Previous way was too lazy. Now let's match exactly for the layer and the
layer code.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 15:07:00 +03:00