Commit graph

41120 commits

Author SHA1 Message Date
Tobias Svehagen
e55f3eba4c Settings: Initialize settings_lock mutex
The settings_lock mutex was never initialized

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2019-08-05 21:48:22 +02:00
Yaël Boutreux
57a166aced boards: arm: stm32mp157c_dk2: Add SPI support
Add SPI support for stm32mp157c_dk2 board. If SPI is selected, SPI4
(Arduino connector compatible SPI) and SPI5 (on front 2x20 GPIO
expander) will be enable by default on stm32mp157c_dk2 board.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Yaël Boutreux
e0d6534f09 drivers: spi: spi_ll_stm32: Add support for STM32MP1x SoC
Add SPI driver support for STM32MP1x SoC.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Yaël Boutreux
3a967f92c3 soc: arm: st_stm32: stm32mp1: Add SPI support
Add SPI support for STM32MP1x SoC.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Yaël Boutreux
2f334817b0 west.yml: update hal_stm32 revision to add SPI LL for CubeMP1
Update hal_stm32 revision in order to add SPI LL for CubeMP1

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Yaël Boutreux
876eb63ac3 drivers: spi: st_stm32: Abstract LL function for spi ver. compatibility
Abstract some SPI LL function call for future driver compatibility with
a new SPI peripheral version (introduced with STM32MP1x and STM32H7x
SoC)

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Yaël Boutreux
c935508c05 drivers: spi: spi_ll_stm32: set NSS before mode
This commit solves an issue where the NSS must be set before the
mode on the stm32mp157c_dk2, else LL_SPI_SetMode won't affect the
mode registry.
stm32mp1x (and stm32h7) LL function SPI_Init seems to also define
first the NSS then the mode, unlike other STM32 boards where this
is not specified.
Changing the order shouldn't have bad repercussions on other boards,
ZephyrnSPI driver test has been passed successfully on disco_l475_iot1
board.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Alberto Escolar Piedras
b7ee23bcc9 nrf52_bsim: Minor fix in time coversion
(This could not be triggered in the nrf52_bsim yet,
so just so it is fixed for the future)
Properly handle converting back and forth from absolute to HW
time when either of those is set to TIME_NEVER

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-08-05 18:57:51 +02:00
Carles Cufi
13823b6bcf doc: Update Slack invitation link
The old link seems not to work anymore, so instead replace it with an
invitation link freshly generated.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-08-05 16:52:15 +02:00
Jukka Rissanen
fc79a789c7 tests: net: context: Let the net_context cb to run first
An issue was seen after changes introduced in #17933.
The net_context callback was run after we checked that it
was run ok. This test failed of course in that case. Simple
solution is to k_yield() which will make sure that the
callback gets called before we continue. This works for this
test as our threads have suitably selected priorities.
There is also no need to use K_NO_WAIT here so replacing the
timeout with K_FOREVER.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-05 16:25:18 +03:00
Marti Bolivar
7118d084c9 scripts: un-break test_nrfjprog.py
The pytest.raises context manager is now returning an ExceptionInfo
whose str() doesn't contain the str() of the underlying exception
object. Take str(e.value) directly to make sure we're looking at the
exception string.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-05 15:17:45 +02:00
Marti Bolivar
2b3d9df1d7 west: require v0.6.0 or higher
The main change is the elimination of the bootstrapper, a design flaw
/ misfeature.

Update the documentation to be compatible with the 0.6.x releases as
well. This has to be done atomically, as there were incompatible
changes.  Make use of the versionchanged and versionadded directives
to begin keeping track of how these APIs are evolving.

(Note that west 0.6.0 will remain compatible with the extension
commands in Zephyr v1.14 LTS as long as that is still alive. This
change is targeted towards Zephyr 2.0 users.)

This requires a bump in the shippable container and allows us to
simplify the west_commands test procedure.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-05 15:17:45 +02:00
Marti Bolivar
247047bf21 doc: move runner documentation out of west-apis.rst
Now that the runners package no longer depends on west, we can move
the documentation for it from the orphan west-apis.rst page to the
build-flash-debug.rst page that documents the west extension commands
which use that package.

(This is a more logical place for this information, but it was
previously not possible to put it there since we must be able to build
the documentation on a system without west installed, excepting
content in west-apis.rst. Removing the dependency means the runners
automodule directive can safely appear in build-flash-debug.rst.)

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-05 15:17:45 +02:00
Marti Bolivar
6846de68de doc: add a release notes page for west
This just documents what's already happened.

A subsequent patch will extend it for v0.6.x.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-05 15:17:45 +02:00
Peter A. Bigot
d60d16d4cd drivers/spi_nor: de-pessimize reads
SPI NOR devices require that writes be performed within only one page at
a time.  There is no such limitation on reads.  Remove the code that
forced reads to be performed in 256-byte chunks.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-05 13:27:49 +02:00
Peter A. Bigot
86dcf3c173 drivers/spi_nor: fix writes across page boundaries
The code failed to increment the address after completing a partial
write, causing writes that cross a page boundary overwrite at a page
level.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-05 13:27:49 +02:00
Tomasz Bursztyka
08a93d276b samples: Counter alarm should display seconds, not ticks
The message talks about seconds but displays ticks. Adjusting the
parameter to convert ticks to seconds then. But also adding the ticks
since it is a valuable information when testing counter devices.

Fixing small style issue (parameter indentation) as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-08-05 13:27:36 +02:00
Erwan Gouriou
b837252269 boards: stm32h474i_disco: Fix m4 core sys clock
System clock for m4 core was set to same clock as m7 core.
This is wrong as m4 its value is actually based on clock frequency
value after D1CPRE (sys_d1cpre_ck) divided per HPRE value, 200MHz in
current case.
This also matches the max clock speed for the m4 core (200MHz)

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-08-05 13:27:21 +02:00
Erwan Gouriou
c12688ecbf boards: stm32h747i_disco: Enforce same clock configuration on both ...
cores

In order to prevent potential misconfiguration set the clock setting,
which impacts both cores, under board.defconfig file which is used
by both core.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-08-05 13:27:21 +02:00
Tomás Longeri
e9809d5309 ring_buffer: Fix return types
Fixed return types for capacity and space get functions.
Prevents potential overflows.

Signed-off-by: Tomás Longeri <tlongeri@gmail.com>
2019-08-05 13:26:28 +02:00
Andrew Boie
0add92523c x86: use a struct to specify stack layout
Makes the code that defines stacks, and code referencing
areas within the stack object, much clearer.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
8014e075f4 x86: use per-thread page tables
Previously, context switching on x86 with memory protection
enabled involved walking the page tables, de-configuring all
the partitions in the outgoing thread's memory domain, and
then configuring all the partitions in the incoming thread's
domain, on a global set of page tables.

We now have a much faster design. Each thread has reserved in
its stack object a number of pages to store page directories
and page tables pertaining to the system RAM area. Each
thread also has a toplevel PDPT which is configured to use
the per-thread tables for system RAM, and the global tables
for the rest of the address space.

The result of this is on context switch, at most we just have
to update the CR3 register to the incoming thread's PDPT.

The x86_mmu_api test was making too many assumptions and has
been adjusted to work with the new design.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
8915e41b7b userspace: adjust arch memory domain interface
The current API was assuming too much, in that it expected that
arch-specific memory domain configuration is only maintained
in some global area, and updates to domains that are not currently
active have no effect.

This was true when all memory domain state was tracked in page
tables or MPU registers, but no longer works when arch-specific
memory management information is stored in thread-specific areas.

This is needed for: #13441 #13074 #15135

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
fddd550824 userspace: clarify k_mem_partition_add()
Need to enumerate the constraints on adding a partition
to a memory domain, some may not be obvious.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
0c3e05ae7c x86: report CR3 on fatal exception
Lets us know what set of page tables were in use when
the error occurred.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
fcd2c14500 x86: add functions to get/set page tables
Wrapper to assembly code working with CR3 register.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
ea201b206f x86: add debug functions for dumping page tables
These turned out to be quite useful when debugging MMU
issues, commit them to the tree. The output format is
virtually the same as gen_mmu_x86.py's verbose output.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
26dccaabcb x86: reserve room for per-thread page tables
Currently page tables have to be re-computed in
an expensive operation on context switch. Here we
reserve some room in the page tables such that
we can have per-thread page table data, which will
be much simpler to update on context switch at
the expense of memory.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
76310f6896 x86: make guard pages ro instead of non-present
Has the same effect of catching stack overflows, but
makes debugging with GDB simpler since we won't get
errors when inspecting such regions. Making these
areas non-present was more than we needed, read-only
is sufficient.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
7fae2bbc18 tests: increase main stack size for x86 with ztest
Some options like stack canaries use more stack space,
and on x86 this is not quite enough for ztest's main
thread stack to be 512 bytes.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Andrew Boie
f281b74c56 userspace: set stack object earlier
Populate thread->stack_obj earlier in the thread initialization
process such that it is set when z_new_thread() is called.

There was nothing specific about its position, or the rest of
the code in that CONFIG_USERSPACE block, so just move it all up..

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-05 13:25:50 +02:00
Findlay Feng
4b18a079d9 drivers: gpio: add stm32f1x SWJ configuration
Add the serial wire JTAG configuration of the stm32f1x family.
Before gpio is initialized, you can choose to turn off the debug pin to
make the used pins available.

Signed-off-by: Findlay Feng <i@fengch.me>
2019-08-05 13:22:34 +02:00
Christian Taedcke
6f0a2b4946 board: efr32_slwstk6061a: Add storage partition
Add storage partition to the board in order to enable testing on
nvs sample.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2019-08-05 13:22:09 +02:00
Christian Taedcke
d9c4d0acbe board: efr32mg_sltb004a: Add storage partition
Add storage partition to the board in order to enable testing on
nvs sample.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2019-08-05 13:22:09 +02:00
Christian Taedcke
5ccdd18a72 board: efm32wg_stk3800: Add storage partition
Add storage partition to the board in order to enable testing on
nvs sample.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2019-08-05 13:22:09 +02:00
Christian Taedcke
c9553561b4 board: efm32pg_stk3402a: Add storage partition
Add storage partition to the board in order to enable testing on
nvs sample.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2019-08-05 13:22:09 +02:00
Christian Taedcke
f81118405c board: efm32hg_slstk3400a: Add storage partition
Add storage partition to the board in order to enable testing on
nvs sample.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2019-08-05 13:22:09 +02:00
Saravanan Sekar
0fd92b463b wifi: eswifi: Select socket before configuration
Socket selection needs to be first in the order of operation

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2019-08-05 13:21:15 +02:00
David B. Kinder
23d863f6c4 doc: add doc home link in left nav
It's been annoying that there was no convenient way to get back to the
documentation home page.  There is a link in the breadcrumb trail at the
top of the page, but folks didn't notice that.  This PR adds a
"Documentation Home" link at the top of the left-nav menu.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-08-05 13:20:45 +02:00
Harry Jiang
273bb8e2f7 fs/nvs: fix the sector size check
The sector size is 0 will pass "fs->sector_size % info.size" then start
a loop in nvs_startup() and never return. So retrun an error if the
sector size is 0.

Signed-off-by: Harry Jiang <explora26@gmail.com>
2019-08-05 13:20:07 +02:00
Wayne Ren
f7fd1ff67c arch: arc: fix the offset generation of accl_regs
* the offset generation of accl_regs should
  rely on CONFIG_ARC_HAS_ACCL_REGS not CONFIG_FP_SHARING

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-05 13:19:13 +02:00
Carles Cufi
c635409c57 doc: guides: tools: Fix URL to nRF Command-line tools
Fix the URL as it has changed on the Nordic website.

Fixes #18009.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-08-05 12:52:29 +02:00
Ravi kumar Veeramally
fa7a5db12e samples: net: Modify mqtt_publisher to use set proxy
Modify mqtt_publisher sample to use mqtt_client_set_proxy().
Removed CONFIG_MQTT_LIB_SOCKS based setup.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-08-05 13:26:11 +03:00
Ravi kumar Veeramally
8e70bd6f48 net: mqtt: Modify SOCKS5 based connections
Current SOCKS5 based connections in mqtt are only
TCP (nonsecure) based. To support TLS based SOCKS5
connections, new methods needs to be introduced.

Instead, removed CONFIG_MQTT_LIB_SOCKS based implementation.
And now mqtt provides an api to set proxy
(mqtt_client_set_proxy()) details. That's enough,
socket layer will take care of making connections through
proxy server.

Fixes: #17037

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-08-05 13:26:11 +03:00
Ravi kumar Veeramally
39ed77e438 net: socks: Make SOCKS5 implementation transparent
Current SOCKS5 implementation is above socket level and every
higher layer protocol or application level needs to have
SOCKS5 related changes. This solution is based on socket
setsockopt(). Application caller has to set proxy details
through setsockopt() and socket:connect() will take care
creating connection.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-08-05 13:26:11 +03:00
Ravi kumar Veeramally
c8fa169294 net: Add support for SOCKS5 socket option
The SO_SOCKS5 socket option can be used by the application to
set the SOCKS5 proxy details. These details will be used when
connecting to peer.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-08-05 13:26:11 +03:00
Joakim Andersson
45da629b24 Bluetooth: Host: Fix wrong init address when controller resolved address
The init addr should contain the on-air address used to establish the
connection. The dst address contains either the current RPA of the
unknown peer, or the identity address after identity information has
been exchanged.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-05 12:18:46 +02:00
Joakim Andersson
c1a754f665 Bluetooth: Host: Print error codes in hex
Error codes are listed in header files and in the core spec as hex
values. Always print them in hex in debug for easier error code
checking.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-05 12:18:17 +02:00
Joakim Andersson
67c66bd09d Bluetooth: Host: Fix bluetooth address string length
The string "xx:xx:xx:xx:xx:xx (random-id)" is 30 characters including
zero termination.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-05 12:17:57 +02:00
Kumar Gala
6228a18d64 cmake: Support SDK versions more broadly
The SDK version is of the form X.Y.Z.  Change the cmake scripts to be
based on X.Y of the version.  This allows us to easily support newer
toolchains without having to explicitly add cmake files for the version
as well as removes duplication between those files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-08-05 12:16:12 +02:00