The root node's z_path_id value for the duration of this script
doesn't match the value DT_ROOT is defined to in devicetree.h.
I didn't notice this because the root node's compatible doesn't have a
matching binding in practice, so no macros are generated for it, but
we're about to start looking at node parents explicitly and this is an
issue for that. Fix it so the root node's z_path_id is "N", since
DT_ROOT is the token "DT_N".
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The PORCTRL setting command is in 'bank2' and so might not be changed on
the controller unless bank2 is enabled first.
Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Remove usage of Kconfig symbols I2C_X and rely on overlay
to enable i2c instances in samples for stm32 boards
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following conversion of stm32 i2c driver to use of DT_NODELABEL
macros, configuration of i2c instance in stm32 boards should
no more be done thanks to Kconfig symbols, but is done thanks
to device tree file.
Clean boards files from these symbols.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Make use of DT_NODELABEL macros to get device instances
information to configure drivers I2C instances.
This allows to remove I2C related lines in fixup.h files
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Use compatible information to configure i2c stm32.
With this, driver version selection is done thanks to compatible
and it is not needed anymore to do this via Kconfig symbol
selection under soc/
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Convert the LMP90xxx ADC driver from using k_sleep() to using
k_msleep() in order to resolve a compilation error caused by passing
an int to k_sleep().
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Convert driver from DT_FLASH_BASE_ADDRESS and DT_FLASH_DEV_NAME to use
DT_REG_ADDR and DT_INST_LABEL.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
For a flash driver DT_DRV_COMPAT should be the compatible for the flash
controller and not the soc-nv-flash. Change to driver to use the flash
controllers compatible and get the soc-nv-flash properties as a child of
that controller.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
For a flash driver DT_DRV_COMPAT should be the compatible for the flash
controller and not the soc-nv-flash. Change to driver to use the flash
controllers compatible and get the soc-nv-flash properties as a child of
that controller.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
For a flash driver DT_DRV_COMPAT should be the compatible for the flash
controller and not the soc-nv-flash. Change to driver to use the flash
controllers compatible and get the soc-nv-flash properties as a child of
that controller.
The soc_flash_mcux supports several possible compatible so handle that
as part of how we set DT_DRV_COMPAT.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
For a flash driver DT_DRV_COMPAT should be the compatible for the flash
controller and not the soc-nv-flash. Change to driver to use the flash
controllers compatible and get the soc-nv-flash properties as a child of
that controller.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This adds the support of openocd for nucleo board stm32g474re
It requires the openocd that supports stm32G4xx
(zephyrproject-rtos/openocd#24)
Signed-off-by: Francois Ramu <francois.ramu@st.com>
This adds the support of openocd for nucleo board stm32g431rb
It Requires the openocd that supports stm32G4xx
(zephyrproject-rtos/openocd#24)
Signed-off-by: Francois Ramu <francois.ramu@st.com>
This adds the support of openocd for nucleo board stm32g071rb
It requires the openocd that supports stm32G0xx
(zephyrproject-rtos/openocd#24)
Signed-off-by: Francois Ramu <francois.ramu@st.com>
The board rename was missed. That's the only remaining case of a
missed rename I could find in tree, but I may have missed something.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The selection of the Cortex M systick driver to be used as a system
clock driver is controlled by CONFIG_CORTEX_M_SYSTICK.
To replace it by another driver CONFIG_CORTEX_M_SYSTICK must be set
to 'n'. Unfortunately this also controls the interrupt vector for
the systick interrupt. It is now routed to z_arm_exc_spurious.
Remove the dependecy on CONFIG_CORTEX_M_SYSTICK and route to
z_clock_isr as it was before #24012.
Fixes#24347
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
The ARM architecture root directory contains `aarch32.cmake` and
`aarch64.cmake` files whose contents are better suited to go into other
more purpose-specific files.
This commit removes the aforementioned files and moves their contents
to other files following the convention used by other architectures.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the GCC `-march` flag for the ARM Cortex-R5 targets.
Note that `armv7-r+idiv` must be specified instead of `armv7-r`,
because the GCC internally resolves `-mcpu=cortex-r5` to it.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This is a minor clean-up for the ARM architecture configurations.
Note that the `CPU_CORTEX_A` symbol is moved from the AArch64 to the
ARM root Kconfig because it can be selected from both AArch32 and
AArch64.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
When disconnecting att_reset is called and all requests are notified
but instead of passing req->user_data like it should it pass the req
itself which nowdays comes from a k_mem_slab, rather than being a
contiguous memory that would contain the request and its user data,
which would likely cause invalid access.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Update release notes for deprecation of the bt_conn_create_slave_le
API call, which has now been deprecated in favour of bt_le_adv_start
with peer address in advertising parameters instead.
Fix previously mistake about BT_LE_ADV_* deprecated macros,
application should use GAP defines, and not HCI defines.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add shell options to configure an extended advertiser for directed
advertising.
Add shell options to provide arbitrary advertising data as well as
giving scan response data.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This patch introduces two major changes to the directed advertising
feature of the bluetooth host.
Deprecating the bt_conn_create_slave_le, and removing
bt_conn_le_create_slave which has never been released. This behaviour
has now been moved by to providing the peer direct address into the
advertising parameters.
Introducing directed advertising support for nonconnectable
directed extended advertising, both scannable and non-scannable.
A bug was also fixed in the the directed-adv command in the shell
when the argument "low" was given. The advertiseng parameter pointer
declared with BT_LE_ADV_CONN_DIR_LOW_DUTY was declared in a scope that
was no longer valid when it was used to start the advertiser.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Convert driver to use new DT_INST macros throughout. Removed per
instance Kconfig symbols and replaced with DT_NODELABEL references where
needed.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Towards moving uart mcux driver to DT_INST based, we need to convert
uses of CONFIG_UART_MCUX_[0-9] to use DT_NODELABEL instead. This way
the pinmux settings are still based on specific instances of the uart.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The implicit conversion of pointer-to-function to pointer-to-void is
not acceptable in C++. Provide a C-style explicit cast to force the
reinterpretation.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
With the generation of DT_N_<node-id>_{REG,IRQ}_IDX_<idx>_EXISTS
defines, we can now use the IS_ENABLED macro to implement DT_REG_HAS_IDX
and DT_IRQ_HAS_IDX. This matches how other DT_*_HAS_* macros are
implemented as well as lets us utilize these macros with COND_CODE_1.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add generation of the following macros:
DT_N_<node-id>_REG_IDX_<idx>_EXISTS 1
DT_N_<node-id>_IRQ_IDX_<idx>_EXISTS 1
This will allow us to use IS_ENABLED() in DT_REG_HAS_IDX and
DT_IRQ_HAS_IDX which matches behavior of other DT_*_HAS_* macros as
well as lets use these with COND_CODE_1.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This bug is brought in commit 3f88ddd54999.
The cleanup of IRQ_ACT.U bit before thread switch is not done.
The bug comes out at the case where interrupt comes in user mode,
then a thread switch happens, and the target thread is to run in kernel
mode. Because the U bit is not sync up correctly, the stack operation
is wrong.
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Some of the ARC platforms aren't consistent between kconfig and their
linker scripts as to the size of memory, add a special case.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The renode emulator is REALLY slow on this test, what completes in 20
seconds on qemu takes 4-10 minutes on renode. That's causing trouble
in CI.
And this is a CPU-bound unit test of library code, where we have
coverage for riscv32 via qemu anyway. There's no value to having
better platform emulation here.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
CONFIG_SRAM_SIZE is a kconfig value, which is an int (units of kb),
but when doing math on it to produce a memory buffer size needs to be
done in size_t precision otherwise we could overflow on 64 bit
platforms with >4G memory.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
These five tests (mbox_api, mheap_api_concept, msgq_api, pipe_api and
queue) all had test cases where they needed a mem_pool allocation to
FAIL. And they are all written to assume the behavior of the original
allocator and not the more general k_heap code, which actually
succeeds in a bunch of these cases.
* Even a very small heap saves enough metadata memory for the very
small minimum block size, and this can be re-used as an allocation.
So you can't assume a small heap is full.
* Calculating the number of blocks based on "num_blocks * max size /
minimum size" and allocating them does not fill the heap, because
the conservative metadata reservation leaves some space left over.
So these have all been modified to "fill" a heap by iteratively
allocating until failure.
Also, this fixes a benign overrun bug in mbox. The test code would
insert a "big" message by reading past the end of the small message
buffer. This didn't fail because it happened to be part of an array
of messages and the other ones defined contained the memory read. But
still.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The k_heap backend is now the default for mem_pool, so duplicate these
tests across that config so we continue to have coverage for the older
code.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Legacy code can switch back to the original implementation where it
needs it, but we don't want new code to be unintentionally dependent
on the behavior of the older allocator. The new one is a better
general purpose choice.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The original k_mem_pool tests were a mix of code that tests routine
allocator behavior, the synchronization layer above that, and a
significant amount of code that made low-level assumptions about the
specific memory layout of the original allocator, which doesn't run
out of memory in exactly the same way.
Adjust the expectations as needed for the backend. A few test cases
were skipped if they were too specific. Most have been generalized
(for example, iteratively allocating to use up all memory instead of
assuming that it will be empty after N allocations).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Add a shim layer implementing the legacy k_mem_pool APIs backed by a
k_heap instead of the original implementation.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This adds a k_heap data structure, a synchronized wrapper around a
sys_heap memory allocator. As of this patch, it is an alternative
implementation to k_mem_pool() with somewhat better efficiency and
performance and more conventional (and convenient) behavior.
Note that commit involves some header motion to break dependencies.
The declaration for struct k_spinlock moves to kernel_structs.h, and a
bunch of includes were trimmed.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Almost all of the k_mem_pool API is implemented in terms of three
lower level primitives: K_MEM_POOL_DEFINE(), k_mem_pool_alloc() and
k_mem_pool_free_id(). These are themselves implemented on top of the
lower level sys_mem_pool abstraction.
Make this layering explicit by splitting the low level out into its
own files: mempool_sys.c/h.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Struct definitions contain no inlines that depend on other code so
should live early in the include tree. Upcoming refactoring needs
this to break header dependency cycles. The kernel_structs.h header
was designed for exactly this purpose.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>