Commit graph

99014 commits

Author SHA1 Message Date
Maciek Borzecki
4ee4a6abad boards/nucleo_f103rb: add new board
Add configuration for Nucleo-64 F103RB board. By default, the UART
console is forwarded to USART2, available on STLink V2-1 USB
connector. All GPIO ports available on the connecot headers are
enabled.

Change-Id: I266170d1288ef27f668410c5737c46cdf716e137
Origin: Original
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:49:32 +00:00
Maciek Borzecki
291415a6c4 samples/drivers/disco: add 'disco' sample program
Add a sample program for blinking with GPIO connected LEDs. The sample
program by assumes the use of Nucleo-64 F103RB development board as the
target and will need to be updated for other platforms. The intention is
that the code will serve as an example of how to use GPIOs in one's
code.

Change-Id: Ia190a7ad5b07181731c9f502d87bd0ef0ba1abde
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:49:32 +00:00
Maciek Borzecki
84cf5a8b0b boards/stm32_mini_a15: add new board
Introduce configuration for STM32 MINI A15 embedded development
board. The board has a STM32F103VET6 MCU on board. The MCU has 64KB of
SRAM and 512KB of flash.

The board has the following peripherals:
- RS232 port on DB9 connector, connecting to USART1, pin mapping:
  - PA9-US1-TX
  - PA10-US1-RX
- a LED diode (U2) connected to pin PB5
- micro SD card connector with pin mapping:
  - PC8-SDIO-D0
  - PC9-SDIO-D1
  - PC10-SDIO-D2
  - PC11-SDIO-D3
  - PC12-SDIO-CK
  - PD2-SDIO-CMD
- on board SPI flash AT45DB161D-SU, pin mapping;
  - PA4-SPI1-NSS
  - PA5-SPI1-SCK
  - PA6-SPI1-MISO
  - PA7-SPI1-MOSI
- button (K1), connecting PB15 to GND
- 40-pin header connector XS5

Change-Id: Ia378b105abb25fb589a100185ea96512a5f98cf3
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:49:31 +00:00
Maciek Borzecki
5a73ca6809 serial/stm32: add driver for STM32 UART
Add driver for U(S)ART ports on STM32 MCUs. The driver implements basic
RX/TX functionality. Data transmission is implemented using polling. The
driver configures the port to use 8bit data transmission, 1 stop bit, no
parity control.

The driver exposes a public uart driver API and registers a single UART
device 'UART_0'. The device binds to USART1 peripheral and performs
required pinmux and clock control configuration. The device can be
initialized at the PRIMARY level, with default device priority.

The driver has been verified to work with a sample Hello World
application on a STM32F103 series MCU.

Change-Id: Iae103fcd8d2fb0a6c173cf141a68e17791255aab
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:20:28 +01:00
Maciek Borzecki
a8700114b3 soc/stm32f1/pinmux: implement STM32 pinmux integration
Add necessary integration code enabling use of common STM32 pinmux
driver.

The alternate function listing currently consists of USART1 pins
only. The listing should be updated when support for more devices is
added.

Change-Id: Ic65aeea9df9aaea7636ecdd6996f56e6ef59dc2f
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 16:27:04 +01:00
Maciek Borzecki
3642f9d6a3 soc/stm32f1/gpio: implement GPIO support
Add functions required for integration with common STM32 GPIO driver.

Change-Id: Ic6637e991f5c0cf659f3b927ed47ef482b13b64f
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 16:27:04 +01:00
Maciek Borzecki
6461e70b72 gpio/stm32: add common driver for STM32 GPIO
The driver implements a GPIO device interface for STM32 MCUs. Each SoC
must provide implementation of the follwoing calls:
stm32_gpio_flags_to_conf(), stm32_gpio_configure(),
stm32_gpio_set(). Consult gpio_stm32.h header for details on semantics
of these calls.

The driver registers 5 devices, each corresponding to a single GPIO
port. The users can then access individual pins by using values
0-15.

Change-Id: Id236b5b75c9dd091018a50a7be3501c8591cd551
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 16:27:04 +01:00
Maciek Borzecki
e53390f02d pinmux/stm32: add common driver for STM32 pinmux
Add a common driver for pin control subsystem in STM32 MCU series. The
driver allows for selection of pin's function without the ability of pin
remapping.

The driver implements a pinmux driver API, with custom `func` and `pin`
encoding in API calls. The caller is expected to use STM32PIN() helper
macro for encoding port/pin numbers or using one of the provided
STM32_PIN_* defines.

The common driver requires SoC specific support to be implemented. The
SoC code must implement these calls: stm32_get_pin_config(),
stm32_get_port_clock(), stm32_pin_configure(). Consult pinmux_stm32.h
header for detailn on semantics of these calls.

The driver also requires board level integration. The call
stm32_board_get_pinconf() is expected to privide pin function
assignments for the target board.

Whenever an IO pin is being enabled, the driver will automatically
enable the clock for corresponding port. The driver does not implement
disabling of port's clock as this has potentially disruptive, as such
such operation should be done explicitly in the code.

The pin control module needs to be initialized before any other modules,
but after clock_control. For this reason, the driver is initialized by
default at PRIMARY level, with priority set to 2. The priority can be
changed through configuration.

Change-Id: I8cb746d0f3cad72cd50b3355fe6d93a9f469be25
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 16:27:04 +01:00
Andrei Emeltchenko
f3ebc5bf97 drivers/nble: Check firmware version for compatibility
Current design of Nordic RPC requires strict firmware compatibility,
add check indicating if firmware is incompatible. At the moment we
allow to continue since something may work :).

Change-Id: Ie67d4a6509e53553ae6c41a2c8d2593ab20bdcfb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-18 15:22:13 +00:00
Andrei Emeltchenko
eb1e41d1e7 drivers/nble: Update valid advertise parameters
Allow to use Non Resolvable Private Address (NRPA) in advertisement,
following NBLE change.

Change-Id: I9491cfcd2e981237c99e55773a8beaddaee8b730
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-18 15:20:38 +00:00
Andrei Emeltchenko
4961833fd4 drivers/nble: Update RPC to Nordic BLE firmware
Update firmware version to 0317. Changes are mostly related to
advertising.

Change-Id: I3a438ad38e3c892e354f7ea59b99739153957f19
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-03-18 15:19:57 +00:00
Mariusz Skamra
f84bf33aca Bluetooth: tester: Return BTP error if requested unknown attr ID
With this patch BTP error will be returned if attribute with
requested ID don't exist in GATT attribute database.

Change-Id: Ic6125c6359e75a80fb9a51b6a527ee0a98628e6d
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-18 15:19:18 +00:00
Anas Nashif
cee0eb5816 watchdog: use instance name instead of variable
Do not depend on CONFIG_WDT_DW_DRV_NAME

Change-Id: Ib16389b2c64fdaa154f451a5c38bd4a25a0dfba5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-18 14:12:42 +00:00
Jukka Rissanen
8328fd5cd0 net: coap: Debug print was missing a parameter
Debug print was missing a parameter so it printed some garbage
value. Changed the printf not to try to print extra value.

Change-Id: I265c0bc8d703c8b40af6e25f5879a3d3a6fddcdf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-18 11:35:00 +00:00
Daniel Leung
2735e1fa82 adc: move each driver kconfig options into submenus
This moves the kconfig options for each drivers into their own
submenus. This makes menuconfig easier to navigate.

Change-Id: I2bdc8c3b61e424248ffb65385a7eabc797d89684
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-18 11:27:09 +00:00
Daniel Leung
770c6e7ca5 clock_control/stm32f10x: move kconfigs into its submenu
Moves the kconfig options for STM32F10X clock control driver
into its own submenu.

Change-Id: I9ef658defe85feab3dfdb3e329710cb48bbffd86
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-18 11:27:09 +00:00
Daniel Leung
e143d6dd59 clock_control/quark_se: fix default kconfig dependencies
() Moves the Quark SE clock control into its submenu.
() Fixes the dependencies in the SoC default Kconfig
   so the options are not displayed out of place in
   menuconfig.

Change-Id: Ifdf06242be8ceed03c2c657c942875a5a7f2750e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-18 11:27:09 +00:00
Daniel Leung
50bd5e72f7 aio: put driver kconfigs under submenus
Put the kconfig options for individual drivers into
their own submenus. This makes it easier to navigate.

Change-Id: I96b230c3236722c809337472f7efdc2dc1bafdee
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-18 11:27:09 +00:00
Genaro Saucedo Tejada
d1e9181fd4 sys_log: Grove driver update to new logging API
Replaces old DBG calls by new SYS_LOG_... ones, likewise updates the
grove/Kconfig file to include new per-level logging control.

Change-Id: I638ffa915a760b4f188c1bfa2dc68e63cbf7e624
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-03-18 00:01:21 +00:00
Genaro Saucedo Tejada
34d497118a sys_log: Adds the common log API header
The header sys_log.h concentrates logging macro definitions so it can be
reused by all code, change aims create an API to replace replace
currently duplicated logging macro definitions. Later enhancements to
log can now be performed in a single file. Features:

* Optional printing of colored messages
* Incremental log levels per-module
* Optional printing of logging level label (info, error, warning, debug)
* Caller function name printing
* One point log disable
* Global override log level
* Print function detection (printf or printk)

JIRA item ZEP-111 refers to this change.

Origin: Original
Change-Id: I34492b0148b4e9d0094f69c511b96f4fd640ef44
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-03-18 00:01:21 +00:00
Daniel Leung
bf40dec92e pwm: restructure Kconfig options
() Moves config options for each controllers into their own
   Kconfig files. This keeps upper level Kconfig from getting
   too big.
() Options for each controller are moved under their own
   submenus.

Origin: refactored from existing file
Change-Id: I77e92f72f8de85abaedfbe078283607b7c242c81
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-17 21:05:12 +00:00
Daniel Leung
a33aecc611 spi: restructure kconfig options
() Moves config options for each controllers into their own
   Kconfig files. This keeps upper level Kconfig from getting
   too big.
() Options for each controller are moved under their own
   submenus.

Origin: refactored from existing file
Change-Id: I813694f26126b43523b08ebdb0a5383edd241cda
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-17 21:05:12 +00:00
Daniel Leung
68107289bd i2c: restructure kconfig options
() Moves config options for each controllers into their own
   Kconfig files. This keeps upper level Kconfig from getting
   too big.
() Options for each controller are moved under their own
   submenus.
() Adds the missing copyright to Kconfig.atmel_sam3.

Origin: refactored from existing file
Change-Id: I2dacd3d9b2bfa052c9e0c078ddffed40dbc2ddbf
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-17 21:05:12 +00:00
Daniel Leung
1904ecc0b5 gpio: restructure Kconfig options
() Moves config options for each controllers into their own
   Kconfig files. This keeps drivers/gpio/Kconfig from getting
   too big.
() Options for each controller are moved under their own
   submenus.
() Re-named the device names to standard as "GPIO_0", "GPIO_1",
   etc.
() Adds the missing copyright to Kconfig.atmel_sam3.

Origin: refactored from existing file
Change-Id: I7c531b0109ca5a6840d3abd9daa6bc784f15233d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-17 21:05:12 +00:00
Daniel Leung
e369cb85a6 serial: minor kconfig semantic changes
() Adds some comment to divide config options for easier
   visual navigation.
() Put config under submenus to make all driver options
   consistent with each other.

Change-Id: Ia219c5283e4fa394adf8b0ac03577a0fd033ec1c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-17 21:05:11 +00:00
Andrew Boie
5729a67cd6 app_kernel: fix test case scaling
Test didn't work unless the specific board was noted in the Makefile.
This scales horribly. Assume no floating point / sse unless specifically
mentioned.

Change-Id: Id1eaa88cdf971a8843e2418661e6a8dba6a1b91d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-17 19:18:44 +00:00
Johan Hedberg
b84f60cab3 Bluetooth: Move stack analysis helper to a global location
The helper for analyzing (fiber) stack usage is in no way specific to
Bluetooth and will likely be of use to many other places as well. Move
it therefore to include/misc.

Change-Id: Iedb699dbe248aca305e387998d37bb339cfb0e21
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-17 16:29:05 +00:00
Pawel Wodnicki
413a8386e8 doc: Edit gerrit_practices to correct command to install a precommit hook
Added Linux Foundation ID to the example scp command to install a
precommit hook.

Change-Id: I03c6d2e89cb76816db01fa11d826464d33a058d1
Signed-off-by: Pawel Wodnicki <pawel.wodnicki@live.com>
2016-03-17 16:01:52 +00:00
Bogdan Davidoaia
aad3e2a21e sensor: move driver specific options to separate Kconfig files
Move driver specific config options to separate Kconfig sub-files
as this is a more scalable approach when considering that multiple
sensor drivers will be added in the future.

Change-Id: Ia1d62afd628723be33868d6c1a956ca7b27eba88
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-17 15:59:17 +00:00
Bogdan Davidoaia
cde203a395 sensor: add slope threshold and duration attributes
The slope threshold and duration attributes can be used to
configure the any-motion (slope) interrupt for sensors that
support it.

Change-Id: Ib09ef276cfd3dda5c94bce13bcf4c6c5436c1e4c
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-17 15:59:16 +00:00
Jukka Rissanen
580eddbe6a net: 6lowpan: Add more sanity checks in compression code
It is possible that the packet contains some garbage even
after 802.15.4 framer and fragmenter have passed it as a
valid packet. So we do here a final check so that the
memmove() call will have a sane value.

Weird crashes were happening without this sanity check because
uip length was smaller than the packet header length.
So the code tried to call
memmove (d=0xa80088a0 <rx_buffers+1472>,
         s=0xa8008889 <rx_buffers+1449>,
         n=3328002866)
at .../zephyr/net/ip/contiki/sicslowpan/sicslowpan_compression.c:998
and the length became too large and caused the device to crash.

Change-Id: Ibc4f1c211ec2f6d98506b89c6c3f001e20e51ea6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 14:42:02 +00:00
Jukka Rissanen
51e30e64e6 net: 6lowpan: Fix debug prints in compression and fragmentation
Removed PRINTFO() and PRINTFI() macros as those are useless
here. Changed also packet printing macros to use temp
variable from stack instead of using a global variable.

Change-Id: I0fcc04960a5ff997e2390ef0cbc80ee0c3e020c2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 14:42:02 +00:00
Jukka Rissanen
3a8655a34d net: rpl: Print the IPv6 prefix value when checking it
We did not know what IPv6 prefix the stack was using if the
prefix was the same as last time. It is easier to debug
things if the prefix is printed even if it was the same
value as last time.

Change-Id: Ic4bf11df0d8cb588ff0784f044d7702980d8152e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 14:42:02 +00:00
Ravi kumar Veeramally
09ce826789 net: contiki: Improve uip_packetqueue debug statements
Add more debug statements to uip_packetqueue and improve
some of them.

Change-Id: I43040f6ba1051feb9aa311036faee4476c6bc80f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-17 14:40:57 +00:00
Ravi kumar Veeramally
0588b3ceed net: contiki: Enable uip packet queue debugging via Kconfig
User can activate packet queue debugging by setting
CONFIG_NETWORK_IP_STACK_DEBUG_PACKET_QUEUE config option.

Change-Id: I70ea0b48b3c120e085a8b342981fc7a9028d45b1
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-17 14:40:57 +00:00
Anas Nashif
98ff441e53 kconfig: reorg ARM options and make things consistent
Make kconfig look the same for all architectures.

JIRA: ZEP-107
Change-Id: Ia8100194ec333fc07a1dff4f6f90364ce8bef4d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-17 13:00:21 +00:00
Anas Nashif
6b8c6403ec kconfig: move kernel options close together
have micro and nano kernel next to eachother.

JIRA: ZEP-107
Change-Id: I8d6e4354cf6a8cdf1193c641b112a078cd7ec460
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-17 13:00:20 +00:00
Baohong Liu
61064f0c5e samples: A test app for quark Always-on counter and timer
Test application to test quark Always-on counter and timer.

This app requires QMSI lib which is not in the repo yet.
See the instruction in readme.txt.

Origin: Original

Change-Id: If75b2714f9b609abc6f7b51c1c0d99d15152399f
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-03-17 08:59:04 -04:00
Baohong Liu
97c5df695e drivers: Quark AON counter and timer support
Quark AON counter and timer sub-drivers. They are based
on the QMSI drivers.

In order to enable this driver, the following options
must be set.
CONFIG_QMSI_DRIVERS
CONFIG_QMSI_INSTALL_PATH
CONFIG_COUNTER

Origin: Original

Change-Id: Idbeabfaef3408f4d645b0e64a337d7f5f0f357c7
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-03-17 08:59:04 -04:00
Baohong Liu
ea5b4e4943 API: Add public counter API
Add the public API for counter devices and the drivers infrastructure.

Origin: Original

Change-Id: If100fbc9b3d119ce2be6c131bd64dbeb4fe346f2
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-03-17 08:59:04 -04:00
Murtaza Alexandru
33ee2052b1 sensor: add common magnetometer enum values
Add enum values that are common for magnetometer sensors (vectorial
components).

Also add oversampling factor attribute.

Change-Id: Ic193c1ad14af301047e652ac63b4480c1b1154bc
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-03-17 11:35:03 +00:00
Jukka Rissanen
9641a0fed0 net: rpl: Enable timer debugging via Kconfig
User can activate RPL timer debugging by setting
CONFIG_NETWORK_IP_STACK_DEBUG_RPL_TIMERS config option.

Change-Id: I66079640e4135a0f85620cc4eca04612eee1a890
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 07:29:54 +00:00
Jukka Rissanen
d19f08f104 net: rpl: Enable objective function debugging via Kconfig
User can activate RPL OF debugging by setting
CONFIG_NETWORK_IP_STACK_DEBUG_RPL_OF config option.

Change-Id: I9c7b59eb6d782702b5a9159f4915d3f58f732d5c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 07:29:45 +00:00
Jukka Rissanen
079be6caf2 net: rpl: Enable RPL ICMPv6 packet debugging via Kconfig
User can activate ICMPv6 RPL debugging by setting
CONFIG_NETWORK_IP_STACK_DEBUG_RPL_ICMPV6 config option.

Change-Id: I957ec5d32149ede00f87f63de28a4a7f43936c1a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 07:29:34 +00:00
Jukka Rissanen
063f113f83 net: rpl: Fix compile error if ICMPv6 debugging is activated
Change-Id: Id97d1eaaa529b3c79cf2fdbff10148c693e467d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 07:29:16 +00:00
Jukka Rissanen
d5cf9e4edb net: rpl: Enable debugging via Kconfig
User can activate generic RPL debugging by setting
CONFIG_NETWORK_IP_STACK_DEBUG_RPL config option.

Change-Id: I3b044c6308d6f20cb42d21edb59119321aa8bfbb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-17 07:29:16 +00:00
Andre Guedes
4851ee78f1 drivers: Fix documentation from remaining APIs
This patch fixes the remaining APIs documentation which have reference
to DEV_* codes.

Change-Id: I26dd971a4b5e492ce026892f6262b84f7bde6296
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
136d171588 drivers: Replace DEV_NOT_CONFIG by -EPERM
This patch replaces all occurences of the macro DEV_NOT_CONFIG by
-EPERM at the driver level. This patch is part of the effort to
transition from DEV_* codes to errno.h codes.

Change-Id: I3054c8aa76319a58a2eec089b8a72bf301c85391
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
aca7cb1efd drivers: Replace DEV_NO_SUPPORT by -ENODEV
This patch replaces all occurences of the macro DEV_NO_SUPPORT by
-ENODEV at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I03007527367b03e6fd72a85004b7d3b81046a6a6
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes
2a4c5fce00 drivers: Replace DEV_NO_ACCESS by -EACCES
This patch replaces all occurences of the macro DEV_NO_ACCESS by
-EACCES at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: Ic7fd162b45e9ceb73141a164649b96eea9886873
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00