Commit graph

41120 commits

Author SHA1 Message Date
Paul Sokolovsky
3ede9feb97 tests: net: socket: socket_helpers.h: Factor out socket test helpers
The idea is that we should have many, many tests. The only reasonable
way to achieve that is by making tests easy and pleasant to write,
and that requires common, easy to reuse infrastructure.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-25 10:35:39 +02:00
Paul Sokolovsky
0d0ce47c4e tests: net: socket: udp: Refactor and elaborate tests.
1. Consistently use prepare_sock helpers.
2. Test not just client->server sending, but sending reply.
3. Send large packets (>1 net_buf fragment), not just small.
4. Check POSIX behavior on recv()ing datagram incompletely (the rest
should be discarded and next recv() should read next datagram.
5. More cleanroom testing, e.g. explicitly reinitialize input params
on each call (without assumptions that they're left with suitable
values from previous calls), clear input buffers before each read
operations, etc.
6. Reformat code. Previously it was very sparse, giving long test
functions, and thus impression that tests are complicated and hard
to write.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-25 10:35:39 +02:00
Paul Sokolovsky
b8cc02d79c tests: ztest: Add zassert_mem_equal()
Allows to compare 2 memory areas for equality.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-25 10:35:39 +02:00
Robert Lubos
c349bafab3 net: openthread: Do not register RLOC and ALOC addresses
In OpenThread RLOC address and ALOC address are used for internal mesh
routing and should not be used by applications as they can change
dynamically during runtime. Therefore prevent registering them on Zephyr
interface.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-25 10:09:27 +02:00
Kumar Gala
67e098ab3e cmake: dts: Fix building with dtc 1.4.6
dtc 1.4.6 doesn't support the -Wno-unique_unit_address flag.  We need to
check that the flag is supported before using it on pre dtc-1.4.7
versions.

Fixes #12685

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-24 19:13:32 -05:00
David B. Kinder
89db6e3ad3 doc: fix formatting error in security doc
Continuation of a bullet list item wasn't indented properly, causing a
new list to be started (with odd indentation).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-24 18:27:27 -05:00
David B. Kinder
58e52f1aff doc: fix ordered list numbering in board doc
Step numbering went 1,2,3,5

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-24 18:27:15 -05:00
Anas Nashif
abbd9b68d6 coc: move to markdown format
Github detects availability of markdown. RST is not being recognised.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 15:37:15 -05:00
Thea Aldrich
3f96d850a1 doc: add reporting address to CoC
This change adds an email alias for Code of Conduct reports and
identifies the recipients of reports.

Signed-off-by: Thea Aldrich <aldrich.thea@gmail.com>
2019-01-24 14:12:31 -05:00
Thea Aldrich
cd89980c22 doc: add enforcement section
Add enforcement section as requested by tsc.

Signed-off-by: Thea Aldrich <aldrich.thea@gmail.com>
2019-01-24 14:12:31 -05:00
Thea Aldrich
41b9bbccc6 doc: Fixing trailing whitespace.
Remove trailing whitespace from new code of conduct section.

Signed-off-by: Thea Aldrich <aldrich.thea@gmail.com>
2019-01-24 14:12:31 -05:00
Thea Aldrich
3bd2cffe23 doc: addition of a code of conduct
This change adds a Code of Conduct based on
https://www.contributor-covenant.org/. Additional reporting and
enforcement guidelines will be added at a later date.

Signed-off-by: Thea Aldrich <aldrich.thea@gmail.com>
2019-01-24 14:12:31 -05:00
Kumar Gala
d27ec68d0f boards: arm: mimxrt10{20,50,60,64}_evk: Enable BOOT HEADER in Kconfig
If we are setting the code to be in HyperFlash (CONFIG_CODE_HYPERFLASH)
or QSPI (CONFIG_CODE_QSPI) we should enable
CONFIG_NXP_IMX_RT_BOOT_HEADER.

Update mimxrt1064_evk to use select like other boards.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-24 12:21:47 -06:00
Kumar Gala
22f3a58bec boards: arm: mimxrt1064_evk: Always have QSPI flash enabled
There's no reason not to have the QSPI flash available even if we aren't
booting from it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-24 12:21:47 -06:00
Anas Nashif
114a1154ef toolchain: Support multiple versions of the Zephyr SDK
Depending on the installed and enabled SDK, we now load the right
configuration allowing people to migrate gracefully to the new SDK.

The selection is done based on the version of the SDK. Minimal required
SDK is still kept as 0.9.5.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 10:51:14 -06:00
Anas Nashif
55cf16a524 toolchains: move zephyr sdk host tools to toolchain folder
Should be part of other files related to the Zephyr SDK.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 10:51:14 -06:00
Sigvart Hovland
2de8b95153 dts: arm: nordic: Add flash controller alias to nrf9160ns.dtsi
Added missing flash-controller alias to nrf9160ns used by subsystem such
as `mcumgr`.

Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
2019-01-24 09:49:15 -06:00
Erwan Gouriou
14dcd13069 drivers/interrupt_controller: stm32: Complete driver factorization
Complete code factorization in stm32 exti drivers.
Add return value in case line is not implemented.
Except returned error code, refactor has been done iso-feature
compared to previous code. Hence error is reported only when
support was not available on previous series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-24 09:38:38 -06:00
Erwan Gouriou
bd78d0ed37 drivers/interrupt_controller: stm32: Complete driver factorization
Complete code factorization in stm32 exti drivers.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-24 09:38:38 -06:00
Armando Visconti
d972bdaba4 samples: Provide x-nucleo-iks01a2 shield sample
This sample is made to demonstrate use of x-nucleo-ik01a2 shield.
It requires a board with Arduino i2c where it can be plugged on.
The sample has been tested on Nucleo F401RE board.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 09:38:08 -06:00
Armando Visconti
cec0d79546 boards: shields/x_nucleo_iks01a2: Add LSM303AGR sensor support
Add LSM303AGR ecompass (accelerometer + magnetometer) sensor support.

The LSM303AGR accelerometer and LSM303AGR magnetometer are s/w
compatible with respectively LIS2DH and LIS2MDL sensors and can
share same driver with those sensors.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 09:38:08 -06:00
Armando Visconti
797ecde958 sensor/lis2mdl: use kconfig named choice for TRIGGER_MODE
Use Kconfig named choice for TRIGGER_MODE in order to easy
up the trigger mode selection in default configurations
for boards using this sensor driver.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 09:38:08 -06:00
Armando Visconti
3ab122d293 driver: sensor: lps22hb: fix the temp sensor fractional value
Fix the temperature sensor fractional value.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 09:38:08 -06:00
Armando Visconti
fe6e3b330c drivers/i2s_ll_stm32.c: pass proper PLLR param when setting I2S PLL
The PLLR parameter in LL_RCC_PLLI2S_ConfigDomain_I2S() API should
be selected among the following list of (already shifted) values:

  *         @arg @ref LL_RCC_PLLI2SR_DIV_2
  *         @arg @ref LL_RCC_PLLI2SR_DIV_3
  *         @arg @ref LL_RCC_PLLI2SR_DIV_4
  *         @arg @ref LL_RCC_PLLI2SR_DIV_5
  *         @arg @ref LL_RCC_PLLI2SR_DIV_6
  *         @arg @ref LL_RCC_PLLI2SR_DIV_7

This commit fixes PR #12609.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 09:35:53 -06:00
Armando Visconti
faeb227a8f ext: stm32cube: revert 71ba2de7 and 9a893202
Revert 71ba2de7:
ext: stm32cube: stm32f4xx: shift I2SR field in PLLI2SCFGR register
(ST Bug tracker ID: 50086)

Revert 9a893202:
ext: stm32cube: stm32f7xx: shift I2SR field in PLLI2SCFGR register
(ST Bug tracker ID: 50108)

This two commits were introduced to shift the PLLR parameter according
to the PLL register field position. After analysis, it appears that
function is actually correct, and issue was actually in parameters
provided that didn't match the API. (see PR #12609)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 09:35:53 -06:00
Paul Sokolovsky
10442a3f9f tests: socket: select: Basic test for select().
Currently actually just tests fd_set manipulation.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-24 17:14:43 +02:00
Paul Sokolovsky
df95a423b2 samples: echo_async_select: Add select()-based async echo sample
A copy of poll()-based echo_async, converted to use select().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-24 17:14:43 +02:00
Paul Sokolovsky
9c91094ff7 net: sockets: select: Get rid of timeval in favor of zsock_timeval
struct timeval is per POSIX defined in sys/time.h, but that also
allowed to pull sys/select.h (and indeed, it does with native_posix),
which then starts to conflict with out select implementation (if
NET_SOCKETS_POSIX_NAMES is defined, and many samples/tests have it).

So, for now follow the existing route of duplicating all definitions
needed by our code in namespaced manner. Things like struct timeval
usage will need to be revisited later, when we'll want socket
subsystem to work with POSIX subsystem, but that's a separate deep
matter.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-24 17:14:43 +02:00
Paul Sokolovsky
3a0a9944c0 net: sockets: Implement select() call.
It's implemented on top of poll() anyway, and the current
implementation of fd_set uses array of fd's underlyingly, which
leads to O(n) complexity for FD_SET() and friends.

The purpose of select() implementation is to allow to perform
proof-of-concept port of 3rd-party code to Zephyr quickly. For
efficiency, poll() should be used instead.

Fixes: #11333

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-24 17:14:43 +02:00
Kumar Gala
f41a979df5 dts: bindings: smsc,lan9220: Fix warning related to id field
We get the following warning:

	extract_dts_includes.py: WARNING: id field set in
	'SMSC/Microchip LAN9220 Ethernet controller', should be
	removed.

Removed the id: field to fix.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-24 08:38:31 -06:00
Anas Nashif
4fa0f7bc58 doc: move shell API documentation
Move API reference to where the logger is being documented.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Anas Nashif
c6415fe9bf doc: move logger API reference
Move API reference to where the logger is being documented.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Anas Nashif
4bcb294f45 doc: move usermode API documentation
Move API reference to the main documentation section under the kernel.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Anas Nashif
3499312249 doc: kernel: use zephyr_file role
Link to files in git tree on Github.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Anas Nashif
2dc4e270b2 doc: kernel: flatten kernel docs and add API references
Instead of having kernel APIs documentated in a separate page, move the
API references to the object pages and have everything in one place.

Remove the intermediate category page and list all section under the
kernel directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Anas Nashif
29f37f0ddb doc: threads: merge into one document
Merge kernel sections into one single document and remove the
intermediate page grouping objects.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Anas Nashif
30c3cff842 kernel: add cpu_idle functions to a doxy group
Added cpu_idle APIs to a doxygen group, otherwise there were missing
from the project documentation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Anas Nashif
9b148d2691 doc: whitelist CONFIG_NET_MGMT_EVENT in doxygen
When disabled, documentation is not generated correctly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Anas Nashif
eeb3bf2e39 doc: tweak doxygen css and remove top border
The top border on function names and other doxygen items made
documentation very difficult to read. Remove the top border and make the
auto-generated docs readable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Anas Nashif
072c466ff4 doc: add extension for linking github files
When referencing files from the git tree create a link to the file for
easy browsing of header files and other files of interest.

Borrowed from esspresif/esp-idf project and modified for Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-24 09:16:03 -05:00
Dave Marples
75e7bd4e66 nucleo_f429zi: Add JLink support for flash, as per nucleo_f070rb
Signed-off-by: Dave Marples <dave@marples.net>

Added ability to use JLink in addition to OpenOCD for flashing.
2019-01-24 08:15:34 -06:00
Ryan QIAN
ee13fb6bff boards: mimxrt1064_evk: add configurations for XIP
To enable boot header and device configuration data if
CONFIG_INTERNAL_QSPI is defined.

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-01-24 07:59:52 -06:00
Ryan QIAN
41a7aa9e03 ext: hal: rt1064: add support for XIP and DCD
- Add cmake files to enable XIP

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-01-24 07:59:52 -06:00
Ryan QIAN
7a861d5769 boards: arm: Add board support for mimxrt1064_evk
Add board support files for mimxrt1064_evk, the development board for
i.MXRT1064 (CM7) SoC.

- Add pinmux, dts, doc.
- Code can be loaded to SRAM.
- Tested samples: hello_world, philosophers, synchronization,
basic/blinky, and basic/button.

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-01-24 07:59:52 -06:00
Ryan QIAN
74d2974cd3 dts: arm: nxp_rt: add flexspi1
- Add info of flexspi1

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-01-24 07:59:52 -06:00
Ryan QIAN
fe9ea3b26c arch: arm: nxp: imxrt1064: add device support
- Add SoC information for RT1064

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-01-24 07:59:52 -06:00
Ryan QIAN
7c537a7c2d ext: hal: nxp: mcux: Add device files for RT1064
Add mcux 2.4.0 drivers and device header files for mimxrt1064.

Origins: NXP MCUxpresso SDK 2.4.0
URL: mcuxpresso.nxp.com
Maintained-by: External

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-01-24 07:59:52 -06:00
Krzysztof Chruscinski
8cdca11620 logging: Replace custom macros with generic ones from util.h
Some of macros initially created in the logger has been moved
to util.h. This commit replaces custom macros with the one
from util.h

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-24 08:40:01 -05:00
Krzysztof Chruscinski
383f7bec91 tests: misc: Add test suite for util.h with tests for COND_CODE_n
Added test suite to validate COND_CODE_0 and COND_CODE_1 macros.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-24 08:40:01 -05:00
Krzysztof Chruscinski
70b738f984 misc: Extend util.h with conditional code macros
Added macros for conditional code generation based on a flag.
Additionally, added macros for getting first and second argument
from variable list of arguments and getting all arguments except
the first one.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-24 08:40:01 -05:00