After read first packet and if ERDPT < ERXRDPT,cause read Rx FIFO error.
The fix is to set ERDPT properly before reading next packet.
Fixed#9537
Signed-off-by: Frank Li <lgl88911@163.com>
The following 2 improvements are contained in this patch:
- When converting from ms to ticks, instead of using hardware cycles
per tick, use hardware cycles per second. This ensures that the
multiplication is done before the division, increasing precision.
- When converting from ticks to ms, instead of using cycles per tick
and cycles per sec, use ticks per sec. This too increases the
precision.
The concept is to make the dividend as large as possible compared to the
divisor in order to lose as little precision as possible.
Fixes#8898Fixes#9459Fixes#9466Fixes#9468
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
SYS_MEM_POOL_KERNEL and SYS_MEM_POOL_USER are used by k_mem_pool flags
and should be defined as a bit mask.
It was defined as zero failing in all places checking for this
bit. e.g pool_irq_lock and pool_irq_unlock were not working correctly
because the check for this flag was always returning false.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The kernel timer subsystem isn't part of the !MULTITHREADING
environment (no threads to wake up, though in principle it should be
possible to support timeout callbacks with some work in the future).
Protect it against platforms that select this but still enable a timer
driver.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
We have been dropping lines after finding a fault which resulted in
missing information in the log. Make sure we continue and only report
failure at the end of the execution.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Do not close console after PASS is reported, wait a bit for any
remaining messages from the tests, sometimes we have faults that need to
be parsed.
This now works for Qemu handler, support for other handlers to follow.
Fixes#9646
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This removes these network sample applications
samples/net/mbedtls_sslclient
samples/net/mbedtls_dtlsserver
samples/net/mbedtls_dtlsclient
as they are using low level mbedtls APIs. You should use
preferably the samples/net/sockets/echo_[server|client] applications
instead, or as a last option use net-app based applications
in samples/net/echo_[server|client] if needed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
For ease of maintenance, let's swap the reader/writer initialization
syntax to:
.put_begin = put_begin,
.put_end = put_end,
...
This way we only assign used fields and adding new ones later is
less error prone.
Signed-off-by: Michael Scott <mike@foundries.io>
We set "insert" to true when the value is already in the buffer, but
we need to insert a TLV to denote things like RESOURCE_INSTANCE or
OBJECT_INSTANCE. In this case, let's not re-add the value.
Signed-off-by: Michael Scott <mike@foundries.io>
Let's implement put_begin/end_oi functions in the TLV formatter
so to mark the boundry of an object instance when more than 1
object instance is returned.
Fixes https://github.com/zephyrproject-rtos/zephyr/issues/9470
Signed-off-by: Michael Scott <mike@foundries.io>
In order to re-use the put_begin_ri / put_end_ri logic, let's create
generic functions for them: put_begin_tlv and put_end_tlv
Signed-off-by: Michael Scott <mike@foundries.io>
Currently, we only save the resource id of the incoming path setting.
In the future, we will need to change other values in order to process
multi-instance READ operations.
Let's save and restore the entire path only at the beginning and end
of processing.
Signed-off-by: Michael Scott <mike@foundries.io>
Data formatters may need to process data at the beginning and end of
each object instance and/or resource. Currently, they can only add
processing at the beginning and end of resource instances.
Let's establish put_begin/end_oi (object instance) and put_begin/end_r
(resource) API functions that data formatters can use for this purpose.
Signed-off-by: Michael Scott <mike@foundries.io>
Optimize the resource processing loop to avoid extra
assignments before checking if we need to process the
actual resource.
Signed-off-by: Michael Scott <mike@foundries.io>
When reading multiple instances, the base name value should not
include an object instance id. The object instance id is added
to the individual resource name values.
Accomplish this by saving the original path level and adjusting
the (base) name where needed.
Signed-off-by: Michael Scott <mike@foundries.io>
The put_begin / put_end calls are to be used at the very beginning
and end of processing a READ op. Let's correct that logic.
Signed-off-by: Michael Scott <mike@foundries.io>
Now that formatters use their own private data to hold state,
let's remove the old member variables from lwm2m_output_context
which are now unused.
Signed-off-by: Michael Scott <mike@foundries.io>
Data formatters have various private state variables which are
currently located in the output context structure. Let's add
a place where data formatters can store a pointer to their
private data so that as we add more formatters the output
context doesn't get cluttered up.
Signed-off-by: Michael Scott <mike@foundries.io>
The plain-text format only supports READ op for a specific resource.
In all other cases return NOT_ALLOWED.
Signed-off-by: Michael Scott <mike@foundries.io>
Data formatters are becoming too complex for a simple do_read_op()
function to handle all in one place. Also, more data formatters are
going to be added for LwM2M v1.1 support in the future.
In order for data formatters to perform internal setup or deny
invalid requests (specific to the formatter's logic), let's
establish do_read_op_* functions in each formatter.
Once the internal processing is done, they can call back into the
more generic lwm2m_perform_read_op function.
Signed-off-by: Michael Scott <mike@foundries.io>
Let's correct the starting logic in do_read_op() to not assume
a default value of 0 will be present for the first object, when
reading multiple objects.
Signed-off-by: Michael Scott <mike@foundries.io>
The object instance list isn't sorted by object instance id. Let's
simplify this and fix the logic in lwm2m_next_engine_obj_inst() to make
sure that we always get the NEXT object instance by value of
obj_inst_id, not just the next object instance in the list.
NOTE: This change removes the "last" object instance pointer from the
parameters of lwm2m_next_engine_obj_inst(). Some of the logic to return
a NULL value for the end of the list has to be moved back into
do_read_op().
Signed-off-by: Michael Scott <mike@foundries.io>
Remove over-complicated match_type logic in do_read_op(). Replace
MATCH_* checks with actual path->level values.
Signed-off-by: Michael Scott <mike@foundries.io>
Now that we call main() with interrupts enabled in !MULTITHREADING, we
need to disable them again for the final fallback "loop-forever
because user code returned" state. Otherwise some architectures will
toss interrupts into a context where we obviously aren't prepared.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Building with !MULTITHREADING is designed for bootloaders and similar
minimal-functionality use cases. It's pathologically silly to combine
it with MMU drivers and address space partitioning, even though on
some architectures that technically works (on ARM, it seems not to).
The test intent was to disable this originally, but it turns out that
doesn't work. There is a TEST_USERSPACE kconfig symbol that also
needs to be explicitly turned off, otherwise it will reselect
USERSPACE against our wishes.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Make the multi-level interrupts diagram more clear by saying:
- the "-" means an interrupt slot
- all interrupt slots are numbered from 0 starting from right most
- alphabets denote devices
- add an example chain for device D
Signed-off-by: Yasushi SHOJI <y-shoji@ispace-inc.com>
This config is only valid for kinetis boards. Fixes the Kconfig warning:
warning: the choice symbol OSC_EXTERNAL (defined at
arch/arm/soc/nxp_kinetis/Kconfig:53) was selected (set =y), but no
symbol ended up as the choice selection.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The ciaddr can be null in requesting state so do not try to print
it in that case.
Fixes#9575
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add the missing sha256 crytographic algorithm testcase for
execution via ztest. The sub test case was not getting executed
as it was missed to be added in ztest suite.
Signed-off-by: Praful Swarnakar <praful.swarnakar@intel.com>
This is similar to change which was done in 21f31e90ec, unfortunately
this case was missed.
Fixes: #9032
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Previously (as introduced in 48fadfe62), if k_poll() waited on a
queue (or subclass like fifo), and wait was cancelled on queue's
side using k_queue_cancel_wait(), k_poll returned -EINTR. But it
did not set event->state field (to anything else but
K_POLL_STATE_NOT_READY), so in case of waiting on multiple queues,
it was not possible to differentiate which of them was cancelled.
This in particular broke detection of network socket EOF conditions
in POSIX poll() implementation.
This situation is now resolved with introduction of explicit
K_POLL_STATE_CANCELLED state, which is now set for cancelled queue
(-EINTR return remains the same).
This change also elaborates docstring for the functions mentioned, to
document this behavior.
Fixes: #9032
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The peers were not informed about DTLS connection close because
we removed DTLS context. The fix is to notify peers before we
remove the DTLS connection.
Fixes#8605
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
sample/net/README no longer exists so this removes its mention since
it is already described how to use echo-client at the end of the
document. Also state that CONFIG_BT_6LOWPAN shall be set in order to
use Bluetooth 6LoWPAN module with Linux.
Fixes#9727
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The LPCXpresso54114 command line example was using a wrong board
name which has been renamed after adding the support for the
Cortex-M0+ core.
Fixes#9649
Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
Update menuconfig (and Kconfiglib, just to sync) to upstream revision
78682a8e3c4fe to get the following fix in, which could cause certain
visible symbols to not show up in the menuconfig interface:
menuconfig: Always show implicit submenus with visible nodes
Currently, the symbol BAR below (which ends up indented in an
implicit submenu) is shown only if DEP is non-n (or if show-all mode
is enabled):
config FOO
bool "foo" if DEP
default y
config BAR
bool "bar" if FOO
This is bad, because it hides visible symbols from the interface.
The assumption was that an implicit submenu (which is only created
if the parent has a prompt) would never have visible items when the
parent item is invisible, but prompt-specific conditions and
select/imply can break that assumption.
Fix it by always showing implicit submenus with visible nodes, along
with the parent node. If the parent node is invisible, show it in
red, like in show-all mode (which happens automatically). That's
probably better than having mysteriously indented nodes when the
parent is invisible.
(Some other tweaks were made later to avoid showing red outside show-all
mode, because it might look confusing/broken.)
A new color scheme for the menuconfig has been added as well,
contributed by Mitja Horvat (pinkfluid). It can be enabled by setting
the environment variable MENUCONFIG_THEME to 'aquatic'.
The default theme has been tweaked to use bold text for the selected
item too.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The code in le_set_private_addr() was hardcoding identity 0, even
though it is given a specific identity as an input parameter.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
k_msg_get returns only three possible values, and
osErrorValue is not in osMessageGet spec, hence
removing this unhit else case.
Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
Added few more tests to cover all the message
send and receive scenarios. Added negative tests
to increase code coverage.
Signed-off-by: Niranjhana N <niranjhana.n@intel.com>