Commit Graph
22914 Commits
Author SHA1 Message Date
Niel Nielsen cac9e2d4cc Implement OTA abort handling in cmdhw.c
Added logic to restore fast link and log OTA abort action on firmware update failure.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 10:59:52 +02:00
Niel Nielsen 339f528bba Refactor BWM firmware upgrade process
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 10:45:06 +02:00
Niel Nielsen 0dfcb72206 Enhance documentation for OTA write function
Added comments to clarify OTA write behavior and timeout handling.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 10:44:08 +02:00
Niel Nielsen d4427d3da5 Adjust OTA timeouts and restore log forwarding
Increased timeout values for OTA write and end commands, and restored log forwarding after OTA.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 10:21:42 +02:00
Niel Nielsen 01f03609e4 Update bwm_wifi.h
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:53:09 +02:00
Niel Nielsen 0b936d2610 Enhance logging during OTA for better diagnostics
Added logging for ESP output during OTA process to aid in debugging.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:52:51 +02:00
Niel Nielsen 8a27354d4b Refactor OTA response handling for clarity
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:44:45 +02:00
Niel Nielsen 39e2117114 Improve error handling in bwm_wifi.c
Handle error reporting for failed commands and update reboot command handling.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:43:05 +02:00
Niel Nielsen cf239b35b9 Fix missing newline at end of appmain.c
Add missing newline at the end of the file

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:38:50 +02:00
Niel Nielsen c3c8aab875 Add reboot command for OTA process
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:34:36 +02:00
Niel Nielsen 120ab95ddc Enhance CMD_ERROR handling and add reboot function
Added error handling for CMD_ERROR broadcasts and implemented bwm_esp_reboot function.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:34:16 +02:00
Niel Nielsen 516f11a351 Trigger reboot after successful OTA end
Added reboot call after successful OTA finalization.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:33:29 +02:00
Niel Nielsen 4fde8a0aa7 Implement overflow check in OTA write handling
Added defensive checks for OTA write operation to prevent overflow.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:17:46 +02:00
Niel Nielsen eb34578ea9 Refine maxchunk size calculation in cmdhw.c
Updated maxchunk calculation to consider BWM_OTA_CHUNK_MAX.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:17:09 +02:00
Niel Nielsen e5ed0d52e1 Add BWM OTA chunk size definition
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:16:21 +02:00
Niel Nielsen 9c257e40d6 Add OTA commands for ESP firmware updates
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:06:44 +02:00
Niel Nielsen 9c3732c9d6 Enhance comments in bwm_wifi.c for clarity
Added comments to clarify the behavior of WiFi disable and OTA functions.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:06:23 +02:00
Niel Nielsen efc01cd2f5 Delete armsrc/bwm wifi.h
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:05:57 +02:00
Niel Nielsen 85e0e5b58f Delete armsrc/bwm wifi.c
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:05:33 +02:00
Niel Nielsen daaf9ca536 Add OTA handling for ESP32 in appmain.c
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 09:02:37 +02:00
Niel Nielsen 6df7d90236 Remove CMD_PM5_BWM_ESP_OTA handling
Removed BWM OTA command handling from appmain.c

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 08:59:05 +02:00
Niel Nielsen 229e89ef50 Add OTA handling for BWM ESP commands
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 08:57:12 +02:00
Niel Nielsen efed954b25 Update maxchunk calculation to use g_conn structure
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 08:20:33 +02:00
Niel Nielsen bb42ca8ca7 Remove unused include for comms.h
Removed unused comms.h include from cmdhw.c

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 08:03:06 +02:00
Niel Nielsen b6a1e0caf8 Add function prototype for pm3_max_cmd_data_size
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 07:20:03 +02:00
Niel Nielsen ed8fa3bd04 Remove unused function declaration
Removed unused function declaration for pm3_max_cmd_data_size.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 07:19:02 +02:00
Niel Nielsen 9cf3960f47 Declare pm3_max_cmd_data_size function
Added a new function declaration for pm3_max_cmd_data_size.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 07:11:35 +02:00
Niel Nielsen 4860890b5e Add comms.h include to cmdhw.c
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 07:10:42 +02:00
Niel Nielsen e89c30eeba Update length check for command data size
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 07:06:38 +02:00
Niel Nielsen a0573bf3cc Update pm3_cmd.h
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 07:04:56 +02:00
Niel Nielsen 36d6535d7a Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 06:40:39 +02:00
Niel Nielsen 7ddf3f94f9 Merge branch 'RfidResearchGroup:master' into BWM-work 2026-09-03 06:36:17 +02:00
Niel Nielsen 50b0259978 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 06:36:07 +02:00
Niel Nielsen 1d80a4164a Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-03 06:34:49 +02:00
Iceman feae212f3d Merge pull request #3586 from Msprg/pm5-android-ble-doc
Docs: Add PM5 BWM BLE connection instructions
2026-09-03 09:41:52 +07:00
Msprg d3bf03f3e3 Docs: Add PM5 BWM BLE connection instructions 2026-09-03 01:41:54 +02:00
Msprg 22e9b37b9f armsrc: resync BWM link baud after an AT32-only reset
The ESP keeps its negotiated UART baud (921600) across a bootloader round
trip, hw reset or flash, while the AT32 restarts at the boot baud (460800)
and its baud-set request is then garbage to the ESP. The link stayed at
460800 and every BWM command failed until the module lost power.

Probe GET_UART_BAUD at both rates on boot and adopt the one the ESP answers
at; only run the set-baud handshake when it really is at the boot baud.
2026-09-03 01:02:38 +02:00
Iceman 710a1968e9 Merge pull request #3584 from nieldk/BWM-work
Enhance bwm_wifi_forward_down for better disable confirmation
2026-09-02 23:44:39 +07:00
Niel Nielsen 6526d2ce48 Refactor comment in bwm_wifi_forward_down
Simplified comment in bwm_wifi_forward_down function.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 18:32:06 +02:00
Niel Nielsen cac3f6dc0a Enhance bwm_wifi_forward_down for better disable confirmation
Refactor bwm_wifi_forward_down to confirm WiFi disable success by polling connect status.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 15:26:03 +02:00
Iceman 89c0682990 Merge pull request #3583 from nieldk/BWM-work
Improve BLE negitiation and corrected wifi status
2026-09-02 20:06:40 +07:00
Iceman 1d97fda4b4 Merge pull request #3582 from Msprg/pm5-fix-lowbatt-shutdown-vusb
PM5 low-batt shutdown: gate power-off on VUSB pin, not charger PG bit
2026-09-02 20:05:31 +07:00
Niel Nielsen 8d8fa8733a Update length check for command data size
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:52:39 +02:00
Niel Nielsen bfb8167cbc Refactor CMD_MEASURE_ANTENNA_TUNING_HF case structure
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:46:01 +02:00
Niel Nielsen eb9e6949ab Enhance BWM WiFi status reporting and logging
Refactor BWM WiFi status handling and improve logging messages.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:42:49 +02:00
Niel Nielsen 0c7688dd40 Update bwm_wifi_forward_status function signature
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:40:47 +02:00
Niel Nielsen 5a3e6cbaa1 Refactor bwm_wifi_forward_status function parameters
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:40:22 +02:00
Niel Nielsen b211a92a3a Add BWM_CMD_GET_UART_BAUD definition
Added a new command to get the current UART baud rate from the ESP.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:24:29 +02:00
Niel Nielsen a3b4767ff6 Enhance UART baud negotiation and acknowledgment
Added acknowledgment handling for GET_UART_BAUD command and improved baud negotiation logic.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:24:03 +02:00
Msprg 9f2fd682e5 PM5 low-batt shutdown: gate power-off on VUSB pin, not charger PG bit
The critical-shutdown path in bwm_lowbatt_check() was reached whenever the
AW32001 System Status "power good" bit was clear. On this hardware that bit reads
"power fail" even while the board is USB-powered under HF load (hw status shows
power fail + ~400 mA discharge on PC USB), so a low pack could trip the latched
power-off - Gpio_ARM_Power_ON_Low() + while(1) - while USB keeps the MCU alive,
leaving it spinning.

Confirm the cable really is out via the dedicated VUSB sense pin (Gpio_VUSB_Read,
the same source WITH_PM5_AUTOOFF uses) before powering off; if USB is present,
clear the streak and keep running. Also print a reason before cut-off, and fix a
brace/formatting glitch on the trigger condition.
2026-09-02 14:16:27 +02:00