Commit graph

41120 commits

Author SHA1 Message Date
Jakub Rzeszutko
f8178dcb05 shell: remove Console dependencies
Removed Console dependencies from shell uart backend.
Generated define: CONFIG_UART_SHELL_ON_DEV_NAME for each board.

Fixes #10191

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-07 12:11:11 +01:00
Vincent van der Locht
58463b7ea7 net: dhcpv4: dhcp start/stop made compatible for multiple interfaces
The net_dhcpv4_stop() function stops the event listener for any IF_UP
events previously. In case multiple interfaces are used and optionally
being switched over, it could result in disabling dhcp unintentionally.

The callback is initialized at the init function and added/removed in
the start/stop function based on the interface list being empty
or not. (first added, last removed)

The event handler checks if the interface is in the list before acting
on it.

Signed-off-by: Vincent van der Locht <vincent@vlotech.nl>
2018-12-07 12:23:46 +02:00
Vincent van der Locht
994a4772ca net: dhcpv4: net_dhcpv4_stop() removing address during renew
In case "net_dhcpv4_stop(..) is called when the interface is
in NET_DHCPV4_RENEWING state, the address is not removed.
When deleting the address in the NET_DHCPV4_RENEWING state
means the status is always equal to the moment before _start
is called.

Signed-off-by: Vincent van der Locht <vincent@vlotech.nl>
2018-12-07 12:22:19 +02:00
Jukka Rissanen
d551f6c5ff tests: net: context: Disable assertion for net_context tests
The unit test gives net_context_get() an invalid protocol family
value which triggers an assert in net_context.c:160
This assert fails the test when it should not as we properly
check the return value. Fix this by disabling asserts for this
test.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
0869a86760 tests: net: tcp: Fix interface initialization
The network interface mac address was not initialized properly
which caused assert in net_if.c:2881 to fail.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
a26a6ae6a7 net: core: Change NET_ASSERT*() to use zephyr standard assert
Avoid dependency to logging subsystem in NET_ASSERT*(), so
use standard Zephyr asserts instead.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
301d342571 net: Move net_analyze_stack() function to net_core.c
No need to this function be inlined so move it to .c file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
cd4eb946c4 samples: net: Convert to use generic logging macros
Use generic logging macros LOG_*() instead of NET_*() as the
latter are mostly meant for internal networking stack use.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
86689030e8 net: Clarify logging in networking code
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.

Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.

Fixes #11343
Fixes #11659

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Linden Krouse
7ab2827035 shell: Piped output of cd to /dev/null when setting ZEPHYR_BASE.
Solves an issue where any output from the user's shell's cd command
would be prepended to ZEPHYR_BASE when sourcing zephyr_env.sh.
Fixes #11894.

Signed-off-by: Linden Krouse <ztaticnull@gmail.com>
2018-12-06 19:14:50 -05:00
Andrew Boie
ab82ef4ca5 x86: always build the page fault handler
Previously, this was only built if CONFIG_EXCEPTION_DEBUG
was enabled, but CONFIG_USERSPACE needs it too for validating
strings sent in from user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-12-06 12:44:23 -08:00
Andrew Boie
d4363e4185 x86: print helpful message on FPU exception
A few people have tripped over this recently.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-12-06 12:44:23 -08:00
Carles Cufi
15fbf707ca doc: revert to copy files with extract_content.py directly
Adding ninja targets based on the files that are to be copied into the
build folder doesn't seem to speed up the build, so simplify the CMake
script by relying on extract_content.py to do the copy.

Numbers on my machine:

* master
  clean: 6m45.541s, 6m8.113s
  incremental: 1m24.233s, 1m32.720s

* revert
  clean: 6m25.221s, 6m19.751s
  incremental:1m20.893s, 1m20.337s

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-12-06 14:27:29 -05:00
Anas Nashif
c562e4247d ci: remove bsim result options
This option is not being used anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 14:24:41 -05:00
Anas Nashif
c3e98056ea ci: set second pass options correctly
Use correct 3rd pass env variable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 14:24:41 -05:00
Robert Lubos
3651e03eeb samples: sockets: Add overlay configs to socket echo samples
Add Bluetooth, 802.15.4 and OpenThread overlay configurations to socket
echo_client and echo_server samples.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Robert Lubos
fff401d693 samples: net: echo_server config cleanup
* Add generic 802.15.4 overlay config,
* Move OT generic configs into overlay-ot.conf,
* Remove nrf52840_pca10056 board configuration,
* Remove overlay-reel_board-15_4.conf - generic overlay can be used
instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Robert Lubos
34b19acc9f samples: net: echo_client config cleanup
* Add generic 802.15.4 overlay config,
* Move OT generic configs into overlay-ot.conf,
* Remove nrf52840_pca10056 board configuration.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Spoorthi K
34c4d0e3dd samples: cmsis_rtos_v1: Demo on msgq and timers
Sample to demonstrate usage of message queue, threads
and timers with CMSIS RTOS V1 APIs.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-12-06 12:19:23 -05:00
Spoorthi K
940ee4e7e5 samples: cmsis_rtos_v1: Demo with Dining philosopher's problem
Sample application to demonstrate usage of cmsis_rtos_v1 APIs
with dining philosopher's problem implementation.

This covers semaphores, mutex and thread APIs of CMSIS RTOS V1.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-12-06 12:19:23 -05:00
Anas Nashif
64aecd044f Revert "subsys/fb/cfb: Introduce cfb_framebuffer_invert function"
This reverts commit b6528469df.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 11:39:44 -05:00
Anas Nashif
f8625ced84 Revert "subsys/fb/cfb: Introduce cfb_get_numof_fonts function"
This reverts commit c2c293a3e0.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 11:39:44 -05:00
Anas Nashif
4e2c9d1491 Revert "shell: Add initial code for Character Framebuffer shell module"
This reverts commit 2e27113eec.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 11:39:44 -05:00
Anas Nashif
40eb3a5869 Revert "samples/display: Introduce the cfb_shell sample app"
This reverts commit 48f493208b.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 11:39:44 -05:00
Diego Sueiro
48f493208b samples/display: Introduce the cfb_shell sample app
This adds the shell sample app for the Character Framebuffer testing.

cfb - Character Framebuffer shell commands
Options:
  -h, --help  :Show command help.
Subcommands:
  init        :[none]
  get_device  :[none]
  get_param   :<all, height, width, ppt, rows, cols>
  get_fonts   :[none]
  set_font    :<idx>
  invert      :[none]
  print       :<col: pos> <row: pos> <text>
  scroll      :<dir: (vertical|horizontal)> <col: pos> <row: pos> <text>
  clear       :[none]

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-12-06 09:55:15 -05:00
Diego Sueiro
2e27113eec shell: Add initial code for Character Framebuffer shell module
This adds the config option and files of the Character Framebuffer
shell module

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-12-06 09:55:15 -05:00
Diego Sueiro
c2c293a3e0 subsys/fb/cfb: Introduce cfb_get_numof_fonts function
Adds the cfb_get_numof_fonts function to get the number of
available fonts

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-12-06 09:55:15 -05:00
Diego Sueiro
b6528469df subsys/fb/cfb: Introduce cfb_framebuffer_invert function
Adds the cfb_framebuffer_invert function to invert Pixels in the
Character Framebuffer

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-12-06 09:55:15 -05:00
Alberto Escolar Piedras
7593be7a3f tests: bsim_bt tests: Fix malformed JUNIT results file
Fix the following issues regarding the JUNIT results file
format (xml):

The logger produces illegal xml characters in the text output
=> Ensure that any non-valid xml character is replaced with
the valid xml scapes

When GNU parallel is installed and a testcase fails, the
xml output was malformed => Fixed it

Also store in the Junit output the processes stderr

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-12-06 09:15:38 -05:00
Alberto Escolar Piedras
6e0f367396 nrf52_bsim: Require v1.2 of the HW models
In commit d8e3ea6bc2
the LF clock interrupt was enabled, which causes its interrupt
handler to be used. This interrupt handler interacts with the
NRF_POWER registers.
Therefore require using the newer HW models which include a stub
of this registers.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-12-06 09:14:38 -05:00
David B. Kinder
691e1170c1 doc: tweak API CSS for improved usability
API documentation (generated from doxygen comments) visibility
improvement by using a light-blue background on fields (vs. grey),
matching the Kconfig option documentation.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-05 16:32:59 -05:00
Ioannis Glaropoulos
e8e5c388b4 test: kernel: userspace: add include for arm core mpu
In the wake of dfa7a354ff2a31fea8614b3876b051aadc30b242, where
the inclusions for MPU APIs were clean-up, we need to directly
include arm_core_mpu_dev.h in the userspace test suite, which
invokes arm_core_mpu_enable/disable(), directly. The same is
already done for ARC MPU.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-12-05 15:15:07 -05:00
Ioannis Glaropoulos
799b5fe4fd arch: arm: clean-up inclusions in arm_core_mpu
arm_core_mpu.h and arm_core_mpu.c defined and implement kernel
APIs for memory protection, respectively. Therefore, they do not
need to directly include ARM CMSIS headers, or arm_mpu.h (or
nxp_mpu.h) which are supposed to define MPU-related kernel types
and convenience macros for the specific MPU architecture. These
headers are indirectly included by including kernel.h.

Similarly, arm_mpu.h shall not need to include internal/external
headers of memory protection APIs.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-12-05 15:15:07 -05:00
Ioannis Glaropoulos
bf34cf9443 arch: arm: mpu: Updates in ARM MPU-related convenience macros
This commit does the following:
- it introduces additional convenience macros for representing
  MPU attributions for no-cacheability, in both ARMv7-M and
  ARMv8-M MPU architectures,
- it adds documentation in K_MEM_PARTITION_IS_WRITABLE/CACHEABLE
  macros in all macro definitions in the different MPU variants
- it moves the type definition of k_mem_partition_attr_t inside
  the architecture-specific MPU headers, so it can be defined
  per-architecture. It generalizes app_mem_domain.h, to be able
  to work with _any_ (struct) type of k_mem_partition_attr_t.
- it refactors the type of k_mem_partition_attr_t for ARMv8-M
  to comply with the MPU register API.
- for NXP MPU, the commit moves the macros for region access
  permissions' attributes inside nxp_mpu.h, to align with what
  we do for ARM MPU.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-12-05 15:15:07 -05:00
Ioannis Glaropoulos
39bf24a9bd kernel: expose k_mem_partition_attr_t outside User mode
This commit exposes k_mem_partition_attr_t outside User Mode, so
we can use struct k_mem_partition for defining memory partitions
outside the scope of user space (for example, to describe thread
stack guards or no-cacheable MPU regions). A requirement is that
the Zephyr build supports Memory protection. To signify this, a
new hidden, all-architecture Kconfig symbol is defined (MPU). In
the wake of exposing k_mem_partition_attr_t, the commit exposes
the MPU architecture-specific access permission attribute macros
outside the User space context (for all ARCHs), so they can be
used in a more generic way.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-12-05 15:15:07 -05:00
Ioannis Glaropoulos
ccf813c22a kernel: mem_domain: remove redundant clearing of mem_partition fields
When a memory partition is removed, it is not required
to clear the start and attr fields, since a free partition
is only indicated by a zero size field. This commit removes
the un-necessary clearing of start and attr fields.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-12-05 15:15:07 -05:00
Ioannis Glaropoulos
293247e879 kernel: remove MEM_PARTITION_ENTRY macro
MEM_PARTITION_ENTRY is problematic, as it assumes that
struct k_mem_partition contains a k_mem_partition_attr_t
field, which is only true if Memory Protection is supported.
Additionally, it works with k_mem_partition_attr_t being a
single element object (scalar or single element structure).
This commit removes the macro function and updates macro
K_MEM_PARTITION_DEFINE() (MEM_PARTITION_ENTRY has only been
used in that macro function definition).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-12-05 15:15:07 -05:00
Himanshu Jha
5cc08cbeae doc: application: coccinelle: Mention report mode as a necessary rule
The newly proposed script must have report mode implemented
in them since they are less verbose warnings and helpful
in automated CI when throwing warnings to users.

Also, fixup mailing list links to follow .rst rules for
documentation using bullets while rectifying unwanted bold text.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-12-05 15:14:05 -05:00
Himanshu Jha
200e847ace scripts: coccicheck: Improve continuous run operation
The current implementation of continuous run operation using
command `./scripts/coccicheck` i.e., without specifying any options,
`coccicheck` default runs in `report` mode with all available
coccinelle scripts present at `scripts/coccinelle/`.

Not all scripts have report mode implemented in them, which
leads to failure of coccicheck.

With this new implementation we choose whatever available mode
is present in coccinelle script and pass it to MODE variable
without stopping continuous coverage.

And perhaps if there are plans to add `coccicheck` as a sanity
checker in future to the Zephyr automated CI, then certainly we
want the warnings/errors produced by scripts to be less verbose
to the users.

Therefore, in this new implementation we prioritise the modes as:

1. report
2. context
3. patch
and lastly falling to
4. org

Lastly, in order to differentiate between outputs of various
coccinelle scripts being run, `x------x` separator has been used
to make reports mode readable.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-12-05 15:14:05 -05:00
David B. Kinder
160c5742a4 doc: filter new known doc build warnings
Changes to uart.h in PR #10820 caused a new warning from Sphinx/Breathe
that we can classify as a "known issue" and should ignore.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-05 15:10:25 -05:00
Armando Visconti
802ad61aba drivers: sensors: lis2dh: Fix out-of-bound access
FIX issue #10571 and #10593
atomic_xxx() functions expect the bit argument to be the
position index inside the target integer and not its
numerical representation (e. g. 5 means the 5th bit and not 32).
The original code could potentially override an adiacent variable.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-05 10:38:38 -08:00
Vikrant More
067d527a34 samples: mesh: nrf52: improved code readability
Improved code readability by defining some macros.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
d4b85837fb samples: mesh: nrf52: state binding improvements
Corrected state binding. With this commit Light Lightness
actual state would not cross its upper & lower limit.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
e8d4290d83 samples: mesh: nrf52: removed bugs in Target values calculation
Target values should change as per min. & max. values of
bound states. This commit handles this.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
6456d14a9d samples: mesh: nrf52: improved coding style
Improved coding style.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
313ce9d54a samples: mesh: nrf52: rename some functions name
Function names should have a verb as the last component.
As per this standard, rename some fuunctions names.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
7871128b19 samples: mesh: nrf52: removed bug in Gen. level Move GET & Publish
Due to recent changes some bugs had introduced in Gen. Level Move
GET & Publish functionalities. Now separatly introduced
gen_level_move_get() and gen_level_move_publisher() to resolved it.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Håkon Øye Amundsen
0da5d24c36 cmake: flash: Conditional dependency to 'mergehex'
This patch adds a dependency from the 'flash' target to
the 'mergehex' target IF files to be merged are configured.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2018-12-05 12:14:38 -05:00
Kumar Gala
1fe9a5b8d8 dts: ieee802154: cc1200: Add DTS support
Add a dts binding file for the cc1200 and move the Kconfig options for
SPI and GPIOs to DTS for the CC1200 driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-05 10:13:23 -06:00
Rajavardhan Gundi
022990f73d xtensa: Implement CONFIG_TEXT_SECTION_OFFSET
CONFIG_TEXT_SECTION_OFFSET allows the entire image to be moved
in memory to allow space for some type of header. The mcubootloader
can boot only such images which reserve some space for the header.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-12-05 15:48:49 +01:00