Commit graph

24882 commits

Author SHA1 Message Date
raiden00pl
79e3c2e59f !arch/stm32f0l0g0: move stm32c0 and finalize the directory split
Move the stm32c0 sources, headers and boards into arch/arm/src/stm32c0,
arch/arm/include/stm32c0 and boards/arm/stm32c0, then finalize the split:
source each split family directly in arch/arm/Kconfig and boards/Kconfig and
remove the now-empty combined arch/arm/src/stm32f0l0g0 and
boards/arm/stm32f0l0g0 trees.

BREAKING CHANGE: The combined STM32F0/L0/G0/C0 architecture and board
paths were split into stm32f0, stm32l0, stm32g0, and stm32c0 directories.
Out-of-tree boards, include paths, source paths, and defconfigs must move
from stm32f0l0g0 to the matching split family.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-24 14:54:44 -03:00
raiden00pl
6d6bcbfcba !arch/stm32f0l0g0: move stm32g0 to its own directory
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32g0 sources, headers and boards into arch/arm/src/stm32g0,
arch/arm/include/stm32g0 and boards/arm/stm32g0.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-24 14:54:44 -03:00
raiden00pl
ebdd79abd2 !arch/stm32f0l0g0: move stm32l0 to its own directory
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32l0 sources, headers and boards into arch/arm/src/stm32l0,
arch/arm/include/stm32l0 and boards/arm/stm32l0.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-24 14:54:44 -03:00
raiden00pl
ccdc7a3a28 !arch/stm32f0l0g0: move stm32f0 to its own directory
BREAKING CHANGE:

Part of splitting the legacy stm32 super-directory; relocates
the stm32f0 sources, headers and boards into arch/arm/src/stm32f0,
arch/arm/include/stm32f0 and boards/arm/stm32f0.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-24 14:54:44 -03:00
raiden00pl
f491361368 !arch/stm32: move common sources to common/stm32
BREAKING CHANGE: Common STM32 source and private header files moved to
arch/arm/src/common/stm32. Out-of-tree code that references family-local
common source paths must update includes, build rules, and source paths
to the new common STM32 location.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-24 14:54:44 -03:00
Brunocor26
970f2f226a arch/risc-v/rp23xx-rv: Fix PWM frequency and duty cycle calculation.
Fixed three bugs in the RP23XX (RISC-V) PWM driver, mirroring the fix
previously applied to the ARM variant:

* setup_period: The previous divisor calculation used integer arithmetic
  that caused overflow and loss of precision. The divider is now computed
  as a 16-bit fixed-point value (div16) using 64-bit arithmetic, and
  clamped to the valid hardware range (0x10 to 0xFFF).

* setup_pulse: The compare value was incorrectly scaled by TOP instead
  of 65535, producing wrong duty cycles. The formula is now corrected
  to ((duty * (top + 1)) / 65535) with an overflow guard.

* pwm_start: The driver was not updated as part of the breaking change
  introduced in commit 4df80e19 ("!drivers/pwm: remove PWM_MULTICHAN
  option"). Access to single channel API is now info->channels[0].duty
  instead of info[0].duty.

Signed-off-by: Brunocor26 <bruno.correia@ubi.pt>
2026-06-24 02:05:52 +08:00
Matteo Golin
379dd1c5e0 bcm2711/i2c: Support I2C_M_NOSTOP/I2C_M_NOSTART properly
This commit adds support for I2C transfers spread across multiple
messages using the I2C_M_NOSTOP/I2C_M_NOSTART. The approach greedily
merges as many sequential I2C messages together as possible and
considers them as a single transfer.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-06-23 20:56:22 +08:00
Joao Mario Lago
280fbba517 stm32h5/adc: Enable ADC1.OR.OP0 for INP0 and INN1.
On STM32H5, ADC1.OR.OP0 (RM0481 26.6.23) enables the GPIO switch that
routes PA0 to ADC mux (ADC1_INP0 or ADC1_INN1).
Set ADC1.OR.OP0 during `adc_setup()` when ADC1 channel 0 is selected, or
when channel 1 is configured in differential mode.

Signed-off-by: Joao Mario Lago <joao.mario.lago@hotmail.com>
2026-06-23 08:26:38 -03:00
Eren Terzioglu
6a2eef788d arch/risc-v/espressif: Add TWAI2 support for esp32p4
Enable TWAI2 support for esp32p4

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-06-22 19:55:56 +08:00
Sammy Tran
c9caf2c5dc stm32h5/qspi: add QSPIMEM_QUADDATA flag for 1-1-4 transfers
Add QSPIMEM_QUADDATA to the QSPI memory flags. This flag selects quad
data width while keeping the address phase on a single line (1-1-4),
which QSPIMEM_QUADIO cannot express (it forces quad on both address and
data phases). Update stm32_qspi_memory() to honour the new flag by
setting CCR_DMODE_QUAD without touching the address mode.

Signed-off-by: Sammy Tran <sammytran@geotab.com>
2026-06-21 09:43:29 -03:00
leisiji
92d83aaf5e arch/arm/armv7-a: Fix L1 page table entry double-offset in addrenv create region
In arm_addrenv_create_region(), the inner loop already advances vaddr by
MM_PGSIZE for each mapped page, so after filling one L2 page table
(i.e., ENTRIES_PER_L2TABLE pages), vaddr has naturally advanced to the
start of the next 1MB section.  The old code additionally added
i * SECTION_SIZE, causing the L1 entry for the second and subsequent
sections to skip one section each iteration—leaving virtual address
holes in the mapping.

Remove the redundant i * SECTION_SIZE offset so that the L1 entry tracks
the vaddr already maintained by the inner loop, producing contiguous
section mappings.

Signed-off-by: leisiji <2265215145@qq.com>
2026-06-20 00:11:21 +08:00
Catalin Visinescu
b82ceb62a7 arch/arm/src/at32/at32_can: Division by Zero in CAN Bit Timing Commands
An unchecked integer assignment in the CAN driver may result in a division-by-zero which would result in a kernel crash (denial of service).

Tested locally, builds fine.

An unchecked integer assignment in the CAN driver may result in a division-by-zero which would result in a kernel crash (denial of service).

The CAN driver `can_ioctl` function, shown below (drivers/can/can.c), receives commands from user processes. Its received arguments `cmd` and content of `arg` are under attacker's control. In the CAN driver, some `ioctl` commands are hardware specific and are processed by calling `dev_ioctl()`. Subsequently, depending on the hardware (STM32 or AT32), this function calls `fdcan_ioctl` or `at32can_ioctl`, as shown in the snippets that follow.

```c

static int can_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
  FAR struct inode        *inode  = filep->f_inode;
  FAR struct can_dev_s    *dev    = inode->i_private;
  FAR struct can_reader_s *reader = filep->f_priv;
...
  flags = enter_critical_section();

  /* Handle built-in ioctl commands */
  switch (cmd)
    {
...
      /* Not a "built-in" ioctl command.. perhaps it is unique to this
       * lower-half, device driver. */
      default:
        {
          ret = dev_ioctl(dev, cmd, arg);
        }
        break;
    }

  leave_critical_section(flags);
  return ret;
}
```

There are a few instances where the user can trigger a kernel crash, caused by a division by zero on `CANIOC_SET_BITTIMING` command. On STM32 platforms (arch/arm/src/stm32/stm32_fdcan.c), while there is a `DEBUGASSERT` assertion for `bt->bt_baud`, the check does not cover value `0`.

```c
static const struct can_ops_s g_fdcanops =
{
...
  .co_ioctl         = fdcan_ioctl,
...
};

static int fdcan_ioctl(struct can_dev_s *dev, int cmd, unsigned long arg)
{
...
  switch (cmd)
    {
...
      case CANIOC_SET_BITTIMING:
        {
          const struct canioc_bittiming_s *bt = (const struct canioc_bittiming_s *)arg;
          uint32_t nbrp;
          uint32_t ntseg1;
          uint32_t ntseg2;
          uint32_t nsjw;
          uint32_t ie;
          uint8_t state;

          DEBUGASSERT(bt != NULL);
          DEBUGASSERT(bt->bt_baud < STM32_FDCANCLK_FREQUENCY); // <- not valid
          DEBUGASSERT(bt->bt_sjw > 0 && bt->bt_sjw <= 16);
          DEBUGASSERT(bt->bt_tseg1 > 1 && bt->bt_tseg1 <= 64);
          DEBUGASSERT(bt->bt_tseg2 > 0 && bt->bt_tseg2 <= 16);

          /* Extract bit timing data */
          ntseg1 = bt->bt_tseg1 - 1;
          ntseg2 = bt->bt_tseg2 - 1;
          nsjw   = bt->bt_sjw   - 1;

          nbrp = (uint32_t)
            (  ((float) STM32_FDCANCLK_FREQUENCY /
               ((float)(ntseg1 + ntseg2 + 3) * (float)bt->bt_baud)) - 1 ); // <- div by 0
```

Similarly, another division by zero was found in Artery Technology AT32 (arch/arm/src/stm32/stm32_can.c) driver:

```c
static const struct can_ops_s g_canops =
{
...
  .co_ioctl         = at32can_ioctl,
...
};

static int at32can_ioctl(struct can_dev_s *dev, int cmd, unsigned long arg)
{
...
  /* Handle the command */
  switch (cmd)
    {
...
      case CANIOC_SET_BITTIMING:
        {
          const struct canioc_bittiming_s *bt = (const struct canioc_bittiming_s *)arg;
...
          uint32_t tmp;
          uint32_t regval;

          DEBUGASSERT(bt != NULL);
          DEBUGASSERT(bt->bt_baud < AT32_PCLK1_FREQUENCY); // <- not valid
          DEBUGASSERT(bt->bt_sjw > 0 && bt->bt_sjw <= 4);
          DEBUGASSERT(bt->bt_tseg1 > 0 && bt->bt_tseg1 <= 16);
          DEBUGASSERT(bt->bt_tseg2 > 0 && bt->bt_tseg2 <=  8);

          regval = at32can_getreg(priv, AT32_CAN_BTMG_OFFSET);

          /* Extract bit timing data tmp is in clocks per bit time */
          tmp = AT32_PCLK1_FREQUENCY / bt->bt_baud; // <- div by 0
```

Instances found are listed in the *Location* section below. They are not shown in detail to reduce the length of the issue.

Ensure the attacker-controlled data is properly validated before use, to stop division by zero situations. For instance:

```c
DEBUGASSERT(bt->bt_baud > 0 && bt->bt_baud < AT32_PCLK1_FREQUENCY);
```

* arch/arm/src/stm32/stm32_fdcan.c
* arch/arm/src/stm32/stm32_can.c
* arch/arm/src/sama5/sam_mcan.c
* arch/arm/src/at32/at32_can.c
* arch/arm/src/samv7/sam_mcan.c
* arch/arm/src/stm32f0l0g0/stm32_fdcan.c
* arch/arm/src/stm32f7/stm32_can.c
* arch/arm/src/stm32h5/stm32_fdcan.c
* arch/arm/src/stm32l4/stm32l4_can.c
* arch/arm/src/tiva/common/tiva_can.c
* drivers/can/mcp2515.c

Signed-off-by: Catalin Visinescu <catalin_visinescu@yahoo.com>
2026-06-17 09:01:52 -03:00
raiden00pl
1b600bd282 arch/arm/nrf91: add support for LTE_CMDID_GETCELL
add support for LTE_CMDID_GETCELL ioctl call

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-16 22:43:08 +08:00
raiden00pl
78682572af arch/arm/nrf91: improve LTE_CMDID_GETQUAL handling
1. Don't fail LTE GETQUAL on AT+CSQ error
   The LTE_CMDID_GETQUAL handler queried the modem with AT+CESQ (RSRP/RSRQ)
   and then AT+CSQ (RSSI), returning the result of the last command.

   Set 'valid' only when AT+CESQ parses, treat AT+CSQ as optional, zero
   the metrics up front, and return OK so the caller inspects 'valid'.

2. get SNIR

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-16 22:43:08 +08:00
raiden00pl
18b67b3de8 arch/nrf91: implement LTE PSM/eDRX via the LAPI
Add LTE_CMDID_SETPSM / LTE_CMDID_SETEDRX handling that encodes the requested
PSM (T3412/T3324) and eDRX timers to AT+CPSMS / AT+CEDRXS, so the LTE power
saving modes are controllable through the common LTE API.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-16 22:43:08 +08:00
Jukka Laitinen
7f8f800e63 arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y
Correct build errors when CONFIG_ENABLE_ALL_SIGNALS is not defined

- sched makefiles: Move pending-signal helpers from the ENABLE_ALL_SIGNALS-only
  list to the !DISABLE_ALL_SIGNALS list so signal dispatch is available in
  PARTIAL builds sched: make SIG_PREALLOC_ACTIONS, SIG_ALLOC_ACTIONS and
  SIG_DEFAULT depend on ENABLE_ALL_SIGNALS
- sched: fix ifdefs around pending-signal queue access and signal-mask for
  PARTIAL/DISABLE modes
- arch: gate SYS_signal_handler / _return calls and SYSCALL_LOOKUP(signal)
  with ENABLE_ALL_SIGNALS

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-16 17:07:32 +08:00
Jukka Laitinen
cbfaa7c3b0 drivers/mtd: Make compile time check for sane mtd isbad/markbad configuration
This removes the DEBUGASSERT in ftl_initialize_by_path. Instead, check
compile time that FTL is enabled in case some of the drivers implement
the isbad and markbad functions.

Also select the FTL_BBM for those drivers as they require it.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-16 14:12:44 +08:00
raiden00pl
ba4f774d8c arch/arm/src/common/stm32/Kconfig.i2c: add missing new line
kconfig-frontends doesnt handle missing newlines at the end of the file.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-15 14:44:57 +02:00
Serg Podtynnyi
1282b94792 arch/risc-v/rp23xx-rv: Add SMP support for dual Hazard3
Add SMP support to rp23xx risc-v port

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2026-06-14 22:54:12 +08:00
raiden00pl
704815b233 !arch/stm32n6: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32N6 Kconfig symbols were renamed from CONFIG_STM32N6_* to CONFIG_STM32_*.
Out-of-tree code must update defconfigs and Kconfig references to the new CONFIG_STM32_* names.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
0d78300700 !arch/stm32wl5: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32WL5 Kconfig symbols were renamed from CONFIG_STM32WL5_* to CONFIG_STM32_*.
Out-of-tree code must update defconfigs and Kconfig references to the new CONFIG_STM32_* names.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
4dadf28cfb !arch/stm32wb: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32WB Kconfig symbols were renamed from CONFIG_STM32WB_* to CONFIG_STM32_*.
Out-of-tree code must update defconfigs and Kconfig references to the new CONFIG_STM32_* names.
The custom clock option is a special breaking case that does not follow the family-to-common pattern:
CONFIG_ARCH_BOARD_STM32WB_CUSTOM_CLOCKCONFIG was renamed to CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
a517f9f20e !arch/stm32u5: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32U5 Kconfig symbols were renamed from CONFIG_STM32U5_* to CONFIG_STM32_*.
Out-of-tree code must update defconfigs and Kconfig references to the new CONFIG_STM32_* names.
The custom clock option is a special breaking case that does not follow the family-to-common pattern:
CONFIG_ARCH_BOARD_STM32U5_CUSTOM_CLOCKCONFIG was renamed to CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
4033c54742 !arch/stm32l5: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32L5 Kconfig symbols were renamed from CONFIG_STM32L5_* to CONFIG_STM32_*.
Out-of-tree code must update defconfigs and Kconfig references to the new CONFIG_STM32_* names.
The custom clock option is a special breaking case that does not follow the family-to-common pattern:
CONFIG_ARCH_BOARD_STM32L5_CUSTOM_CLOCKCONFIG was renamed to CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
0d4a9cf1c8 !arch/stm32l4: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32L4 Kconfig symbols were renamed from CONFIG_STM32L4_* to CONFIG_STM32_*.
Out-of-tree code must update defconfigs and Kconfig references to the new CONFIG_STM32_* names.
The custom clock option is a special breaking case that does not follow the family-to-common pattern:
CONFIG_ARCH_BOARD_STM32L4_CUSTOM_CLOCKCONFIG was renamed to CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
624b1cdc7e !arch/stm32h7: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32H7 Kconfig symbols were renamed from CONFIG_STM32H7_* to CONFIG_STM32_*.
Out-of-tree code must update defconfigs and Kconfig references to the new CONFIG_STM32_* names.
The custom clock option is a special breaking case that does not follow the family-to-common pattern:
CONFIG_STM32H7_CUSTOM_CLOCKCONFIG was renamed to CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
ed0c96334c !arch/stm32h5: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32H5 Kconfig symbols were renamed from CONFIG_STM32H5_* to CONFIG_STM32_*.
Out-of-tree code must update defconfigs and Kconfig references to the new CONFIG_STM32_* names.
The custom clock option is a special breaking case that does not follow the family-to-common pattern:
CONFIG_ARCH_BOARD_STM32H5_CUSTOM_CLOCKCONFIG was renamed to CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
c306e4129d !arch/stm32f7: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32F7 Kconfig symbols were renamed from CONFIG_STM32F7_* to CONFIG_STM32_*.
Out-of-tree code must update defconfigs and Kconfig references to the new CONFIG_STM32_* names.
The custom clock option is a special breaking case that does not follow the family-to-common pattern:
CONFIG_STM32F7_CUSTOM_CLOCKCONFIG was renamed to CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
a704a9b8ea arch/stm32: split common Kconfig into per-peripheral files
STM32 common Kconfig into smaller files.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
fa7d383206 arch/stm32: move stm32 and stm32f0l0g0 shared Kconfig options to common
Shared STM32 Kconfig option definitions from the stm32 (F1/F2/F3/F4/G4/L1)
and stm32f0l0g0 (F0/L0/G0/C0) families moved into arch/arm/src/common/stm32.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
f08267ce4c !arch/stm32f0l0g0: use common STM32 Kconfig symbols
BREAKING CHANGE: STM32F0/L0/G0/C0 Kconfig symbols were renamed from
CONFIG_STM32F0L0G0_* to CONFIG_STM32_*. Out-of-tree code must update defconfigs
and Kconfig references to the new CONFIG_STM32_* names.

The custom clock option is a special breaking case that does not follow the
family-to-common pattern:

CONFIG_ARCH_BOARD_STM32F0G0L0_CUSTOM_CLOCKCONFIG was renamed to CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
c22a3d67d6 arch/stm32: add common STM32 Kconfig support
Add the shared STM32 Kconfig include and introduce the hidden
common ARCH_CHIP_STM32 selector used by concrete STM32 families.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 11:35:31 -03:00
raiden00pl
3271a44138 boards/nrf91/thingy91: ARCH_HAVE_IRQBUTTONS support
select ARCH_HAVE_IRQBUTTONS so ARCH_IRQBUTTONS can be enabled.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 08:50:18 -03:00
raiden00pl
a4c4774612 arch/nrf91: grant GPIOTE1 to the non-secure domain
Add CONFIG_NRF91_GPIOTE1_NS so the secure firmware can hand the non-secure
GPIOTE instance to the application, allowing a non-secure app to use GPIO
interrupts.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 08:50:18 -03:00
raiden00pl
5976e86c6b arch/nrf91: add GPIOTE driver
Port the GPIOTE driver from nrf53, which shares the same secure/non-secure
TrustZone split. The non-secure application uses GPIOTE1 (the register base
and interrupt are selected by the build security domain). This provides GPIO
edge interrupts, e.g. for board buttons.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 08:50:18 -03:00
raiden00pl
f9912abf5f arch/nrf91: expose GNSS priority as a control ioctl
Coexistence policy does not belong in the driver. Replace the in-driver
priority-boost arbitration (the NRF91_MODEM_GNSS_BOOST_PRIO knob and the
NOT_ENOUGH_WINDOW_TIME counter heuristic) with a user space mechanism:
SNIOC_GNSS_SET_PRIORITY toggles nrf_modem_gnss priority mode on request,
leaving the when-to-use-it decision to the application.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 08:46:46 -03:00
raiden00pl
3a8d4ba3dd arch/nrf91: convert GNSS UTC time with timegm() not mktime()
The GNSS datetime reported by the modem is UTC. mktime() interprets the
broken-down time as local time, so a configured timezone would skew the
reported epoch. Use timegm() to convert it directly as UTC.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 18:53:15 +08:00
raiden00pl
2bcc59b42f arch/nrf91: defer GNSS start until the modem is GNSS-capable
When the GNSS sensor is opened before the LTE stack has powered the modem
on, the modem is not yet in a GNSS-capable functional mode. Instead of
failing the activate with -EACCES, remember the request (priv->pending)
and let the GNSS thread poll the modem functional mode (AT+CFUN?) and
start GNSS once it becomes GNSS-capable. The LTE stack keeps ownership of
modem power.

Extract the configure/start sequence into nrf91_gnss_start() so it can be
used both from nrf91_gnss_enable() and from the thread's CFUN poll.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-14 18:53:15 +08:00
raiden00pl
80312dbb2d !arm/stm32wl5: standardize public API/type prefix to stm32_
BREAKING CHANGE: Public STM32WL5 interfaces were renamed from stm32wl5_*
forms to canonical stm32_* forms across arch and board headers/sources.

Public type names in STM32WL5 timer/GPIO/EXTI and related API-facing
declarations were normalized to stm32_* equivalents.

The STM32WL5 root family header was renamed from stm32wl5.h to stm32.h;
all STM32WL5 arch/board includes were updated accordingly.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
raiden00pl
6e7db8dada !arm/stm32wb: standardize public API/type prefix to stm32_
BREAKING CHANGE: Public STM32WB interfaces were renamed from stm32wb_*
forms to canonical stm32_* forms across arch and board headers/sources.

Public type names in STM32WB timer/dma/freerun/oneshot/GPIO/EXTI and
related API-facing declarations were normalized to stm32_* equivalents.

The STM32WB root family header was renamed from stm32wb.h to stm32.h;
all STM32WB arch/board includes were updated accordingly.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
raiden00pl
60dffa1004 !arm/stm32l5: standardize public API/type prefix to stm32_
BREAKING CHANGE: Public STM32L5 interfaces were renamed from stm32l5_* forms
to canonical stm32_* forms across arch and board headers/sources.

Public type names in STM32L5 timer/GPIO/EXTI and related API-facing
declarations were normalized to stm32_* equivalents.

The STM32L5 root family header was renamed from stm32l5.h to stm32.h;
all STM32L5 arch/board includes were updated accordingly.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
raiden00pl
bc41d984cc !arm/stm32l4: standardize public API/type prefix to stm32_
BREAKING CHANGE: Public STM32L4 interfaces were renamed from stm32l4_* forms to
canonical stm32_* forms across arch and board headers/sources.

Public type names were normalized to stm32_*
equivalents (including timer/lptimer/dma/freerun API-facing types), and
stm32l4can_initialize() was renamed to stm32_caninitialize().

The STM32L4 root family header was renamed from stm32l4.h to stm32.h;
all STM32L4 arch/board includes were updated accordingly.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
raiden00pl
fe42e755a1 !arm/stm32h7: standardize public API prefix to stm32_
BREAKING CHANGE: Public STM32H7 APIs were renamed from stm32h7_*
forms to canonical stm32_* forms.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
raiden00pl
8ece56ff11 !arm/stm32h5: standardize public API prefix to stm32_
BREAKING CHANGE: Public STM32H5 APIs were renamed from stm32h5_*
forms to canonical stm32_* forms.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
raiden00pl
3490eec26d !arm/stm32f7: standardize public API prefix to stm32_
BREAKING CHANGE: Public STM32F7 APIs were renamed from stm32f7_*
and stm32f7x9_* forms to canonical stm32_* names.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
Kerogit
0b5bf6c2c5 arch/avr/src/avrdx/avrdx_delay: add custom up_udelay function
NuttX builtin up_udelay function uses BOARD_LOOPSPERMSEC configuration
value to determine how many loops need to be done to cause requested
delay. This does not match well with AVR DA/DB microcontrollers
because the CPU clock frequency is configurable.

A board configuration could therefore provide BOARD_LOOPSPERMSEC
valid for one frequency but for other frequencies, the user would
be required to calibrate the value and would still get incorrect
result when changing the clock speed during runtime.

This patch therefore implements dynamic architecture-specific
up_udelay function which determines current clock settings
and infers required loop count from that.

New function was tested by simple application that used up_udelay
to put delays between printf calls.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
Kerogit
10dea61e23 arch/avr/src/avrdx: add support for reading CPU clock from other sources
This patch adds support for reading CPU clock frequency when the MCU
is driven by clock source other than high frequency oscillator.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
Kerogit
689ed188c6 sched/clock/clock_delay: added config flag to remove weak up_udelay
While attempting to create architecture-specific implementation
of up_udelay, it was discovered that the overriding function is not
included in the final binary, the weak implementation was used instead.

Further investigation and experimentation showed that the linker
only overrides the weak implementation with the custom one if
the custom one is present in a .c source file that contains at least
one other function that is called from somewhere. Some additional
testing revealed that at least one other already present up_udelay
override (rv32m1-vega:nsh) is affected by this.

In a short mailing list discussion it was determined that this
is a likely result of using static libraries during the build process
and it was suggested to introduce configuration option that will
exclude weak implementations of the function from the build altogether.
This patch does that.

This patch does not enable this configuration option for any existing
board/chip because doing so would change its behaviour and needs
to be tested by users of the hardware.

Also changed is the static assertion in sched/clock/clock_delay.c
to not prevent building the code when architecture declares that
it does not use BOARD_LOOPSPERMSEC to determine required loop count.
BOARD_LOOPSPERMSEC is made undefined in such case.

Patch was tested by building breadxavr:nsh (identical binary by SHA256),
rv32m1-vega:nsh (identical text section) and rv-virt:nsh (text section
differs because of different ordering of functions in the binary, ostest
passed though.)

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
Kerogit
a7352902ae arch/avr/src/avrdx: fix Make.defs when CONFIG_ENABLE_ALL_SIGNALS unset
This patch amends commit dfd3426aa5 which added support for running
with some signals disabled to AVR architecture. AVR DA/DB architecture
was not covered by the commit and failed to build
with CONFIG_ENABLE_ALL_SIGNALS unset (which includes building
with CONFIG_ENABLE_PARTIAL_SIGNALS, the default value.)

Change is replicated from the commit and tested by a custom stress
application which spawns some always-busy threads and uses preemptive
multitasking to switch between them. Additionally, ability to sleep
in the application was tested by a simple LED blinking application.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
raiden00pl
a788e3d436 !arch/stm32n6: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32N6 non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00