Define target baud rate for UART negotiation

Added target baud rate for UART negotiation and updated comments.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
This commit is contained in:
Niel Nielsen
2026-08-31 08:41:40 +02:00
committed by GitHub
parent 444d27b05d
commit da0a5a6ac0
+18 -2
View File
@@ -14,11 +14,27 @@
#include "common.h"
#define BWM_UART_BAUD 460800
// Boot/default baud. Must match UART_BAUD_RATE_DEFAULT in the ESP firmware
// (Proxmark5_BWM_esp32). The link comes up here, then the ARM negotiates up to
// BWM_UART_BAUD_TARGET at runtime via app_com cmd 1011 - the ESP is designed to
// be told, not reflashed (the SET command is explicitly non-persistent).
#define BWM_UART_BAUD 460800
// Target baud to negotiate after link-up. 0 disables negotiation (stay at
// BWM_UART_BAUD). Bounded by the ESP's CONFIG_SOC_UART_BITRATE_MAX and PA0/PA1
// signal integrity; validate on hardware before raising further.
#ifndef BWM_UART_BAUD_TARGET
#define BWM_UART_BAUD_TARGET 921600
#endif
void bwm_uart_init(void);
void UART4_IRQHandler(void);
// Re-init UART4 + RX DMA at a new baud (used by the runtime baud negotiation).
// Discards any bytes already in the RX ring.
void bwm_uart_set_baud(uint32_t baud);
// Baud the link is currently running at (updated by bwm_uart_set_baud).
uint32_t bwm_uart_get_baud(void);
int bwm_uart_write(const uint8_t *data, size_t len);