This is based on the introduction of a helper Kconfig symbol in
"subsys/random/Kconfig" which is named CSPRNG_AVAILABLE. When this is
enabled it means that there is a "zephyr,entropy" property defined in the
device-tree, therefore Mbed TLS can select ENTROPY_GENERATOR to allow
the platform specific driver to be included into the build.
This commit also changes other locations where CSPRNG_ENABLED was used
moving it to CSPRNG_AVAILABLE in order to solve dependency loop
build failures.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
In the case of IPV6 not enabled, when NET_SOCKETS_PACKET is enabled,
the sizeof(struct sockarr) will change to 20, the value of
MCUMGR_TRANSPORT_NETBUF_MIN_USER_DATA_SIZE is 8, which is not able
to pass the compilation, so I change its default value to 20.
Fixes#82757
Signed-off-by: Hongquan Li <hongquan.prog@gmail.com>
Make sure smp_transport_clients list is only initialized once and
before any transports will try to register and add entries to this
list.
The smp_init() routine was called after smp_init_uart(), causing
the list to be emptied again after registration of the uart client
transport.
Signed-off-by: Bas van Loon <bas@arch-embedded.com>
Replaces code that peeked directly into the thread by instead
calling k_thread_join() to check the state of threads
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fix possible race condition where SMP client might
release the network buffer before system worker queue
has processed it.
In smp_client uses shared resources like worker queue
linked list and network buffers without maintaining any
thread safety.
For unknown reasons, retry timeout handling is pushed
into system worker queue while the actual transmission
is handled from SMP work queue.
Fix the issue by using the same SMP work queue
for both delayable timeout handling as well as
transmission handling.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Some backends use DMA. Usually, DMA doesn't work correctly, when memory
to transfer is cached. Add a config to place the common buffers in the
nocache section.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Disable and enable SPI module before every transaction for STM32H7
chips. It is a recommended way in the STM32 RM. In another case, a first
byte of a transaction is always 0x00.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
STM32H7 chips have additional configuration regarding underrun event.
Configure the underrun behaviour correctly to use the underrun pattern
and clear the underrun bit before sending new data.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Move enabling CS interrupt at the end of the backend configuration,
when everything is ready.
It prevents handling the interrupt, when something is not prepared e.g.
DMA is not configured.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Fix support for clock domains. Create define that identify if
clock domain was selected in any of the st_stm32_spi_host_cmd nodes.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Traditionally threads have been initialized with a PRESTART flag set,
which gets cleared when the thread runs for the first time via either
its timeout or the k_thread_start() API.
But if you think about it, this is no different, semantically, than
SUSPENDED: the thread is prevented from running until the flag is
cleared.
So unify the two. Start threads in the SUSPENDED state, point
everyone looking at the PRESTART bit to the SUSPENDED flag, and make
k_thread_start() be a synonym for k_thread_resume().
There is some mild code size savings from the eliminated duplication,
but the real win here is that we make space in the thread flags byte,
which had run out.
Signed-off-by: Andy Ross <andyross@google.com>
When CONFIG_ASSERT is enabled, assertion for unbalanced state lock
get/put is triggered. This commit leverages shi drivers from other
SoCs to resolve the assertion.
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Responses are currently set to the shell device that was configured
in the device tree.
The shell_uart driver allows for changing it's device during runtime
which leads to a situation where we recieve packets on one device
and respond on another.
This patch causes smp_shell_tx_raw to use the shell_uart device
Signed-off-by: Zak Portnoy <zakportnoy@gmail.com>
The CONFIG_PINCTRL is removed from the board's defconfig files.
Drivers which use pin control function should add "select PINCTRL"
in their Kconfig files.
Fixes#78619
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
The MCUmgr statistics only work correctly when selecting
MCUMGR_SMP_LEGACY_RC_BEHAVIOUR option. Checks the option
flag on the stat_mgmt_list and fix the behavior.
Fixes: 80476
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Adds supporting code that allows the RAM load mode of MCUboot to
be used and for applications to build successfully with it.
Sysbuild can be used to build images for this mode
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
seperate the autohandler from the main
hawkbit source. This way the autohandler can
be disabled if it is not needed.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add function to get the poll interval.
This is needed to seperate the autohandler
from the main hawkbit code.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Enable Cortex R8 support, similar to Cortex-R5.
Signed-off-by: Krzysztof Sychla <ksychla@antmicro.com>
Signed-off-by: Marek Slowinski <mslowinski@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
Adds a new command that will return information on slots
themselves, listing the slot sizes, without any internal
information about the slot data. Will also return the maximum size
of an image for a set of slots if built using sysbuild.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fixes an issue with structure which was previously raised in a
comment, and adds a new bool to the structure to enable this
restructure to work
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Added the SMP service and characteristic UUIDs to the smp_bt module
header and used those definitions.
Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
Fixes wrongly returning an SMP version 2 error code as an SMP
version 1 error code instead of adding it as an error
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Allows enabling the bootloader info functionality without MCUboot
being enabled, so that other bootloaders can add hooks with their
own responses
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
For code clarity, this commit adjusts the use of `return` statements
in functions with a void return type as follows:
- Transform `return foo();` into separate statements:
`foo();`
`return;`
- Remove unnecessary `return` statements when
they don't affect control flow.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Added new Kconfigs for defining permission level of GATT
characteristics that are part of the Bluetooth SMP service in the
MCUmgr subsys.
Removed the CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN as the new Kconfig
options are mutually exclusive and need to be groupa as the Kconfig
choice option.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Adds an optional hook that allows for appending additional
responses to the bootloader info command
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
There is an issue on the SHI hardware peripheral to detect CS
rising/failing with bits CSnFE/CSnRE in the EVSTAT2 register in
npcx9m7fb chip. This commit workarounds it by using MIWU to detect the
CS rising and failing.
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Move the network buffer header file from zephyr/net/buf.h to
zephyr/net_buf.h as the implementation now lives outside of the networking
subsystem.
Add (deprecated) zephyr/net/buf.h header to maintain compatibility with old
file path.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Ensure that leading zeros are present in the milliseconds field,
otherwise a milliseconds count of 35 will appear as x.35, i.e. 350
milliseconds. With this fix, it will appear as x.035.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Select PINCTRL subsystem by drivers which require it.
Prevent the need from enabling this symbol at board or soc level.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Adds string names to the groups in MCUmgr when the enum mgmt
Kconfig is enabled to support listing names of groups
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a new MCUmgr group which allows for listing which groups are
supported by the MCUmgr server by remote devices.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>