Commit graph

41120 commits

Author SHA1 Message Date
Alberto Escolar Piedras
4ebf2afeb3 native_posix: doc: Remove legacy shell links
Remove the links to the now non-existant legacy shell documentation
and clarify a bit paragraphs (as the legacy shell is not default
anymore)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-10-02 14:04:22 -07:00
Alberto Escolar Piedras
24abcf8094 native: doc: Improve UART documentation
Some minor improvements in the UART documentation.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-10-02 14:04:22 -07:00
Alberto Escolar Piedras
7aabc36d42 native_posix: doc: reorder peripherals section
The peripherals sections grew by adding new peripherals
at the end. Reorder them so they follow a more reasonable
order.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-10-02 14:04:22 -07:00
Alberto Escolar Piedras
bdd20467e2 native_posix: doc: do not list command line options in doc
Now, there is quite many more command line options for the
native_posix executable. But, which are available, depends
on the configuration. Therefore let's not list them in the doc,
but instead tell people to use the --help option.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-10-02 14:04:22 -07:00
Himanshu Jha
ab35ebe17d coccinelle: Add script to enforce ARRAY_SIZE macro usage
This script detects cases where ARRAY_SIZE can be used such as
where there is a division of sizeof the array by the sizeof its first
element or by any indexed element or the element type. It replaces the
division of the two sizeofs by ARRAY_SIZE helper macro.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-10-02 14:03:39 -07:00
Himanshu Jha
46b4c51674 doc: application: Add documentation for Coccinelle tool
Add a detailed documentation for the Coccinelle tool.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-10-02 14:03:39 -07:00
Himanshu Jha
dce9141fb1 Coccinelle: Add support for Coccinelle infrastructure
'coccicheck' target is used to initiate Coccinelle checker. It
can be called via four different modes that generate different
output corresponding the mode.

The four modes are:

* 'patch' proposes a fix, when possible.
* 'report' generates a list in the following format:
	file:line:column-column: message
* 'context' highlights lines of interest and their context in
   a diff-like style. Lines of interest are indicated with '-'.
* 'org' generates a report in the Org mode format of Emacs.

The 'coccicheck' front-end can be called with suitable arguments:

* --mode=<mode>: specify the mode for processsing.
* --cocci=<path/to/foo.cocci>: specify the SmPL file to use.
* --verbose=<1>: enable verbose output.

Run `./scripts/coccicheck --help` for more detailed info
on various options available.

With the above arguments the coccinelle transformation engine
runs on the entire/part of the source code tree depending on
various options supplied to the coccicheck sanity checker.

More detailed documentation can be found at:
doc/application/coccinelle.rst

Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-10-02 14:03:39 -07:00
Jakub Rzeszutko
794bda73dc doc: shell: update documentation to reflect bug fix #10207
Shell macro SHELL_DEFINE no longer needs new line character.
Specification has been updated accordingly.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 11:55:47 -07:00
Jakub Rzeszutko
c471614cb6 subsys: shell: fix accept either CR or LF as as line delimiter
1. Shell will accept CR or LF as line delimiter.
2. Macro SHELL_DEFINE simplified - it no longer requires
   new line character.
3. Fixes: #10207.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 11:55:47 -07:00
Paul Sokolovsky
ccb2ef9250 tests: posix: Enable CONFIG_POSIX_API
As a master switch to access POSIX APIs.

Also, remove dependency on pthreads for tests which don't require it.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Paul Sokolovsky
0fd8a47a19 include: posix: mqueue: Rely on O_RDWR and friends defines in sys/stat.h
Don't duplicate definitions.

This fixes build errors due to redifinitions of preprocessor symbols.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Paul Sokolovsky
7e9263098a lib: posix: Build pthreads files depending on CONFIG_PTHREAD_IPC
If application didn't request pthreads support, don't build related
files.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Paul Sokolovsky
0fac0cd94a lib: posix: fs: Don't depend on pthreads
File system access isn't related to pthreads.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Paul Sokolovsky
d77c96b473 lib: posix: pthread_common: Don't depend on pthreads
Contrary to its name, doesn't depend on pthreads.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Paul Sokolovsky
767f58a2ee include: posix: signal: Make sigev_notify_attributes depend on pthreads
If pthreads support is not enabled, don't provide pthread-specific
bits of signal semantics, just plain old signal features.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Paul Sokolovsky
e8f570ff9a include: posix: stat: Don't depend on CONFIG_PTHREAD_IPC
Not related to pthreads. Don't depends on CONFIG_POSIX_FS either,
as stats defines may apply to special files (devices, etc.) too.
Instead, depend on CONFIG_POSIX_API.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Paul Sokolovsky
8dc69e09da lib: posix: Add top-level define for all POSIX APIs - CONFIG_POSIX_API
It so happened that previously CONFIG_PTHREAD_IPC served this role.
But pthreads and IPC is only parts of POSIX, orthogonal to other
services.

Move CONFIG_POSIX_FS, etc. out from CONFIG_PTHREAD_IPC.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Paul Sokolovsky
c152ebd634 include: posix: Split dirent.h from unistd.h
From POSIX
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html

"""
The <dirent.h> header shall define the following type:
DIR

...

also define the structure dirent
"""

etc.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Paul Sokolovsky
260fbc4249 include: posix: types: Move some defs out of #ifdef CONFIG_PTHREAD_IPC
useconds_t, clockid_t, timer_t are not related to pthreads.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-02 10:51:52 -07:00
Kumar Gala
109b61dd21 gpio: Remove deprecated macros
GPIO_PIN_ENABLE & GPIO_PIN_DISABLE have been deprecated for some time,
lets remove them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-02 12:50:56 -05:00
Maureen Helm
98d765a3b4 drivers: sensor: Remove Kconfigs conditioned upon !HAS_DTS_GPIO
Make device tree required for these sensor drivers.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-02 10:50:18 -07:00
Maureen Helm
bd6facbc14 drivers: sensor: Remove Kconfigs conditioned upon !HAS_DTS_SPI
Make device tree required for these sensor drivers.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-02 10:50:18 -07:00
Maureen Helm
2b72283bda drivers: sensor: Remove Kconfigs conditioned upon !HAS_DTS_I2C
Make device tree required for these sensor drivers.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-02 10:50:18 -07:00
Ioannis Glaropoulos
d1757d8d1b arch: arm: improve documentation for ARMv8-M fixed region setup
Improve the documentation of the ARMv8-M MPU convenience macros
for setting up MPU regions at boot time, stressing that the
macros intend to be used for non-overlapping, fixed MPU regions.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-10-02 12:12:08 -05:00
Ioannis Glaropoulos
b41934fa21 arch: arm: mpu: improve documentation of mpu_config
This commit enhances the documentation of the mpu_config
element in include/arch/arm/cortex_m/mpu/arm_mpu.h, stressing
that it intends to store information for fixed MPU regions.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-10-02 12:12:08 -05:00
Ioannis Glaropoulos
9a06e9a0d0 arch: arm: remove obsolete inline comment
Remove an inline explanatory comment for the thread
stack region type that is obsolete. The comment had
been been erroneously kept in after the enumeration
of MPU region types was refactored and cleaned up.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-10-02 12:12:08 -05:00
Aurelien Jarno
872719e9a6 scripts/dts/extract/flash.py: fix load offset
When the code partition is not at the beginning of the flash, the load
offset is wrongly computed. The address in the device tree is already
relative to the beginning of the parent node, ie the beginning of the
flash memory space. There is therefore no need to subtract it.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-10-02 10:00:04 -07:00
Carles Cufi
d8e228c97c doc: getting started: Document pdf build on Windows
Add a section to optionally install the Chocolatey packages required to
build the documentation in .pdf format on Windows.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-02 18:48:26 +02:00
Carles Cufi
0698dba8e8 doc: cmake: Enable PDF build on Windows
In order to make PDF generation work on Windows, search for a generic
Latex package and use full quotes for the latexmk environment variable.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-02 18:48:26 +02:00
Carles Cufi
990ab2de70 Bluetooth: shell: Transition flash.c to the new shell
Convert the flash.c functions to the new shell format.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-02 18:41:11 +02:00
Carles Cufi
63f4d9f509 Bluetooth: shell: Transition ticker.c to the new shell
Convert the ticker.c functions to the new shell format.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-02 18:41:11 +02:00
Carles Cufi
5372950336 Bluetooth: shell: Transition ll.c to the new shell
Convert the ll.c functions to the new shell format.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-02 18:41:11 +02:00
David Leach
96e877a52e samples: buttons: Add GPIO_INT_EDGE to button configuration
Add GPIO_INT_EDGE triggering for the button push for boards where
the dts generates a SW0_GPIO_FLAGS.

Signed-off-by: David Leach <david.leach@nxp.com>
2018-10-02 11:27:30 -05:00
Sebastian Bøe
fdae117b45 boards: dts: Fix dtc warning in board dts files
This patch is equivalent to 7b0ce85242,
but applied to more boards. As stated in the previous commit message:

This change aims at fixing 'unit_address_vs_reg' warning in arm based
boards. This warning pops up when a node name is made up with an
address (node_name@xx) but does not contain a reg property. This case
was encountered for led nodes for instance, where a reg property has
no meaning.  Fix this by changing node_name@xx to node_name_xx which
removes the guilty '@XX' syntax but preserves node_name uniqueness.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-02 11:03:30 -05:00
David Leach
dc2acd6b94 scripts: extract: globals.py: Fix node name parsing
The node name parsing for the _LABEL #define does not parse the unique
node portion in the same fashion between @<unit_address> and _<number>.
This change normalizes the two modes.

Signed-off-by: David Leach <david.leach@nxp.com>
2018-10-02 09:45:39 -05:00
Jakub Rzeszutko
61ca8c17c8 subsys: shell: add handlers diagnostic function
Added function: shell_execute_cmd that can be called
for command diagnostic purposes.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 14:44:25 +02:00
Jakub Rzeszutko
99f64c1e47 doc: subsystems: shell: update documentation
Shell handler can now return an int value. This change has
been reflected in shell.rst.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 14:44:25 +02:00
Jakub Rzeszutko
0eea1ef212 subsys: shell: add int ret_val to command handlers
1. Command handler can return command exectution status as int.
2. Existing command handlers rework.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 14:44:25 +02:00
Jakub Rzeszutko
0ce966bc28 subsys: shell: manual * parsing
This PR fixes: #10195.
Function _vprintk when used cannot parse '*' what
a as result causes dereferencing bad pointer.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 11:23:37 +02:00
Joakim Andre Tønnesen
d6e0fdca8c net: sockets: Add getaddrinfo and freeaddrinfo to socket offloading
Adds getaddrinfo and freeaddrinfo to the offloaded API.

Signed-off-by: Joakim Andre Tønnesen <joakim.tonnesen@nordicsemi.no>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-10-02 11:11:15 +03:00
Maureen Helm
ad32e3b543 drivers: boards: Merge HAS_DTS_SPI_PINS with HAS_DTS_SPI
Every board that uses dts-enabled spi drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_SPI_PINS and
HAS_DTS_SPI.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
eeb4411de7 drivers: boards: Merge HAS_DTS_GPIO_DEVICE with HAS_DTS_GPIO
Every board that uses dts-enabled gpio drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_GPIO_DEVICE and
HAS_DTS_GPIO.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
89ccead382 drivers: boards: Merge HAS_DTS_SPI_DEVICE with HAS_DTS_SPI
Every board that uses dts-enabled spi drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_SPI_DEVICE and
HAS_DTS_SPI.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
75bc6ba454 drivers: boards: Merge HAS_DTS_I2C_DEVICE with HAS_DTS_I2C
Every board that uses dts-enabled i2c drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_I2C_DEVICE and
HAS_DTS_I2C.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
9dea0315f7 samples: arduino_101: Add dts overlay and fixup to env sensing sample
Adds a board-specific dts overlay and fixup file to the arduino_101
environmental sensing sample, in preparation for making the sensor
drivers require dts.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Kumar Gala
619049a74c boards: nrf51_ble400: Convert to using dts for led/button
Move the led & button info from board.h into dts file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-01 21:09:58 -05:00
Krzysztof Chruscinski
d0776bcc02 tests: logging: add log_strdup test to log_core test
Extended log_core test suite to test string duplication.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-01 15:26:14 -04:00
Krzysztof Chruscinski
a15438e8f5 logging: add mechanism for handling transient strings
Extending logger to support logging transient strings (with %s).
With dedicated call (log_strdup), string is duplicated to a buffer
from internal logger pool. Logger implicitly manages the pool.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-01 15:26:14 -04:00
Armando Visconti
6cb20ab4c1 boards: 96b_argonkey: Kconfig.board: Fix ArgonKey board building
Argonkey board building has been recently broken by a LSM6DSL sensor
driver fix (see commit: a013ce3bf0).

The board configuration file must now enable HAS_DTS_GPIO_DEVICE macro
instead of HAS_DTS_SPI_DEVICE.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-10-01 10:36:46 -05:00
Sebastian Bøe
d6de4c7a99 cmake: Fall back to ZEPHYR_BASE when the board is not in BOARD_ROOT
It is very inconvenient to maintain an application that both runs on a
Zephyr board and an out-of-tree board.

It forces one to write build scripts like this in the app:

if(BOARD STREQUAL my_out_of_tree_board)
  set(BOARD_ROOT some/out/of/tree/board/path)
endif()

To avoid this we change the semantics of BOARD_ROOT. Instead of it
being a path to the board root it is now a prioritized list of board
root directories. Zephyr will append ZEPHYR_BASE to BOARD_ROOT.

This ensures that Zephyr boards can be used when the out-of-tree board
directory can not supply the requested board.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-01 09:46:46 -04:00