If bind() fails or TX thread cannot start, then cleanup the
socket by calling close()
Coverity-CID: 191003
Fixes#13824
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Change the parameter types from can_msg to zcan_frame and from
can_filter to zcan_filter.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
For sending the zcan_frame can be const, because its only
copied to the registers.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
The error numbers are currently not negative an CAN_TIMEOUT overlapps
with TX errors. Fix that by making the numbers negative and timeout
the first negative number.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
These get references by newlib builds in other toolchains, e.g.
gnuarmemb, and lack of them breaks linking. Tested that
tests/posix/fs and tests/posix/common actually work with these
changes.
Fixes: #13906
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The spinlock validation isn't super lightweight -- it adds only a few
tens of bytess per call, but there are a LOT of locking calls. On
smaller platforms with 32kb of flash, we're bumping into code size
limits on the bigger tests (tests/kernel/poll is a particular
offender).
Check the declared flash size before enabling it.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
(Chunk 3 of 3 - this patch was split across pull requests to address
CI build time limitations)
Zephyr has always been a uniprocessor system, and its kernel tests are
rife with assumptions and outright dependence on single-CPU operation
(for example: "low priority threads will never run until this high
priority thread blocks" -- not true if there's another processor to
run it!)
About 1/3 of our tests fail right now on x86_64 when dual processor
operation is made default. Most of those can probably be recovered on
a case-by-case basis with simple changes (and a few of them might
represent real bugs in SMP!), but for now let's make sure the full
test suite passes by turning the second CPU off. There's still plenty
of SMP coverage in the remaining cases.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The qmsi rtc hardware supports a single alarm only and a fixed top
value, so restructure the counter_basic_api test to skip unsupported
features.
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
patch modifies the set top value api to return error only
when ticks passed from application is not equal top value
supported by hardware.
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Nonatomic swap strikes again. These issues are all longstanding, but
were unmasked by the dlist work in commit d40b8ce1fb ("sys: dlist:
Add sys_dnode_is_linked") where list node pointers become nulls on
removal.
The previous fix was for a specific case where a timeslicing interrupt
would try to slice out the "wrong" current thread because the thread
has "just" pended itself. That was incomplete, because the parallel
code in k_sleep() didn't flag itself the same way.
And beyond that, it turns out to be basically impossible (now that I'm
thinking about it correctly) to prevent interrupt code from calling
into the scheduler to suspend a "just pended but not quite" current
and/or preempt away to another thread. In any of these cases, the
scheduler modifications to the state bits remain correct but the queue
nodes may be corrupt because the thread was already removed from the
ready queue. So we have to test and correct this at the lowest level,
where a thread is being removed from a priq: check that it's (1) the
ready queue and not a waitq, (2) the current thread, and (3) already
marked suspended and thus not in the queue.
There are lots of existing issues filed in the last few months all
pointing to odd instability on ARM platforms. I'm reasonably certain
this is the root cause for most or all of them.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Every time the array of offsets was changed, it was changed in a
backward compatible way by appending elements to the end. The version
number was incremented to inform OpenOCD about the existence of the new
elements. But the patch for OpenOCD to support Zephyr has never been
updated to support anything else than version 0, causing OpenOCD to
reject recent Zephyr versions. So the idea of using a version number to
track compatible changes didn't work out.
Therefore add another symbol that can be read by OpenOCD to get the
number of elements in the array. This value is automatically calculated
during compilation. The version number element should from now on be
incremented only for incompatible changes.
Fixes: #13448
Signed-off-by: Daniel Glöckner <dg@emlix.com>
This commit aligns the implementation of arm_core_mpu_disable()
function in NXP MPU with the implementation in the ARM MPU
module, by introducing a Data Memory Barrier, (DMB) instead of
a DSB instruction. This is in accordance with the ARM guidelines
of using the memory protection unit.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
commit ddf744deee ("drivers: pwm_nrfx: Use Device Tree label as
instance name") removed the config setting for PWM names and replaced
it with DT_NORDIC_NRF_PWM_PWM_*_LABEL.
This change is causing the blink_led and fade_led samples to break
when compiled for nRF52 boards.
Let's update the samples to use the DT setting.
Signed-off-by: Michael Scott <mike@foundries.io>
insert_defs() is the only function that adds keys to 'defs', and they
always get added with an 'aliases' key.
This function could get super simple if the duplicate-removal code could
be removed. It only seems to be needed to prevent duplicates for some
(unfortunately tricky) flash-related stuff now.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
- No deep copying is needed. The deepcopy() is just a hack to work
around that the value might not be a list. That deserves a comment at
least.
- A catch-all try/except will hide stuff like misspelled variables as
well. It's usually a bad idea.
Rewrite things to be more explicit, and add some comments.
reg.py was indirectly using the deepcopy() imported in global.py,
because it does 'from global import *'. Have it import deepcopy() itself
instead. reg.py is the only remaining user of deepcopy().
reg.py relying on the deepcopy() import in global.py was super hard to
discover, due to another catch-all try/except around the deepcopy()
call.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
All nodes have a 'children' key.
Also simplify a bit. The loop is copying a dictionary verbatim.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
'/foo' was turned into ''. Turn it into '/' instead. That's how the root
is represented in 'reduced' too.
Also remove some code from get_addr_size_cells() that was only there to
work around the bug.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
After commit 'scripts/dts: Never ignore properties in
generate_node_defines()', pointless entries for 'interrupt-names'
properties show up in generated_dts_board.conf and
generated_dts_board_fixups.h, because many bindings specify
'generate: define' for 'interrupt-names'.
If 'generation: define' is taken as "generate #define's for this
particular property", then only the 'interrupts' property ought to have
'generation: define'. Having it on both 'interrupts' and
'interrupt-names' makes you wonder what it would mean to only have it on
one of them.
Things get a bit confusing since 'interrupt-names' is still used when
determining the macro names generated for 'interrupts', but it's
probably best to have 'generation: define' work in a consistent way
still (and never be a no-op).
Remove 'generation: define' from all 'interrupt-names' bindings.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
If a binding specifies 'generate: define' for 'interrupt-names' (like
some bindings do), then that ought to generate #defines for it, but the
scripts/dts code currently hardcodes 'interrupt-names' to be ignored
(along with some other properties).
Maybe the 'generate: define' in those bindings is a mistake, but the
code still ought to respect it. That also gets rid of some mystery code.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
For PLLQ divisor configuration, use directly RCC_PLLCFGR_PLLQ_Pos
definition instead of calculating its position from RCC_PLLCFGR_PLLQ.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Default AHB presacler value was set to 0 which is not an allowed
value. Set it to 1 and limit range from 1 to 512.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Drop these CMake comments. It is redundant with a below comment to
describe 'app', and it is incorrect to state that omitting
boilerplate.cmake is permitted/supported.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
We had an if-statement around policy 79 because we used to need to
support CMake versions before 3.13.0. But now 3.13.1 is the minimum
required version so the if statement always evaluates to true and can
be omitted.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Found via Coverity CID 191001: Control flow issues (NO_EFFECT)
This less-than-zero comparison of an unsigned value is never true:
"put_char(out, '}') < 0U".
Let's fix this check to be less than 1 instead as it should have
been originally.
Signed-off-by: Michael Scott <mike@foundries.io>
Adding OpenAVnu/gptp and linuxptp links to the doc.
Also the "Application interfaces" chapter had some style issues.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The doxygen comment for ieee802154_radio_api, net_l2 and
net_pkt structs was missing, which meant that no documentation
was generated for them.
Also add comment to "enum net_l2_flags" as that looks better in
the generated html file.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Newly added net_context_send_new()/net_context_sendto_new() take
void *buf, size_t len params but in docstring, refer to "network
buffer", which is apperently copy-paste artifact.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
We have a great number of samples now, using different port numbers,
etc. Let them be self-documenting and print out port number used.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The file was in two subfolders as copied from the FreeRTOS BSP
for i.MX6 and i.MX7. Unified the file and moved it into the
devices folder, like in the FreeRTOS BSPs.
Fixes: #13748
Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
There was no notification about dropped logs When logger operated
in the mode where message is dropped when logger has no space to
store the message. Notification was printed only if logger operated
in the mode which overwrites oldest log.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added support for remote wakeup in hid_mouse example.
If rempote wakeup support is enabled, wakeup request
is performed on every button click when the bus in suspended state.
Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
This commit adds support for remote wakeup and extends USB api
with a wakeup request call. Remote wakeup can be dsabled in kconfig
when a specific driver does not support this feature.
Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
To get u8_t value, just right shift the operands are enough.
Fixes#12298
Coverity-CID: 190635
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This makes use of BT_GATT_CCC_MANAGED so instead of having a custom
attribute which is not managed by stack.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This consolidates code for finding a CCC config in a helper function
thus reducing the amount of duplicated code.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>