The VBUS bounces when the USB connector is plugged in. This can lead to
events VBUS removed and Suspended occurring in that order. With
hibernation support enabled, hibernation request, as result of the
suspend interrupt, will be delegated to the driver thread. Once the
driver thread is scheduled to process hibernation request, the
controller may be already disabled and controller/phy clocks be off. On
nRF54LM20 this leads to CPU crash and a hang.
To avoid this happening, cancel the possible hibernation request after
interrupts are disabled. Although the thread could be still waked up
because of USBSUSP interrupt raised and event posted, this is considered
to be harmless, as there would be a second check in the thread whether
the event is still valid or is cleared in between.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
CONFIG_NUM_IRQS - 1 may be a second-level interrupt number on platforms
with multi-level interrupt support. Second-level interrupts cannot be
used for direct ISR testing.
Use CONFIG_2ND_LVL_ISR_TBL_OFFSET - 1 when available to ensure we test
with a first-level interrupt that supports direct ISR functionality.
Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
The workaround in bt_cmd_send_sync should no longer by needed when
tx_processor is not on the system work queue.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
When thread that TX processor is used to send commands and data to
Controller is also used for sync commands sending and command buffer
allocation, a deadlock happens.
This thread is used to avoid such deadlocks by moving TX processor to
its own dedicated thread exclusively used by tx processor only.
Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Reduce BT_MAX_CONN from 62 to 61 to make it build on integration
platform qemu_cortex_m3/ti_lm3s6965 when we add bt_taskq in subsequent
commit.
The number 62 seems arbitrary here, so reducing it by one should not
have any practical impact.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
ATT is invoking user callbacks in its net_buf destroy function. It is
common practice that these callbacks can block on bt_hci_cmd_alloc().
This is a deadlock when the net_buf_unref() happens inside the HCI
driver, invoked from tx_processor.
Blocking callbacks like this appear in our own samples. See further down
about how this problem was detected.
tx_processor not protect against blocking callbacks so it is de-facto
forbidden. The Host should not equip net_bufs with dangerous destroy
callbacks.
This commit makes ATT defer its net_buf destruction and user callback
invocation to the system workqueue, so that net_buf_unref is safe to
call from non-blocking threads. In the case of the deadlock, the
net_buf_unref() was below the tx_processor in the call stack, which (at
the time of this commit) is on the system work queue, so defering it to
the system work queue is preserving the existing behavior.
Future improvement may be to allow the user to provide their own
workqueue for ATT callbacks.
This deadlock was detected because the following test was failing while
moving tx_processor to the bt_taskq:
tests/bsim/bluetooth/ll/throughput/tests_scripts/gatt_write.sh
The above test has an ATT callback `write_cmd_cb` invokes
`bt_conn_le_param_update` can block waiting for `tx_processor`.
The reason it was not failing while tx_processor was on the system work
queue is that the GATT API has a special non-blocking behavior when
called from the system work queue.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Allow flash devices to be accessed using the NVMEM API. Note that it simply
uses the read/write API functions. Erasing should be handled by the
application.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Move the existing "--no-load" argument from the OpenOCD and Intel Cyclone V
runners into an argument in the runners base class such that it can be used
by all runners. Also update the existing runners to work with the common
option instead of their own.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
This commit adds a prompt to the Kconfig file to make
CORTEX_M_SYSTICK_RESET_BY_LPM option more visible to users
configuring the driver.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
When low-power mode timer is enabled, a counter alarm is set on the
idle timer before entering low-power mode. The counter API requires
a non-NULL callback function for the alarm. This commit adds a stub
callback function to satisfy the API requirement.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Removing references to infineon,cat1-spi-pdl. Differentiation between
PDL and HAL drivers have been changed to use Kconfig options.
Signed-off-by: John Batch <john.batch@infineon.com>
Removing references to infineon,cat1-spi-pdl from the device tree files.
Updates the driver bindings and driver file to look at the
infineon,cat1-spi binding and uses a Kconfig option to select Legacy HAL
implementation instead.
See https://github.com/zephyrproject-rtos/zephyr/pull/98035 for context.
Signed-off-by: John Batch <john.batch@infineon.com>
Multiple submitted requests are getting merged to single cancelled
net_buf on endpoint dequeue. While MSC class was correctly decrementing
the usage counters, it was not freeing SCSI buffer pointed to by frags.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Similarly to what was present on L0, GPIO port indexes are not continuous
in EXTI configuration register and a dedicated treatment is required.
Deal with it case by case.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
entropy_get_entropy() is allowed to block while waiting for
entropy. Don't exit with an error if entropy is exhausted,
wait instead. Move clock enable out of the inner loop to avoid
unnecessarily calling it multiple times.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Enable IS_GEN_UICR_IMAGE by default for the gen_uicr image.
A recent change accidentally made this default n, and broke a bunch of
users.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
When calling net_hostname_set() from C++, you will hit compile
errors if you attempt to use a const char *. Since the internals
of net_hostname_set() just uses memcpy(), we should pass in the
new hostname as a const char * to better support C++.
Tested using samples/cpp/hello_world, with an added call to
net_hostname_set().
Signed-off-by: Andrew Kontra <andrew@legatoxp.com>
Add missing getting/putting of the device when the RX interrupt is
enabled/disabled. Also fix enabling and disabling of the TX interrupt
so that the device is got/put only if the interrupt wasn't already
enabled/disabled and device PM reference counting is done correctly.
This fixes `console_getchar()` that would hang when used with
`CONFIG_PM_DEVICE_RUNTIME=y`.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Add an overlay for some STM32 boards that embed an SDRAM connected
through FMC interface to better cover their accessibility. Despite
each SDRAM is a few MByte large test are not too long lasting:
- stm32f429i_disc1 .... 8MByte: <1s
- stm32f469i_disco ... 16MByte: <1.5s
- stm32f746g_disco .... 8MByte: <1s
- stm32f7508_dk ...... 8MByte: not tested
- stm32f769i_disco ... 16MByte: ~2s
- stm32h745i_disco .... 8MByte: <0.2s
- stm32h747i_disco ... 32MByte: <0.6s
- stm32h750b_dk ....... 8Mbyte: <0.2s
- stm32h757i_eval .... 32MByte: not tested
- stm32h7b31i_dk ..... 16MByte: not tested
Adding these test ensures non-regression on SDRAM support.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Correct memc driver test application to allocated only the required
size for the tests and print valid information instead of byte
offset that was actually a 32bit cell pointer offset.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Testing full SDRAM access on stm32h750b_disco showed instabilities
and corrupted accessed. Increasing the FMC SDRAM clock period fixes
the issue.
This change ensures stability of transactions with the SDRAM but
may be sub-optimized regarding performances. An alternate correction
would need further investigations in the FMC interface timings
and clocks configuration.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Testing full SDRAM access on stm32h745i_disco showed instabilities
and corrupted accessed. Increasing the FMC SDRAM clock period fixes
the issue.
This change ensures stability of transactions with the SDRAM but
may be sub-optimized regarding performances. An alternate correction
would need further investigations in the FMC interface timings
and clocks configuration.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>