ajout BLE

This commit is contained in:
thomas committed 2026-10-24 00:14:53 +02:00
1 parent 66bb319423
commit 3757975e51
48 files changed
+293826 -284536

No files matched your search

+15
View File
@@ -159,6 +159,21 @@ STM32CubeIDE alternative: debug Boot, terminate (Ctrl+F2), debug Appli, Resume (
- **SPI** - Touch interface
- **GPIO** - Touch interrupt (TP_IRQ)
## Remote Control (BLE, X-NUCLEO-67W61M1)
The effects can be driven from a phone/PC over BLE through the ST67W611M1 shield (SPI4, Arduino header). Wi-Fi (MQTT/HTTP) is the next step; **audio streaming to Bluetooth speakers is not possible** with this module (BLE GATT only, no A2DP/Classic, no LE Audio) - use an external A2DP transmitter on the headphone jack if needed (adds 100-250 ms of latency).
Layers (all hand-written, regeneration-safe):
- `Appli/Core/Src/remote_params.c` + `Inc/remote_params.h`: transport-independent table of 34 parameters (id byte -> field of `AudioEffects_GetParams()`, scale, range). Unit-testable on PC.
- `Appli/Core/Src/remote_ble.c` + `Inc/remote_ble.h`: FreeRTOS task `remoteBle` (BelowNormal, 3 KB stack) started by `RemoteBle_Start()` from the `RTOS_THREADS` user section of `main.c`. GATT service `c3110000-7e8a-4b1c-9d52-f0a1e4b7c600`, `Control` char (`...0001`, write) and `State` char (`...0002`, notify). Records are `[id u8][value i16 LE]`; id `0xFF` requests a snapshot (also sent when the client subscribes). Full protocol in the header comment.
- `Appli/Core/Src/st67_glue.c`: `vLoggingPrintf` (the driver's Logging component is not selected, there is no UART) writes INFO/WARN/ERROR into the RAM ring `st67_log_ring` (4 KB, read it in the debugger; `st67_log_head` = next write position), and `ST67_ExtiCallback()` forwards the `SPI_RDY` edges (hooked in `STM32TouchController.cpp`, the only `HAL_GPIO_EXTI_Callback`).
- `Appli/ST67W6X_Network_Driver/Target/spi_port.c` (generated by the pack): only `USER CODE` sections were edited (pin-name aliases `CHIP_EN_*`/`SPI_CS_*`, and **CS driven low at init**: the driver treats CS as active-high, ST's example idles it low; CubeMX leaves it high).
- Build: `gcc/makefile_appli` compiles the driver (`Middlewares/ST/ST67W6X_Network_Driver`, Core + W61_at + W61_bus) with `-DST67_ARCH=W6X_ARCH_T01`.
**NCP firmware**: the ST67W611M1 must run the "mission profile T01" firmware of the pack (UM3449 step 4), otherwise the SPI header is rejected (symptom: `Invalid magic 0x5501`, logged in `st67_log_ring`; the module answers `01 55 00 00 00 00 01 00` to `AA 55 00 ...`). ST's scripts only support a few NUCLEO hosts, so the DK acts as the UART bridge: `gcc/ncp_loader/main.c` (port of ST's NCP_Loader: bit-level copy VCP UART4 PD0/PD1 <-> module UART PE7/PE8, BOOT PD15 / CHIP_EN PD13 to enter the ROM download mode) built by `gcc/makefile_ncp_loader`, driven by `gcc/ncp_update.sh [version] [--yes]` (compiles the bridge, loads it in place of Boot, flashes the module with the pack's `QConn_Flash_Cmd-ubuntu` at 2 Mbaud, then restores Boot with `gcc/flash.sh boot`; Appli in external flash is untouched). Bridge validated on the board with the read-only `QConn_Eflash -r` (handshake + eFuse read OK). The module is already locked (eFuse public key filled, JTAG disabled). Needs a free ST-Link (no debug session) and the X-NUCLEO on the Arduino header.
Not validated on hardware yet. Things to check first: the FreeRTOS heap (50 KB in `DTCM_RTOS`, region is 52 KB, ~94 % used at link time: the driver allocates its tasks/queues there - `st67_log_ring` records the free heap after start-up), solder bridges SB3/SB6/SB12/SB20 closed on the shield (UM3449 lists them OFF by default, which would leave the Arduino SPI pins unconnected), JP1/JP2 fitted. Pairing is "Just Works": anyone in range can control the effects.
## Audio Processing
### Effects Chain (in order)