Commit graph

41120 commits

Author SHA1 Message Date
Brett Witherspoon
a5327b0003 drivers: adxl362: clear status independently and before mapping
Clear status bits before mapping them to the interrupt pin, so the
interrupt will occur on the next event instead of a pending event. Also
the status bits are cleared independently, because the threshold and
data ready functions can be enabled simultaneously.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-13 09:53:04 -05:00
Brett Witherspoon
ed474e88bd drivers: adxl362: check interrupt status
Check the status and only execute the callback if the event has
occurred.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-13 09:53:04 -05:00
Brett Witherspoon
0e9257018c drivers: adxl362: don't disable callbacks
Enabling and disabling the GPIO callbacks is error prone and unnecessary
since the trigger data is protected with a mutex, so it has been
removed. This resolves the following issues:

- The GPIO callbacks are not being re-enabled properly in the error path
  of the trigger setting function.

- The device pointer used in the GPIO callback to retrieve the ADXL362
  driver configuration data is the GPIO device not the ADXL362 device,
  so this cast is invalid and the int_gpio field is garbage.

- There are potential timing issues between enabling interrupts and
  re-enabling the callbacks.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-13 09:53:04 -05:00
Joao Cordeiro
6746470d1d drivers: ieee802154: nrf5: Support when LOG is off
ieee802154_nrf5 checks if IEEE802154_DRIVER_LOG_LEVEL is set to debug
before initializing the "nRF5 rx stack". This leads to an undefined
reference error in case of the LOG module being disabled.

Avoids this behavior by using the LOG_LEVEL macro and setting it as
LOG_LEVEL_NONE in case of IEEE802154_DRIVER_LOG_LEVEL not defined.

Signed-off-by: Joao Cordeiro <jvcc@cesar.org.br>
2019-05-13 16:30:27 +02:00
Aaron Tsui
b8285a580e samples: sensor: bme280: add arduino_101_sss.overlay
Add an overlay file, build out of the box for arduino_101 board.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-05-13 08:40:18 -05:00
Aaron Tsui
0b46eb26b4 samples: sensor: bme280: add README.rst
Added BME280 (humidity and pressure sensor) sample documentation for
guiding beginners.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-05-13 08:40:18 -05:00
Krzysztof Chruscinski
3b99b20ff0 shell: Move signals initialization from thread to init
By moving signals initialization to shell instance init function,
shell instance is ready to receive RX signals from backend before
thread is ready to handle them.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-13 14:05:02 +02:00
Joakim Andersson
ca4a078bcc CODEOWNERS: Fix missing '/' in codeowners file
Fix error "Expected '/' after directory 'soc/nios2' in CODEOWNERS"

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-05-13 07:59:05 -04:00
Alexander Wachter
b0bc68e85e drivers: can: rename drivers to can_<dev name>
The filenames of the can drivers were not consisten.
Changed them to can_<dev name>

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Alexander Wachter
0e807c3f54 drivers: can: Add loopback driver
This commit implements a CAN loopback device. This device is used
for testing when no CAN controller is available on the hardware.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Alexander Wachter
acf40cabf9 tests: drivers: can: Make CAN dev global
Get the device binding only once and write it to a global variable.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Alexander Wachter
6b9a6f2465 tests: drivers: can: Add testcases for attach_workq
Add testcases for the new attach_workq API.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Alexander Wachter
f1b89eda8e tests: drivers: can: api: define DT_CAN_1_NAME if not defined
Define DT_CAN_1_NAME as an empty string if it is not defined.
This is useful for buildtest where no HW is available.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Alexander Wachter
54d065c695 drivers: can: Implement can_attach_workq
can_attach_workq is an isr wrapper that puts a work item into a workq
whenever a received frame matches the filter. With this function it is
possible to have a callback that is offloaded. This is useful if the
work is too complex for an isr or USERSPACE is enabled.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Alexander Wachter
7ddbade257 drivers: can: rework can_attach_msgq
can_attach_msgq can be implemented as a wrapper of can_attach_isr.
This is implemented as a common function for all drives and reduces
the complexity of the specific drivers. Since this is common to
multi instances of drivers too, it is removed from the API struct.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Alexander Wachter
b3b43b8921 drivers: can: Extend can_send with void *arg and pass it to the isr cb
This commit extends the CAN api can_send function by an argument
that is passed to the isr callback.
With this extension it is possible to distinguish between sent masseges
when they use the same callback.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Alexander Wachter
1b93522304 drivers: can: Extend attach_isr with void *arg and pass to the isr cb
This commit extends the CAN api attach_isr function by an argument
that is passed to the isr callback.
With this extension it is possible to distinguish between filter matches
when they use the same callback.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Anas Nashif
c4284ba74b CODEOWNERS: address some unowned files/dirs
Add owners for some architecture, soc and subsystem code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-05-12 16:54:29 -04:00
Richard Osterloh
197e35855c drivers: pinmux: add SPI2 on Port B defines
This commit adds pin definitions for SPI2 on PB12-15 on STM32L4 devices

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-05-12 15:16:44 -04:00
Matthew Koch
75f0ad5ac0 stm32f7: Kconfig: soc: Enable GPIO ports F & G by default
Enable GPIO ports F & G (follow the pattern of H, I, J & K)

Fixes: #15918

Signed-off-by: Matthew Koch <koch.matthew@gmail.com>
2019-05-12 15:15:41 -04:00
Marcin Szymczyk
3c3e267d72 usb: add zero-length packet after MPS-sized IN transaction
Send ZLP when host asks for a bigger length and the last chunk
is wMaxPacketSize long, to indicate the last packet.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-05-12 15:15:08 -04:00
Marti Bolivar
f3d1386ae8 doc: save ZEPHYR_BASE in more places where it's needed
This fixes a corner case.

The ZEPHYR_BASE variable might be set in the environment at generation
time, but unset at build time. Save it in the cmake -E env calls to
scripts that need it.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-05-12 15:14:16 -04:00
Antony Pavlov
c7e66ff9bc boards/arm/olimexino_stm32: enable watchdog
Zephyr already has STM32 watchdog support.
Just enable it.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-12 15:13:21 -04:00
Antony Pavlov
bfcfe14764 samples/drivers/watchdog: make it work on STM32
IWDG driver for STM32 doesn't support the callback parameter.
The patch adds necessary workaround for STM32.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-12 15:13:21 -04:00
Mark Ruvald Pedersen
197197a579 cmake: Toolchain abstraction: Introduce toolchain_ld_configure_files
No functional change expected.

This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2019-05-12 12:50:57 -04:00
Sebastian Bøe
f483e5b527 cmake: Mark post_build files as BYPRODUCTS
Mark post_build files as BYPRODUCTS to allow custom commands to depend
on them.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-05-12 12:49:24 -04:00
Piotr Mienkowski
7cf318b449 boards: add jlink runner for efr32_slwstk6061a board
This commit adds J-Link runner for efr32_slwstk6061a board. To use it
it is necessary to install J-Link Software and Documentation Pack.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-05-12 12:48:55 -04:00
Derek Hageman
d09b91f5fa tests: drivers: uart: Fix async write abort test
During the write abort test, a second write is started then quickly
aborted.  This means that the number of bytes sent is relative
to that second write.  So when comparing it against the number
of bytes received which is NOT reset, the first (completed)
send of five bytes has to be accounted for.  The current
nrfx implementations abort quick enough that no bytes are reported
sent, so this wasn't currently being exercised (i.e. the short
circuit of zero bytes sent was taken).

Tested on nrf52840_pca10056.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-05-12 12:48:33 -04:00
Pushpal Sidhu
d52ca25550 boards: adafruit_trinket_m0: Force program flash to 0x2000
Apparently zephyr,code-partition doesn't work unless you define
BOOTLOADER_MCUBOOT.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2019-05-12 12:38:11 -04:00
Pushpal Sidhu
de873903c5 boards: adafruit_trinket_m0: Set flash address
With the adafruit trinket m0, you must flash at 0x2000 due to a locked
UF2 bootloader.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2019-05-12 12:38:11 -04:00
Sebastian Bøe
c2c8c849b6 cmake: Don't have users call zephyr_link_interface on mbedTLS
Libraries that use mbedTLS have been invoking
zephyr_link_interface(mbedTLS). It is not clear what the intent of
this code has been, but it is redundant with the mbedTLS build
scripts, so it can be safely removed.

In addition to being redundant, it causes problems as it introduces an
ordering dependency, with this code mbedTLS must be declared before
users of mbedTLS are declared. Since this code is redundant, this
ordering dependency is also unnecessary.

This code is believed to have been added early on by accident and
copied through cargo-cult programming since.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-05-11 08:35:26 -04:00
Wentong Wu
6922d93d8e lib/posix: correct the meaning of CONFIG_MAX_PTHREAD_COUNT
Current code implement CONFIG_MAX_PTHREAD_COUNT as the maximum number
of POSIX threads that can ever be created, rather than the maximum
number of active POSIX threads. Use pthread_state of struct posix_thread
to track the state of posix thread in posix_thread_pool so that we can
reuse the unused posix thread.

Fixes #15516.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-05-11 08:24:36 -04:00
Paul Sokolovsky
6f6b46971a samples: google_iot_mqtt: Explicitly cast socklen_t to int in printf
Otherwise, it can lead to warning like:

main.c:80:10: warning: format '%d' expects argument of type 'int',
but argument 2 has type 'socklen_t' {aka 'long unsigned int'}
[-Wformat=]

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-11 13:25:58 +03:00
Paul Sokolovsky
220fba3b5d samples: google_iot_mqtt: Switch from sntp_request() to sntp_query()
sntp_request() was deprecated and superceded by sntp_query(), which
provides better time resolution.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-11 13:25:58 +03:00
Paul Sokolovsky
08be81d949 samples: sntp_client: Switch from sntp_request() to sntp_query()
sntp_request() was deprecated and superceded by sntp_query(), which
provides better time resolution.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-11 13:25:58 +03:00
Jukka Rissanen
59eb48329e samples: net: can: Add missing tag to SocketCAN sample
We should have "net" tag as this is a networking sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-10 22:43:27 +03:00
Jukka Rissanen
0c639a8a9a tests: net: socket: Add tests for socket family registration
Make sure that socket registration does something sane.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-10 22:43:27 +03:00
Jukka Rissanen
e082d98911 net: sockets: can: Register handler for AF_CAN
Use the automatic registration of AF_CAN type sockets.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-10 22:43:27 +03:00
Jukka Rissanen
b3cd478a5f net: sockets: packet: Register handler for AF_PACKET
Use the automatic registration of AF_PACKET type sockets.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-10 22:43:27 +03:00
Jukka Rissanen
61f4597d64 net: sockets: tls: Register handler for TLS sockets
Use the automatic registration of TLS socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-10 22:43:27 +03:00
Jukka Rissanen
89bf1578d9 net: sockets: Add a way to register a socket family handler
Allow automatic handling of registered socket families.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-10 22:43:27 +03:00
Vincent Wan
252ab55923 drivers: wifi: simplelink: Add static IP address support
Change the SimpleLink wifi driver to use static IP address instead of
DHCP when it is set by NET_CONFIG_MY_IPV4_ADDR. We also support setting
gateway and netmask via NET_CONFIG_MY_IPV4_GW and
NET_CONFIG_MY_IPV4_NETMASK.

This feature is tested out-of-tree against the echo sample after
modifying its prj.conf file to set the static IP address:

CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.1.191"

and after commenting out these lines in its board-specific config
file for cc3220sf_launchxl:

so that the NET_CONFIG_SETTINGS are not overridden.

The wifi sample is also verified to run correctly after running the
echo sample.

Fixes #14588

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-05-10 22:42:16 +03:00
Filip Kokosinski
e0a825003d riscv32: use device tree defines in linker
Delete memory-related configs from defconfig and use device tree based
macros in general riscv32 linker script instead of Kconfig ones.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-10 10:34:31 -05:00
Filip Kokosinski
2b61c37d04 soc: riscv32: sifive-freedom: soc.h: use defines from device tree
Use values generated from the device tree in RISCV_ROM_BASE,
RISCV_ROM_SIZE, RISCV_RAM_BASE, RISCV_RAM_SIZE macros.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-10 10:34:31 -05:00
Filip Kokosinski
6fcfb837b8 soc: riscv32: miv: soc.h: use defines from device tree
Use values generated from the device tree in RISCV_ROM_BASE,
RISCV_ROM_SIZE, RISCV_RAM_BASE, RISCV_RAM_SIZE macros.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-10 10:34:31 -05:00
Mateusz Holenko
416c624087 dts: m2gl025_miv: configure flash and sram
Choose sram0 as sram and flash0 as flash in m2gl025_miv device tree.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-10 10:34:31 -05:00
Mateusz Holenko
8a5688576c dts: riscv32: qemu_riscv32: add flash
Add flash to the QEMU RISC-V 32 device tree.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-10 10:34:31 -05:00
Mateusz Holenko
855153a37b dts: riscv32: qemu_riscv32: configure sram
Choose dtim as sram in QEMU RISC-V 32 device tree.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-10 10:34:31 -05:00
Mateusz Holenko
85ca181bfc dts: riscv32: hifive1: configure sram
Choose dtim as sram in the SiFive HiFive1 device tree.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-10 10:34:31 -05:00
Filip Kokosinski
2a5010e7c6 dts: riscv32: hifive1: add flash
Add flash to the SiFive HiFive1 device tree.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-10 10:34:31 -05:00