Commit graph

41120 commits

Author SHA1 Message Date
Johan Hedberg
f0c98527a4 net: buf: Remove wrong alignment annotation from NET_BUF_SIMPLE()
The code (net_buf_simple_init in particular) expects the data buffer
to immediately follow the net_buf_simple struct, so it's wrong to
request any specific alignment for this buffer. In practice this
doesn't make any difference since the net_buf_simple struct itself is
4-bytes aligned and a multiple of 4 bytes, however the extra
__net_buf_align makes it look like its location in memory doesn't need
to immediately follow the net_buf_simple struct.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-18 17:53:36 -04:00
Carles Cufi
d9f53455e5 doc: extract_content: Allow for absolute paths in deps
The dependencies in the scripts are figures, images, includes or literal
includes. Typically those dependencies are placed relative to the .rst
file that is being copied, but in some instances you might want them to
refer to an absolute path which, in fact, is relative to Sphinx's
top-level source directory. In this case, and as long as the top-level
source directory is provided, do not emit a warning.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-18 17:52:49 -04:00
Marcin Szymczyk
ad17e41be6 ztest: make priority of testing thread configurable
CONFIG_ZTEST_THREAD_PRIORITY can be now used to modify
the ztest thread priority.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-04-18 17:52:14 -04:00
Sigvart Hovland
3ffdcf4fca cmake: boilerplate: Fix ZEPHYR_BASE variable for windows
In windows an additional / is added when using zephyr-env.cmd
this causes a build error in some scenarios. It also creates
ugly file paths.

Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
2019-04-18 17:51:47 -04:00
Krzysztof Chruscinski
d2291c4b12 drivers: clock_control: nrf: add SYNTH LFCLK clock source
Added option to have LFCLK synthesized from HFCLK. It is not low
power but ensures constant relation between HFCLK and LFCLK and
might be useful in certain scenarios (e.g. testing).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-04-18 17:50:53 -04:00
Luiz Augusto von Dentz
69b08e6efc Bluetooth: GATT: Update read/write callback documentation
Update read and write callback documentation regarding local access of
the attribute contents.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Luiz Augusto von Dentz
2ba6146f66 Bluetooth: Shell: Add GATT command set
This introduces set command to GATT which can be used to write local
attributes:

uart:~$ gatt set 0x000b 62 6c 61 68
attr 0x004235a8 uuid 2a00 perm 0x09
00000000: 62 6C 61 68

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Luiz Augusto von Dentz
4c80bb57aa Bluetooth: Shell: Add GATT command get
This introduces get command to GATT which can be used to read the
local attributes:

uart:~$ gatt get 0x000b
attr 0x004235a8 uuid 2a00 perm 0x09
00000000: 74 65 73 74 20 73 68 65 6C 6C

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Luiz Augusto von Dentz
090f95d2ba Bluetooth: Shell: Add option UUID parameter to GATT show-db
This enables locating specific attribute in the database:

uart:~$ gatt show-db 0x2a00
attr 0x004235a8 handle 0x000b uuid 2a00 perm 0x09

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Luiz Augusto von Dentz
26fea23435 Bluetooth: shell: Make show-db print the total number of attributes
In addition to just print each attribute this also include the total
number of attribute and how much the database consumes:

uart:~$ gatt show-db
attr 0x00423460 handle 0x0001 uuid 2800 perm 0x01
attr 0x00423474 handle 0x0002 uuid 2803 perm 0x01
attr 0x00423488 handle 0x0003 uuid 2a05 perm 0x00
attr 0x0042349c handle 0x0004 uuid 2902 perm 0x03
attr 0x004234b0 handle 0x0005 uuid 2803 perm 0x01
attr 0x004234c4 handle 0x0006 uuid 2b29 perm 0x03
attr 0x004234d8 handle 0x0007 uuid 2803 perm 0x01
attr 0x004234ec handle 0x0008 uuid 2b2a perm 0x01
attr 0x00423580 handle 0x0009 uuid 2800 perm 0x01
attr 0x00423594 handle 0x000a uuid 2803 perm 0x01
attr 0x004235a8 handle 0x000b uuid 2a00 perm 0x09
attr 0x004235bc handle 0x000c uuid 2803 perm 0x01
attr 0x004235d0 handle 0x000d uuid 2a01 perm 0x01
attr 0x004235e4 handle 0x000e uuid 2803 perm 0x01
attr 0x004235f8 handle 0x000f uuid 2aa6 perm 0x01
attr 0x0042360c handle 0x0010 uuid 2803 perm 0x01
attr 0x00423620 handle 0x0011 uuid 2a04 perm 0x01
=================================================
Total: 2 services 17 attributes (476 bytes)

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Luiz Augusto von Dentz
09c06a1232 Bluetooth: Shell: Convert users of hexdump to shell_hexdump
This replaces the use of hexdump with shell_hexdump and removes the
former.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Luiz Augusto von Dentz
65e350e6af Shell: Introduce shell_hexdump
This introduces shell_hexdump API which can be used to print an array
such as a network buffer.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-18 17:50:16 -04:00
Marc Herbert
3ad96bfc91 extensions.cmake: add two cc/compile_options callgraph comments
This would have saved me about an hour exploring the code and piecing it
together.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-04-18 17:47:58 -04:00
Ioannis Glaropoulos
bd7f4fc613 boards: arduino due: default to building with MPU support
Builds for Arduino Due shall have MPU support by default.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-18 17:43:26 -04:00
Ioannis Glaropoulos
bb35bb8ad5 soc: arm: sam3x: minor fixes in soc.h and arm_mpu_regions.c
Force soc.h to include the headers generated automatically
by DTS. In addition, force arm_mpu_regions.c to include
misc/slist.h for ARRAY_SIZE() macro. arm_mpu_regions.c
does not need to include soc.h (it is included indirectly
via arm_mpu.h)

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-18 17:43:26 -04:00
Ioannis Glaropoulos
cebc26274f CODEOWNERS: add code-owner for Arduino Due
Assigning code-owner for Arduino Due board.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-18 17:43:26 -04:00
Andrew Boie
09dc929d41 userspace: fix copy from user locking
We don't actually need spinlocks here.

For user_copy(), we are checking that the pointer/size passed in
from user mode represents an area that the thread can read or
write to. Then we do a memcpy into the kernel-side buffer,
which is used from then on. It's OK if another thread scribbles
on the buffer contents during the copy, as we have not yet
begun any examination of its contents yet.

For the z_user_string*_copy() functions, it's also possible
that another thread could scribble on the string contents,
but we do no analysis of the string other than to establish
a length. We just need to ensure that when these functions
exit, the copied string is NULL terminated.

For SMP, the spinlocks are removed as they will not prevent a
thread running on another CPU from changing the buffer/string
contents, we just need to safely deal with that possibility.

For UP, the locks do prevent another thread from stepping
in, but it's better to just safely deal with it rather than
affect the interrupt latency of the system.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-18 17:13:08 -04:00
Ryan QIAN
4097a5bf63 boards: arm: add board support for mimxrt1015_evk
Add board support files for mimxrt1015_evk, the development board for
i.mxrt1015 (CM7) SoC.

- Add pinmux, dts, and doc.
- Tested samples: hello_world, philosophers, synchronization,
basic/blinky, basic/button.

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-04-18 16:11:34 -05:00
Ryan QIAN
6e277cff20 drivers: serial: add config for uart 4
- Add config for uart 4

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-04-18 16:11:34 -05:00
Ryan QIAN
f44514d1e4 arch: arm: nxp: imxrt1015: add device support
- Add SoC information for RT1015

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-04-18 16:11:34 -05:00
Ryan QIAN
55a63cadc1 ext: hal: nxp: mcux: add device files for RT1015
Add mcux 2.5.0 drivers and device header files for mimxrt1015. Update
several drivers that were already imported for other SoCs but also apply
to mimxrt1015.

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

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-04-18 16:11:34 -05:00
Henrik Brix Andersen
8a4dbb5b03 drivers: i2c: rv32m1: add I2C driver for the RV32M1 RI5CY SoC
Add driver and device tree binding for the Low Power Inter-Integrated
Circuit (LPI2C) controllers found in the RV32M1 RI5CY SoC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-04-18 16:04:23 -05:00
Henrik Brix Andersen
a061443940 interrupt_controller: rv32m1: fix intmux driver initialization priority
Use the RV32M1 SoC intmux driver initialization priority set by
Kconfig. Change the default to match the default value of 40 used
before.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-04-18 14:00:18 -07:00
Marti Bolivar
1e6f4bd1f6 doc: guides: add "Asking for Help" guide
I often wish I had a short and Zephyr-specific place to point people
to when they're asking for help in ways that make it hard to help
them.

Add one.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-04-18 16:46:37 -04:00
Marti Bolivar
8b147cd1b9 README.rst: shorten it
This is a bit wordy. Let's let the bold text and links stand on their
own; anybody looking at a README on GitHub or in technical
documentation probably knows what these things mean.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-04-18 16:46:37 -04:00
Yannis Damigos
95a5f90ce7 tests: can: api: Fix "Device not not found" error message
Fix "Device not not found" error message.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-04-18 16:28:09 -04:00
Flavio Ceolin
4f99a38b06 arch: all: Remove not used struct _caller_saved
The struct _caller_saved is not used. Most architectures put
automatically the registers onto stack, in others architectures the
exception code does it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-04-18 12:24:56 -07:00
Flavio Ceolin
d61c679d43 arch: all: Remove legacy code
The struct _kernel_ach exists only because ARC' s port needed it, in
all other ports this was defined as an empty struct. Turns out that
this struct is not required even for ARC anymore, this is a legacy
code from nanokernel time.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-04-18 12:24:56 -07:00
Karl Zhang
13dfeba5bd arm: V2M Musca B1: Add Musca B1 SoC and board support
Musca B1 is a Cortex-M33 based SoC.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2019-04-18 13:25:50 -05:00
Jan Sturm
6e7f99a985 boards: stm32f4_disco: added missing LED aliases
added three missing LEDS for stm32f4_disco, in order to run the
samples/basic/disco application on the stm32f4_disco

Signed-off-by: Jan Sturm <jansturm92@googlemail.com>
2019-04-18 13:25:17 -05:00
Patrik Flykt
83de530d5a scripts/coccinelle: Add script for counting identifier length
Add a simple Coccinelle script that counts identifier lengths and
prints out a warning if it is longer than 31 characters.

The script can be run with:
spatch -D report --very-quiet \
--include-headers --recursive-includes \
--cocci-file $ZEPHYR_BASE/scripts/coccinelle/identifier_length.cocci \
--dir $ZEPHYR_BASE \
kernel/

Where '--include-headers' and '--recursive-includes' can be omitted
if neede.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-18 12:29:07 -04:00
Daniel Leung
3fa90938fe tests/kernel/schedule_api: also test without time slicing
This extends the schedule_api test to cover situations when
time slicing is disabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-04-18 12:26:52 -04:00
Alberto Escolar Piedras
149cc7fda1 native_posix: cmdline: Hint user about wrong options
Be a bit more friendly to users, by providing some hints
about possible reasons why a command line option was not
understood.
Also describe in the help message that which options are
avaliable depends on what has been selected in this build.

Fixes: #15046

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-04-18 12:26:28 -04:00
William Fish
cc15b9ced3 soc: nordic_nrf: MPU temperature sensor default
Consistency: nrf51 & 52 SOC set temp sensor as default if SENSOR=y

Signed-off-by: William Fish <william.fish@manulytica.com>
2019-04-18 12:25:51 -04:00
Thomas Ebert Hansen
7f2f1d3c7a tests: crypto: Update HMAC_PRNG test
Use the improved HMAC_PRNG test from TinyCrypt version 0.2.8,
(commit 6e0eb53fc8403988f97345e94081b0453f47231d),
that was imported into Zephyr in
commit 06d0b6a694.

Rewrote part of the test code to use the ztest asserts and
test_utils.h functionality.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2019-04-18 12:24:52 -04:00
Aaron Tsui
18b51587b3 doc: sample: mpu Update documentation
Update documentation to new shell commands.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-04-18 12:24:16 -04:00
Maureen Helm
ab712b2d67 mimxrt1060_evk: mimxrt1064_evk: Enable pyocd runner
Enables the pyocd runner on mimxrt1060_evk and mimxrt1064_evk boards
using the generic cortex_m target. Note that this target is not capable
of programming flash, therefore can only load an application to internal
SRAM (set CONFIG_CODE_ITCM=y and CONFIG_DATA_DTCM=y) or attach to an
application already programmed to flash by other means (e.g., DAPLink
drag-and-drop).

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-04-18 12:23:34 -04:00
Andrzej Puzdrowski
a819d1628b dfu/boot: Replace flash partitioning terminology
Changed image terminology to the same which is used by
mcuboot after https://github.com/JuulLabs-OSS/mcuboot/pull/440

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-18 12:22:48 -04:00
Andrzej Puzdrowski
945f9c7d54 dfu/boot: non-secure app support
In non-secure Trustzone application dedicated flash non-secure
partition are used instead of regular one, which become secure
partition in Trustzone collaboration model.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-18 12:22:48 -04:00
Andy Ross
aa2b8a1bc7 scripts/sanitycheck: Precompile test-time regular expressions
The Harness handlers for tests were parsing the realtime stream out of
qemu pipes by recompiling and executing every regex for every line (!)
of output from the simulator.  That's a significant CPU load, and it's
(1) in a separate thread not tracked by the JOBS limit and (2)
happening at the worst possible time and contending with the qemu
process for host CPU cycles that it needs to hit its (real world)
timer targets on time.

Compile them just once, please.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-04-18 12:21:13 -04:00
Ulf Magnusson
7fdb525754 kconfig: Use 'default' instead of 'def_bool' in Kconfig.defconfig files
Same deal as in commit 4638652214 ("Kconfig: Use 'default' instead of
'def_bool' in Kconfig.defconfig files"), fixing new stuff that got
introduced since then.

Some symbols, like ALTERA_AVALON_PIO, are only defined in
Kconfig.defconfig files, and so need the def_bool.

Motivation (from the note at the end of
guides/kconfig/index.html#common-shorthands):

For a symbol defined in multiple locations (e.g., in a Kconfig.defconfig
file in Zephyr), it is best to only give the symbol type for the "base"
definition of the symbol, and to use 'default' (instead of 'def_<type>'
value) for the remaining definitions. That way, if the base definition
of the symbol is removed, the symbol ends up without a type, which
generates a warning that points to the other definitions. That makes the
extra definitions easier to discover and remove.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-04-18 12:20:49 -04:00
Andrei Emeltchenko
f6784ed1d7 usb: usb_dc_stm32: Add missing function
Add missing API functions which will be tested with harness tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
f350c275e1 tests: usb: Add write() and set_callback() tests
Add more tests for invalid EP testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
8cf9bf032b tests: usb: Add usb_read() for invalid endpoint
Check that reading invalid endpoint does not succeed.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
1178042cf4 tests: usb: Add more USB DC tests and refactor names
Add more tests covering almost all DC API with invalid parameters.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
cf349df34d usb: usb_dc_kinetis: Fix using invalid index
I does make sense to use index only after we make sure it is valid,
issue is found in harness tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
cc9c91513f usb: usb_dc_kinetis: Verify endpoint is valid
Verify endpoint before usb_dc_ep_set_callback().

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
53ab1e2414 usb: usb_dc_native_posix: Check endpoint is valid
Fix harness tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
582b44014c usb: usb_dc_dw: Check endpoint is valid
Fix harness test issues.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
81fbf0f4b5 usb: usb_dc_native_posix: Fix valid endpoints check
Fix check for valid endpoints; issue is found in harness testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00