Skip to content

Commit

Permalink
Slow down CP2102 baud rate to 921600
Browse files Browse the repository at this point in the history
It seems some chip variants or drivers don't like 1M baud and only
accept 921600 baud.
  • Loading branch information
sultanqasim committed May 6, 2024
1 parent a3f6ebb commit e8346c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ the compiled `sniffle.out` binary using the UniFlash GUI.
## Firmware Installation (SONOFF USB Dongle)

To install Sniffle on a SONOFF CC2652P dongle (equipped with a CP2102 USB/UART
adapter), you need to use a special firmware build that uses a 1 megabit baud rate
instead of the default 2 megabit baud rate. You can use
adapter), you need to use a special firmware build that uses a 921600 baud rate
(labelled 1M) instead of the default 2 megabit baud rate. You can use
[JelmerT/cc2538-bsl](https://github.com/JelmerT/cc2538-bsl) to flash the firmware
using the built-in ROM bootloader with the following command:

Expand Down
2 changes: 1 addition & 1 deletion fw/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
UART2_Handle uart;

#ifdef UART_1M_BAUD
static const uint32_t BAUD_RATE = 1000000;
static const uint32_t BAUD_RATE = 921600;
#else
static const uint32_t BAUD_RATE = 2000000;
#endif
Expand Down
2 changes: 1 addition & 1 deletion python_cli/sniffle_hw.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self, serport=None, logger=None, timeout=None):
if serport is None:
serport = find_xds110_serport()
elif is_cp2102(serport):
baud = 1000000
baud = 921600

self.timeout = timeout
self.decoder_state = SniffleDecoderState()
Expand Down

0 comments on commit e8346c7

Please sign in to comment.