console_register_line_input() is a legacy function which forces console
subsystem to keep dependency on drivers/console. The two console
implementations are meant to be independent.
Console subsystem provides console_getline() function, which should be
used instead.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This adds a compiler option -fno-inline for code coverage on
architectures which supports doing code coverage. This also
modifies the ALWAYS_INLINE macro to not do any inlining. This
needs to be done so code coverage can count the number of
executions to the correct lines.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit brings power management subystem documentation up to date
with the implementation. The main changes since the last time the
documentation was updated include introduction of power managment
policies.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Rename power managment subsystem Kconfig options describing minimum
residency to make them easier to identify with respective policy.
Following is a detailed list of string replacements used:
s/SYS_PM_SLEEP_(\d)_MIN_RES/SYS_PM_MIN_RESIDENCY_SLEEP_$1/
s/SYS_PM_DEEP_SLEEP_(\d)_MIN_RES/SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_$1/
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Add SYS_POWER_ prefix to HAS_STATE_SLEEP_, HAS_STATE_DEEP_SLEEP_
options to align them with names of power states they control.
Following is a detailed list of string replacements used:
s/HAS_STATE_SLEEP_(\d)/HAS_SYS_POWER_STATE_SLEEP_$1/
s/HAS_STATE_DEEP_SLEEP_(\d)/HAS_SYS_POWER_STATE_DEEP_SLEEP_$1/
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit cleans up names of system power management functions by
assuring that:
- all functions start with 'sys_pm_' prefix
- API functions which should not be exposed to the user start with '_'
- name of the function hints at its purpose
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
There exists SoCs, e.g. STM32L4, where one of the low power modes
reduces CPU frequency and supply voltage but does not stop the CPU. Such
power modes are currently not supported by Zephyr.
To facilitate adding support for such class of power modes in the future
and to ensure the naming convention makes it clear that the currently
supported power modes stop the CPU this commit renames Low Power States
to Slep States and updates the documentation.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
os.exit() doesn't exist.
Also use the nifty sys.exit(msg) feature, which prints 'msg' to stderr
and exits with status 1.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
When building ticker.c from the shell, it requires include access to the
Nordic HAL, so add the relevant folder to the include path.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This sample did not enable gpio driver, so nothing happens after flash
firmware into a board.
By enabling gpio driver to fix it.
Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
Added an option to stop the execution of the posix arch based
executable on the first fault, even if the fault stemmed from a
non essential thread.
Having it fail faster, in the first fault, will ease debugging
in many cases.
The option is disabled by default to preserve the old behavior.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Not needed in Python. Detected by check C0325 in pylint3.
Also replace an
if len(tag):
with just
if tag:
Empty strings, byte strings, lists, etc., are falsy in Python.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Making a clean slate for some pylint CI tests. Only enabling relatively
uncontroversial stuff.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
CONFIG_PM_LOG_LEVEL was renamed to CONFIG_SYS_PM_LOG_LEVEL in commit
c45961daae ("power: Rework OS <-> Application interface"), but the old
name is still used here. Fix the name.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Plain 'source' is globbing. 'gsource' is a leftover from an older
design, and works as a synonym for 'source'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Needs to be at the beginning of the file. Fixes a pylint warning:
scripts/process_gperf.py:26:-1: W0105: String statement has no
effect (pointless-string-statement)
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Cast ts to u32_t could cause an overflow in that multiplication, since
time_t is 8 bytes it is not necessary to cast the multiplication's
result too.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Needs to be at the beginning of the file. Fixes a pylint warning:
scripts/process_gperf.py:26:-1: W0105: String statement has no
effect (pointless-string-statement)
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
In case of double buffering (two capture buffers), the CSI is
frequently starved because of a lack of buffer in the active pool.
You can find below an example of double buffering scenario:
FREE_BUF ACTIVE_BUF
start: 0 2
frame0_complete: 0 1 (no buffer to load in active)
resubmit_frame0: 1 1
frame1_complete: 1 0 (CSI stopped, active buf = 0)
resubmit_frame1: 2 0
0 -> 2 (CSI restarted)
This patch solves this issue by loading buffer to active at submit
time.
FREE_BUF ACTIVE_BUF
start: 0 2
frame0_complete: 0 1
resubmit_frame0: 1 1
0 -> 2 (Direct load to active)
frame1_complete: 0 1
resubmit_frame1: 1 1
0 -> 2
...
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
When compiling with CPP, compiler complains about multiple implicit
type convertion:
error: invalid conversion from ‘const void*’ to ‘const counter_config_info*’
...
Let's fix that using explicit casting.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Add qemu ethernet driver overlays for big_http_download and
dumb_http_server samples, which are default integration samples/
tests for TCP stack. This change follows up after similar addition
of such overlays to other samples (and smsc911x overlay addition
to these samples).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The network packet ref count was not properly increased when
the TCP was retried. This meant that the second time the packet
was sent, the device driver managed to release the TCP frame even
if we had not got ACK to it.
Somewhat long debug log follows:
The net_pkt 0x08072d5c is created, we write 1K data into it, initial ref
count is 1.
net_pkt_write: pkt 0x08072d5c data 0x08075d40 length 1024
net_tcp_queue_data: Queue 0x08072d5c len 1024
net_tcp_trace: pkt 0x08072d5c src 5001 dst 5001
net_tcp_trace: seq 0x15d2aa09 (366127625) ack 0x7f67d918
net_tcp_trace: flags uAPrsf
net_tcp_trace: win 1280 chk 0x0bea
net_tcp_queue_pkt: pkt 0x08072d5c new ref 2 (net_tcp_queue_pkt:850)
At this point, the ref is 2. Then the packet is sent as you see below.
net_pkt_ref_debug: TX [13] pkt 0x08072d5c ref 2 net_tcp_queue_pkt():850
net_tcp_send_data: Sending pkt 0x08072d5c (1084 bytes)
net_pkt_unref_debug: TX [13] pkt 0x08072d5c ref 1 (ethernet_send():597)
Ref is still correct, packet is still alive. We have not received ACK,
so the packet is resent.
tcp_retry_expired: ref pkt 0x08072d5c new ref 2 (tcp_retry_expired:233)
net_pkt_ref_debug: TX [10] pkt 0x08072d5c ref 2 tcp_retry_expired():233
net_pkt_unref_debug: TX [10] pkt 0x08072d5c ref 1 ... (net_if_tx():173)
net_pkt_unref_debug: TX [10] pkt 0x08072d5c ref 0 ... (net_if_tx():173)
Reference count is now wrong, it should have been 1. This is because we
did not increase the ref count when packet was placed first time into
sent list in tcp.c:tcp_retry_expired().
The fix is quite simple as you can see from this commit.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When converted to time_t, RTC init date was missing 100 years
offset, as time_t starts in 1900 while RTC starts in 2000.
Besides, tm_mon calculation was wrong by 1 month as allowed range
is 0-11 and provided in range 1-12.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Asyc transceive is currently not implemented for this driver,
so don't claim support.
spi_context_lock() is already being called in spi_sam_transceive()
so calling it in the wrapper function will cause a deadlock.
This reverts eae05d928e
Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
With BT_HOST_CRYPTO, advertising stack size could be overflowed,
increase size to 1024 when BT_HOST_CRYPTO is enabled.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Test case added for IPv6 neighbors. This will add more than
CONFIG_NET_IPV6_MAX_NEIGHBORS neighbors. Network stack should
remove oldest neighbor which is in STALE state and it should
add new neighbor. So call to net_ipv6_nbr_add() should succeed.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This patch fixes following issues.
* If IPv6 neighbor table is full, stack can not add any new
neighbors. So stale counter is introduced. Whenever neighbor
enters into STALE state, stale counter will be incremented
by one. When table is full and if stack wants to add new
neighbor, oldest neighbor in STALE state will be removed
and new neighbor will be added.
* When neighbor is in PROBE state and when it exceeds max
number of PROBEs, only neighbor with router is removed.
As per RFC 4861 Appendix C, entry can be discarded. Now
neighbor will be removed from the table.
* Reachability timer has an issue. e.g. if a first entry timer
is 10 seconds, after 3 seconds, a new entry added with
only 3 seconds. But current implementation does not check
whether remaining time of current left over timeout is more
than new entry timeout or not. In this example, when new entry
timeout is 3 seconds, left over timeout from first etnry is
still 7 seconds. If k_delayed_work_remaining_get() returns
some value then new entry time out was not considered.
Which is bad. It fixed now.
* nbr_free is used sometimes to remove the neighbor. Which does
not remove route if that particulat neighbor is route to some
other neighbor. net_ipv6_nbr_rm() should be used in such places.
* Trivial changes which does not affect functionality.
Fixes#14063
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Clarify what iPerf version was used when testing this sample
application. It was iPerf 2.0.9 which worked ok, for example
iPerf 2.0.13 did not work properly with UDP uploader (client)
mode.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Try to construct a proper iperf client header to the payload
as the server expects that. It is not sure if this is needed
or correct as there is no proper documentation for the iPerf2
protocol.
Fixes#14665
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Try to construct a proper iperf client header to the payload
as the server expects that. It is not sure if this is proper
way to do the iperf header as there is no documentation about
iPerf protocol anyway (except the iPerf source code).
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Set the revision to the v0.5.6 tag in west.yml and update the minimum
version. Barring any (more) major undiscovered issues, this will be the
version used with Zephyr v1.14.
Signed-off-by: Marti Bolivar <marti@foundries.io>
Shell was selecting logger option which lead to define
CONFIG_LOG_RUNTIME_FILTERING generation even though log
was disabled. That messed up logger and lead to compilation
failure.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
When log is disabled then input parameter to LOG_LEVEL_SET(level)
is not defined. It was still used, leading to compilation failure.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>