Add compatibility macros to map SDMMC constants to SDIO equivalents
for STM32F4 series MCUs. STM32F4 uses SDIO peripheral with SDIO_*
constants while newer STM32F7/H7 series use SDMMC peripheral with
SDMMC_* constants.
This fixes compilation errors on STM32F4 platforms where SDMMC_*
constants are undefined:
- SDMMC_CLOCK_EDGE_RISING
- SDMMC_CLOCK_BYPASS_ENABLE/DISABLE
- SDMMC_CLOCK_POWER_SAVE_ENABLE/DISABLE
- SDMMC_HARDWARE_FLOW_CONTROL_DISABLE
Fixeszephyrproject-rtos/zephyr#94896
Signed-off-by: Shan Pen <bricle031@gmail.com>
The AT25XV021A variant is a flash variant of Atmel's AT25 family
that adds extra protections, requiring additional writes to the
device to program or erase data.
This commit adds a flash driver for AT25XV021A devices instead of
modifying (1) the existing AT45 SPI flash driver or (2) the
existing AT24/25 EEPROM driver because this variant poses
fundamental changes that affect all aspects of the driver.
Notably,
- AT25XV021A includes a second status register, and the format
and functions of the existing status register is
changed from the existing drivers.
- AT25XV021A requires executing page or chip erase commands
before writing, making it incompatible with the
existing AT24/25 EEPROM driver.
- AT25XV021A adds a software protection layer that requires
extra writes before executing program or erase commands.
Tested writing to and erasing from an AT25XV021A device. Tested
reading from an AT25XV021A device across page boundaries. Tested
chip erase function. Tested driver initialization from varying
initial hardware states.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
The `pio` value is stored in the internal `pio_rpi_pico_config` structure
that is not exposed. However, it is the first element of the structure.
Here, I convert the pointer to `pio_rpi_pico_config` into a pointer to PIO
to access this value.
Signed-off-by: Terry Geng <terry@terriex.com>
Connection manager doesn't depends on ESP32 Wi-FI AP+STA mode.
This modification fix integration of connection manager binding
in the Wi-Fi ESP32 driver.
Signed-off-by: Joel Guittet <joelguittet@gmail.com>
Add a test for the new API to query the buffered data size in the
stream_flash subsystem.
Signed-off-by: Syver Haraldsen <syver.haraldsen@nordicsemi.no>
add a wrapper function to read the number of bytes currently buffered
and pending for the next flash write operation.
Signed-off-by: Syver Haraldsen <syver.haraldsen@nordicsemi.no>
These types are useful for IoT deployments and should be available
thru the resolver interface to get the data. The SRV is especially
useful to find services on the local network when not using a dns-sd
deployment and just something like Avanhi or Bonjour.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
When resolving SRV records - the label might not be compressed so
the first entry into the net buf is the start of the name and a
period could end up at the start - ie. ".example.local" so only add
a period when the buffer is not empty.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
The enum will auto increment, so in debug the IP and DATA records are
negative numbers which initially made this look like an error, so just
push the expected good values to be positive numbers in case of a print
or something else would imply these are ok.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
There was an issue where terminating the BIG while in the
ISO connected callbacks could lead to continueing the loops
would cause access to cleared memory.
The simple solution to this is to simply prevent
bt_iso_big_terminate from terminating the BIGs while we are
processing the BIG HCI events.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a choice of which RSSI type should be reported to the application
layer, packet RSSI (which stops at the noise floor) or signal RSSI
(which estimates the LoRa signal strength into the noise floor).
Signed-off-by: Jordan Yates <jordan@embeint.com>
As a first integration of the LoRa Basics Modem backend, implement the
LoRa API for the standard SX126x/SX127x chips.
Much of the logic from `lbm_common.c` is taken from the loramac-node
`sx12xx_common` implementation, but it should now be agnostic for all
LoRa RF transceivers.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Import the lora-basics-modem module as an alternate backend for LoRa
and LoRaWAN, since loramac-node has been deprecated.
Support is currently limited and experimental.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Move the current implementation of the LoRa API using `loramac-node` to
a dedicated folder in preparation for the LoRa basics modem
implementation.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The broadcast code was attempting to read from argv[1] instead
of argv[2] that actually contains the broadcast code.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add Andrew Davis (@glneo) as TI K3 Platform maintainer, Andrew is an
active collaborator and permanent employee of TI Processor SW team.
Also move myself as collaborator for K3 platforms.
Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Ignore the direnv .envrc file to automatically loads and unloads
environment variables from the current directory.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This commit is fixing configuration of mx66uw1g45g NOR when working
at 200MHz.
According to its specification, when running at 200MHz, this memory should
use a Number Dummy Cycles configuration of 20 (DC bits in CFGR2), which is
the device's default configuration.
Applying the 66MHz configuration as done today was preventing flash to run
at frequency higher than 100Mhz.
This commit doesn't solve the more generic problem of this driver which
is applying this 66MHz configuration universally, irrespective of the
frequency and the memory device, but fixes the configuration which was
reported broken today.
Providing a global change would require starting a clear split between XSPI
controller configuration an bus device configuration, which is what new
MSPI API intend to solve, so this will be tackled once this driver will be
available.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Fix copy/paste issue on XSPI_SEL macro and use HCLK5 as kernel clk.
This has no functional impact on NOR as HCLK5 is the default clk which
was used due to the copy/paste error.
Remove now useless ic3 nodes.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Rework doxygen group naming and fold "internal" Flash API into the main
Flash API group.
Also a minor fix of a missing javadoc-style comment.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
For the ULPM set, it asks for a 10ms ready time for the module.
Use k_busy_wait instead of k_msleep to ensure we wait enough clock cycles.
Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
The ZMS API should not unexpectedly crash the application; this commit
adds tests to check if the ZMS API can safely handle and return -EINVAL
if called with a NULL fs pointer.
This commit also adds test to confirm the return value matches the
documentation if user calls the ZMS API before ZMS is mounted
Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
Add checks on the fs pointer passed through the api before using to
avoid causing an exception
Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
zms_active_sector_free_space is documented to return -EACCES on fs not
mounted error but currently returns an usigned type size_t. This fixes
that by changing the return value into a ssize_t
Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
STM32CubeProgrammer does not support flashing in BOOT-SERIAL mode
using the device's serial number.
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
Add a testcase to execute the samples/drivers/spi_flash on
stm32 disco kits where the external flash is accessible
in memory mapped mode : CONFIG_STM32_MEMMAP=y.
In this testcase condition, the DMA transfer is not used but memcopy.
limit to "st,stm32-Xspi-nor" compatible only.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
These macros depend on time.h (which is not included in clock.h)
and are not really kernel related, but translation from the kernel
tick representation into time_spec values.
Let's place them in timeutils with their related macros/functions.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
* Fixes in code and test so it works with any expected time_t size.
* Fix test_timespec_normalize so it also tests the output of
timespec_normalize(), fixing some incorrect expected values
accordingly.
* Test: Do not force a C library in the integration platform
and do not filter by libC as it is not necessary anymore.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Since it's possible that rounding up might not always be the right thing
to do in every situation, in order to allow the application to make more
informed decisions, we created a modified timespec_to_timeout() that also
returns the remainder (or difference) between the requested time to
convert and resulting k_timeout_t. The difference is expressed as a
timespec object.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Elaborate on testing for functions that convert between timespec and
k_timeout_t.
We explicitly add tests to verify functionality in the regions of
interest, verify the semantic equivalence of specific time points.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Originally, the timespec_to_timeout() and timespec_from_timeout() tests
assumed that tv_sec and tv_nsec values divided evenly with the number of
ticks per second (CONFIG_SYS_CLOCK_TICKS_PER_SEC). However, those
assumptions broke down when testing with 32768 ticks/s .
Upon further investigation, there were additional corner cases
discovered that were not handled in an ideal or safe way.
Part of this fix involved identifying several "domains" and special
values that have semantic meaning that must be handled particularly
carefully.
Additional hidden-API constants were made to simplify the solution.
K_TICK_MIN (1)
K_TICK_MAX (UINT32_MAX-1 in 32-bit, INT64_MAX in 64-bit)
K_TIMESPEC_NO_WAIT (like K_NO_WAIT)
K_TIMESPEC_FOREVER (like K_FOREVER)
1. Converting a negative k_timeout_t
These only exist in 64-bit representation and actually encode absolute
timepoints via ticks. Since the stated purpose of the conversion
functions is to convert between durations, we must reject absolute
time points in timespec_from_timeout().
2. Converting a negative timespec
We assume that this duration means a timeout has already expired, and
round these up to K_NO_WAIT in timespec_to_timeout().
3. Due to the larger numeric space in the timespec representation,
the reverse mapping of timespec to k_timeout_t is "fuzzy". However,
K_NO_WAIT (K_TIMESPEC_NO_WAIT) and K_FOREVER (K_TIMESPEC_FOREVER) must
remain semantically equivalent. The previous implementation also held this
to be true, but the test cases are a bit clearer about it now.
4. Also, due to the larger numeric space in timespec representation,
there was a special requirement to round up to the nearest tick
boundary for any timespec in the strictly exclusive range
(K_TIMESPEC_NO_WAIT, K_TIMESPEC_MAX). We must round up, since
a) rounding down to K_NO_WAIT is most certainly not representative
of a non-zero finite duration delay
b) the kernel operates on tick boundaries
5. Above the K_TIMESPEC_MAX boundary, which is the highest possible
timespec that can be represented by a tick, and specifically in the
64-bit timeout representation, there is a domain that cannot be
rounded up to K_TIMESPEC_FOREVER and should always be rounded down to
K_TIMESPEC_MAX.
This is to ensure that finite durations remain finite (even if
they are beyond the heat death of the universe).
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Define additional constants and macros for converting between timespec
objects and k_timeout_t.
There are four semantically important durations identified with new
constants identified via '.
1. K_NO_WAIT / K_TIMESPEC_NO_WAIT'
* duration of zero
2. K_TICK_MIN' / K_TIMESPEC_MIN'
* minimum number of ticks strictly greater than K_NO_WAIT
3. K_TICK_MAX' / K_TIMESPEC_MAX'
* maximum number of ticks strictly and semantically less than K_FOREVER
4. K_FOREVER / K_TIMESPEC_FOREVER'
* the familiar non-expiring number of ticks (i.e. infinity)
With these definitions, there are 3 meaningful regions for conversion
between timespec and k_timeout_t representation:
1. < K_TIMESPEC_NO_WAIT (i.e. a negative timespec)
* should be rounded up to K_TIMESPEC_NO_WAIT
* < K_NO_WAIT in ticks is an absolute time point in 64-bit
representation should no be permitted in the affected conversion
routines, as they are explicitly for converting time durations rather
than absolute time points.
2. K_TIMESPEC_NO_WAIT < x < K_TIMESPEC_MAX
* should be rounded-up to the next tick boundary
* must be represented as the minimal non-zero duration in ticks
3. K_TIMESPEC_MAX <= x < K_TIMESPEC_FOREVER
* must be represented as the maximum expiring duration in ticks
* should be rounded-down to K_TIMESPEC_MAX
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The IWDG4 is on the APB3 bus on STM32MP2x SoCs. When the system is
in debug mode, the watchdog should be frozen to prevent it from
expiring and resetting the system during debugging sessions.
Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>
Like the H7x series, the MP2x series has a WWDG1 peripheral in the APB3
bus. The MP2 has the same LL function to freeze the watchdog in debug
mode.
Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>