12551 Commits

Author SHA1 Message Date
Dario Nieuwenhuis
0c6b5fc3f1 stm32/timer: correct interrupt clearing.
SR is "write 0 to clear". Using `.modify()` is wrong since it will accidentally
clear interrupts that happened between the read and write.

Correct way is to write all ones except zero in the bit we want to clear. It's also faster.
2026-01-13 16:20:16 +01:00
Dario Nieuwenhuis
8abb6ab381
Merge pull request #5216 from embassy-rs/usb-dfu-2
usb: add standalone dfu class implementation, use it in embassy-usb-dfu.
2026-01-13 13:39:04 +00:00
xoviat
f65dcfc2ce
Merge pull request #5219 from xoviat/opt
stm32: optimize psc codegen
2026-01-12 23:45:41 +00:00
xoviat
d24f7ffc1e stm32: optimize psc codegen 2026-01-12 17:36:23 -06:00
Dario Nieuwenhuis
9346115edf usb: add standalone dfu class implementation, use it in embassy-usb-dfu. 2026-01-12 18:34:58 +01:00
xoviat
6e6ade5fc5
Merge pull request #5217 from xoviat/low-power
stm32/low-power: small cleanup
2026-01-12 17:31:08 +00:00
xoviat
945a79820f stm32/low-power: small cleanup 2026-01-12 11:21:30 -06:00
James Munns
10150a5b75
Merge pull request #5215 from jamesmunns/james/robust-e-timer
[MCXA]: Don't read OsTimer before initialization
2026-01-12 16:25:03 +00:00
James Munns
4c14cadef6 Don't read OsTimer before initialization
If we attempt to read the OsTimer prior to it being initialized, some
kind of fault will occur.

https://github.com/embassy-rs/embassy/pull/5179 introduced a regression by
enabling the `defmt-timestamp-uptime` feature, which caused prints in the
SPLL setup to get the timestamp, causing a crash.

As a mitigation, we just return a time of zero until the OsTimer has actually
been initialized.
2026-01-12 17:05:20 +01:00
xoviat
da013fd49e
Merge pull request #5156 from liebman/stm32wl5x-low-power-both-cores
stm32wl5x low-power both cores (STOP2) also lptim time driver!
2026-01-12 15:22:14 +00:00
liebman
93709175c7 fix: revert init_hsem change for stm32wb 2026-01-11 11:19:04 -08:00
liebman
2a8961af2f fix: RTC low-power cfg's and insure peripherals_clocked if time driver is lptimX with LSE 2026-01-11 10:49:03 -08:00
xoviat
27aa24bcae
Merge pull request #5210 from leftger/feat/wba-ble-phase1
feat(stm32wba): Implement Phase 1 BLE stack with HCI, GAP, and GATT
2026-01-11 00:23:17 +00:00
Gerzain Mata
cbfe86928b feat(stm32wba): Implement Phase 1 BLE stack with HCI, GAP, and GATT
This commit implements Phase 1 of the BLE stack for STM32WBA, providing basic BLE peripheral functionality with advertising support.

- Complete HCI command interface with direct C function calls
- Command implementations: reset, read version, set event masks, BD address
- LE controller commands: advertising parameters, data, enable/disable
- Event parsing with support for CommandComplete, CommandStatus, ConnectionComplete, etc.
- Event channel for async event delivery
- Status code mapping and error handling

- Advertiser implementation with configurable parameters
- Advertising data builder with AD type formatting
- Support for flags, device name, and service UUIDs
- Scan response data support
- Start/stop advertising control

- Basic GATT server using ST's C implementation
- Service and characteristic creation
- Support for 16-bit and 128-bit UUIDs
- Characteristic properties: READ, WRITE, NOTIFY
- Characteristic value updates
- Event mask configuration

- High-level Ble struct with initialization
- Automatic controller reset and configuration
- Version info reading and validation
- Feature detection (buffer sizes, supported features)
- Integration with existing link layer and platform code

- Added BLEPLAT_Init() and BLEPLAT_RngGet() for BLE stack requirements
- RNG integration for random number generation
- Proper integration with existing hardware abstraction

- Added Cargo features for BLE stack library selection (basic, basic_plus, full, etc.)
- Added link layer library features (ble-basic, ble-full, peripheral-only, etc.)
- Fixed function name mismatches using #[link_name] attributes (uppercase C symbols)
- Proper unsafe extern block declarations

- Manual defmt::Format implementations for types with heapless::Vec
- Proper pointer type casting for array pointers
- Fixed all HCI function signatures to match C library

- Custom BleError enum with HCI status code mapping
- Result-based API throughout
- Proper validation of parameters (advertising data length, etc.)

Added :
- Complete BLE peripheral example
- Initializes BLE controller
- Creates GATT service with characteristics
- Starts advertising as "Embassy-WBA"
- Ready for testing with BLE scanner apps

- Added BLE stack library features
- Added link layer library features for WBA5x chips

- Enabled ble-stack-basic and linklayer-ble-basic features
- Changed default to BLE-only (removed MAC to avoid conflicts)

Successfully builds for thumbv8m.main-none-eabihf target.
Binary size: ~4.6MB (with debug info).

Unlike WB55 which uses IPCC for dual-core communication, WBA is single-core and uses direct C function calls to the BLE stack. This simplifies the implementation but requires careful linking of the ST BLE stack libraries.

- Full GATT server implementation
- Connection management
- BLE Central role (scanner, initiator)
- Security Manager (pairing/bonding)
- L2CAP connection-oriented channels
- Extended advertising (BLE 5.0+)

Implements Phase 1 of the plan outlined in feat/wpan-continued-work branch.
Estimated completion: 40% of full BLE stack.
2026-01-10 16:48:50 -07:00
Gerzain Mata
817f2da6ae WIP of wba6 mac_ffd example 2026-01-10 16:31:42 -07:00
xoviat
8b73fc9cee
Merge pull request #5209 from leftger/feat/wba6-add-sai
stm32wba6: add SD-to-SAI PCM/WAV example
2026-01-10 22:45:47 +00:00
Gerzain Mata
109ec7ef61 stm32wba6: add sd-to-sai audio example 2026-01-10 14:20:39 -07:00
Gerzain Mata
aaf135d27d stm32wba6: add PCM conversion helpers and docs 2026-01-10 14:16:15 -07:00
liebman
2edd930138 stm32wl: cleanup examples 2026-01-10 10:01:43 -08:00
xoviat
153e994b9d
Merge pull request #5208 from adamgreig/stm32-usb-af
STM32: USB: Only set pins to AF on chips where the USB signals have an AF mapping
2026-01-10 16:51:20 +00:00
liebman
62a91ae5e0 low-power: create trait for low-power specific time driver functions 2026-01-10 08:14:39 -08:00
Adam Greig
7ec3bab1d1
STM32: USB: Only set pins to AF on chips where the USB signals have an AF mapping 2026-01-10 15:56:54 +00:00
liebman
daf8b8c3b6 stm32wl lptiem driver support other clock sources 2026-01-09 15:20:30 -08:00
Felipe Balbi
cc18521867
Merge pull request #5198 from felipebalbi/mcxa/ostimer
[MCXA] ostimer: pull driver from embassy-imxrt
2026-01-09 22:11:47 +00:00
Felipe Balbi
7fbbde2c04
Merge pull request #5196 from felipebalbi/mcxa/static-info
[MCXA] make all `struct Info` a static reference
2026-01-09 22:11:35 +00:00
liebman
bb86ad94df stm32wlex: implement lptim time driver 2026-01-09 14:08:11 -08:00
Felipe Balbi
608152d8f3
Merge pull request #4673 from felipebalbi/microchip
Add embassy-microchip HAL
2026-01-09 19:38:37 +00:00
Felipe Balbi
f3a7839cc8 [MICROCHIP] Add missing drivers to microchip.adoc 2026-01-09 09:58:10 -08:00
Kurtis Dinelle
ad85e943a5 [MICROCHIP] Implement TACH driver 2026-01-09 09:58:10 -08:00
Felipe Balbi
5e30c73c60 [MICROCHIP] Add embassy-microchip HAL 2026-01-09 09:58:06 -08:00
xoviat
999dee949b
Merge pull request #5204 from northernpaws/mem-to-mem
Extend STM32 DMA interface with memory-to-memory transfer functionality
2026-01-09 15:34:45 +00:00
Felipe Balbi
bbfd35567d
Merge pull request #5200 from felipebalbi/mcxa/trng
[MCXA]: trng: impl `BlockRngCore` trait
2026-01-09 14:45:27 +00:00
Kat
4f75488667 cargo fmt 2026-01-09 01:38:32 -07:00
Kat
66b3b9f996 make caller pass in the DMA channel in line with upstream changes 2026-01-09 01:36:37 -07:00
Kat
03fa150b2f cargo fmt 2026-01-09 01:31:26 -07:00
Kat
42722e1b14 add panics for GPDMA memory-to-memory 2026-01-09 01:29:58 -07:00
Kat
6fecb2cd53 add doc comments on Increment 2026-01-09 01:26:33 -07:00
Kat
850e861227 remove leftover comment from testing 2026-01-09 01:23:38 -07:00
Kat
f38b718df4 explicitly set minc and pinc to none 2026-01-09 01:11:35 -07:00
Kat
b431328143 add new increment type to bdma 2026-01-09 01:11:35 -07:00
Kat
1c8d87f47b add other missing increment parameter to other constructor 2026-01-09 01:11:35 -07:00
Kat
bb82eed189 add missing increment parameter to constructor 2026-01-09 01:11:35 -07:00
Kat
c57760c0e4 add parameter for peripheral memory increment 2026-01-09 01:11:35 -07:00
Kat
ee365cf7f4 fix using channel after move 2026-01-09 01:11:35 -07:00
Kat
73e353f58c don't think that cast was needed... 2026-01-09 01:11:35 -07:00
Kat
04876bffdd does dyn fix it? 2026-01-09 01:11:35 -07:00
Kat
56a3bf2a8f fix missing import for DMA channel 2026-01-09 01:11:35 -07:00
Kat
1fe5479128 create request from channel ID 2026-01-09 01:11:35 -07:00
Kat
24955958ed add raw and non-raw typed slice memory-to-memory constructors 2026-01-09 01:11:35 -07:00
Kat
78cc9261af add missing mut to destination address 2026-01-09 01:11:35 -07:00