Skip to content

Instantly share code, notes, and snippets.

View jeremyherbert's full-sized avatar
🦆
🪿

Jeremy Herbert jeremyherbert

🦆
🪿
View GitHub Profile
@mironovdm
mironovdm / LE_autoconnect_timeout.md
Last active September 24, 2023 00:20
Change LE autoconnect timeout

This tool can read current or change default HCI_LE_AUTOCONN_TIMEOUT value for Bluetooth adapter on Linux. The default value is defined for the kernel 5.15 at include/net/bluetooth/hci.h:

#define HCI_LE_AUTOCONN_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */

and it can be too low if the advertising interval for a device is high (for power saving).

You can also change the value in /etc/bluetooth/main.conf, line LEAutoconnecttimeout. The value in ms and will be applied at boot or when bluetooth service is restarted.

The tool changes timeout to hardcoded value 16000ms. You can change value NEW_LE_AUTOCONN_TIMEOUT in the lower source file to required value .

@rikka0w0
rikka0w0 / ft2232_to_digilent_jtag.md
Last active April 23, 2024 14:05
FT2232 to Digilent JTag for Xilinx FPGAs (ISE/Vivado)

The Digilent JTag uses FT2232, but its configuration EEPROM contains secrete data needed to be recoginzed by Xilinx ISE/Vivado. The following method only works on linux (tested on Ubuntu16.04), but the patched FT2232 doggle also works on Windows. Since WSL1 does not provide USB device access, the following method will not work for WSL1.

DONT use FT_Prog on offical Digilent cable, as it can trash the firmware! The offical eeprom contains secrete data that cannot be handled correctly by FT_Prog.

Here are steps to create a Digilent-like Jtag that can be used in Xilinx ISE and Vivado

  1. Install softwares: sudo apt-get install libftdi1 ftdi-eeprom
  2. Create a file "flash_digilent.conf" with the following content: