1# 2# Makefile to download and convert TI's CC256x Service Pack .bts files from BlueKitchen mirror 3# https://e2e.ti.com/support/wireless_connectivity/bluetooth_cc256x/f/660/p/560523/2056007#2056007 4# 5# Original sources: 6# TI Processor Wiki https://web.archive.org/web/20210114141711/https://processors.wiki.ti.com/index.php/CC256x_Downloads 7# TI Git Repo: https://git.ti.com/cgit/ti-bt/service-packs/blobs/raw/a027ae390d8790e56e1c78136c78fe6537470e91 8 9BLUEKITCHEN_URL = https://bluekitchen-gmbh.com/files/ti/service-packs 10CONVERSION_SCRIPT=$(BTSTACK_ROOT)/chipset/cc256x/convert_bts_init_scripts.py 11 12# First generation CC2560 - AKA TIInit_6.2.31.bts 13 14# v2.44 - file part of .zip archive 15 16CC2560_BT_SP_BTS.zip: 17 @echo "Downloading $@" 18 @curl -sS -O $(BLUEKITCHEN_URL)/CC2560_BT_SP_BTS.zip 19 20bluetooth_init_cc2560_2.44.bts: CC2560_BT_SP_BTS.zip 21 @echo "Extracting $@" 22 @unzip -q -j -o CC2560_BT_SP_BTS.zip CC2560_BT_SP_BTS/bluetooth_init_cc2560_2.44.bts 23 24# Second generation CC2560A and CC2564 - AKA TIInit_6.6.15.bts 25 26# v2.14 - files part of .zip archive 27 28CC2560A_BT_SP_BTS.zip: 29 @echo "Downloading $@" 30 @curl -sS -O $(BLUEKITCHEN_URL)/CC2560A_BT_SP_BTS.zip 31 32CC2564_BT_BLE_SP_BTS.zip: 33 @echo "Downloading $@" 34 @curl -sS -O $(BLUEKITCHEN_URL)/CC2564_BT_BLE_SP_BTS.zip 35 36bluetooth_init_cc2560A_2.14.bts: CC2560A_BT_SP_BTS.zip 37 @echo "Extracting $@" 38 @unzip -q -j -o CC2560A_BT_SP_BTS.zip CC2560A_BT_SP_BTS/bluetooth_init_cc2560A_2.14.bts 39 40bluetooth_init_cc2564_2.14.bts: CC2564_BT_BLE_SP_BTS.zip 41 @echo "Extracting $@" 42 @unzip -q -j -o CC2564_BT_BLE_SP_BTS.zip CC2564_BT_BLE_SP_BTS/bluetooth_init_cc2564_2.14.bts 43 44# Third generation CC256xB - AKA TIInit_6.7.16.bts 45 46# v1.2 - versioned files TI Git Repo 47bluetooth_init_cc2560B_1.2_BT_Spec_4.1.bts: 48 @echo "Downloading $@" 49 @curl -sS -O $(BLUEKITCHEN_URL)/bluetooth_init_cc2560B_1.2_BT_Spec_4.1.bts 50 51bluetooth_init_cc2564B_1.2_BT_Spec_4.1.bts: 52 @echo "Downloading $@" 53 @curl -sS -O $(BLUEKITCHEN_URL)/bluetooth_init_cc2564B_1.2_BT_Spec_4.1.bts 54 55BLE_init_cc2564B_1.2.bts: 56 @echo "Downloading $@" 57 @curl -sS -O $(BLUEKITCHEN_URL)/BLE_init_cc2564B_1.2.bts 58 59# v1.4 - versioned files TI Git Repo 60TIInit_6.7.16_bt_spec_4.1.bts: 61 @echo "Downloading $@" 62 @curl -sS -O https://git.ti.com/ti-bt/service-packs/blobs/raw/54f5c151dacc608b19ab2ce4c30e27a3983048b2/initscripts/TIInit_6.7.16_bt_spec_4.1.bts 63 64TIInit_6.7.16_ble_add-on.bts: 65 @echo "Downloading $@" 66 @curl -sS -O https://git.ti.com/ti-bt/service-packs/blobs/raw/89c8db14929f10d75627b132690432cd71f5f54f/initscripts/TIInit_6.7.16_ble_add-on.bts 67 68# v1.5 - unversioned files from BlueKitchen website, original: http://www.ti.com/tool/cc256xb-bt-sp 69cc256x_bt_sp_v1.5.zip: 70 echo "Downloading $@" 71 @curl -sS -O $(BLUEKITCHEN_URL)/cc256x_bt_sp_v1.5.zip 72 73cc256x_bt_sp_v1.5/initscripts-TIInit_6.7.16_bt_spec_4.1.bts: cc256x_bt_sp_v1.5.zip 74 @echo "Extracting $@" 75 @mkdir -p cc256x_bt_sp_v1.5 76 @unzip -q -j -o cc256x_bt_sp_v1.5.zip -d cc256x_bt_sp_v1.5 CC256X_BT_SP/v1.5/initscripts-TIInit_6.7.16_bt_spec_4.1.bts 77 78cc256x_bt_sp_v1.5/initscripts-TIInit_6.7.16_ble_add-on.bts: cc256x_bt_sp_v1.5.zip 79 @echo "Extracting $@" 80 @mkdir -p cc256x_bt_sp_v1.5 81 @unzip -q -j -o cc256x_bt_sp_v1.5.zip -d cc256x_bt_sp_v1.5 CC256X_BT_SP/v1.5/initscripts-TIInit_6.7.16_ble_add-on.bts 82 83# v1.6 - unversioned files from BlueKitchen website, original: http://www.ti.com/tool/cc256xb-bt-sp 84cc256xb_bt_sp_v1.6.zip: 85 echo "Downloading $@" 86 @curl -sS -O $(BLUEKITCHEN_URL)/cc256xb_bt_sp_v1.6.zip 87 88cc256xb_bt_sp_v1.6/initscripts-TIInit_6.7.16_bt_spec_4.1.bts: cc256xb_bt_sp_v1.6.zip 89 @echo "Extracting $@" 90 @mkdir -p cc256xb_bt_sp_v1.6 91 @unzip -q -j -o cc256xb_bt_sp_v1.6.zip -d cc256xb_bt_sp_v1.6 CC256XB_BT_SP/v1.6/initscripts-TIInit_6.7.16_bt_spec_4.1.bts 92 93cc256xb_bt_sp_v1.6/initscripts-TIInit_6.7.16_ble_add-on.bts: cc256xb_bt_sp_v1.6.zip 94 @echo "Extracting $@" 95 @mkdir -p cc256xb_bt_sp_v1.6 96 @unzip -q -j -o cc256xb_bt_sp_v1.6.zip -d cc256xb_bt_sp_v1.6 CC256XB_BT_SP/v1.6/initscripts-TIInit_6.7.16_ble_add-on.bts 97 98# v1.7 - not available, please use v1.8 or newer 99 100# v1.8 - unversioned files from BlueKitchen website, original: http://www.ti.com/tool/cc256xb-bt-sp 101cc256xb_bt_sp_v1.8.zip: 102 echo "Downloading $@" 103 @curl -sS -O $(BLUEKITCHEN_URL)/cc256xb_bt_sp_v1.8.zip 104 105cc256xb_bt_sp_v1.8/initscripts-TIInit_6.7.16_bt_spec_4.1.bts: cc256xb_bt_sp_v1.8.zip 106 @echo "Extracting $@" 107 @mkdir -p cc256xb_bt_sp_v1.8 108 @unzip -q -j -o cc256xb_bt_sp_v1.8.zip -d cc256xb_bt_sp_v1.8 CC256XB_BT_SP/v1.8/initscripts-TIInit_6.7.16_bt_spec_4.1.bts 109 110cc256xb_bt_sp_v1.8/initscripts-TIInit_6.7.16_ble_add-on.bts: cc256xb_bt_sp_v1.8.zip 111 @echo "Extracting $@" 112 @mkdir -p cc256xb_bt_sp_v1.8 113 @unzip -q -j -o cc256xb_bt_sp_v1.8.zip -d cc256xb_bt_sp_v1.8 CC256XB_BT_SP/v1.8/initscripts-TIInit_6.7.16_ble_add-on.bts 114 115cc256xb_bt_sp_v1.8/initscripts-TIInit_6.7.16_avpr_add-on.bts: cc256xb_bt_sp_v1.8.zip 116 @echo "Extracting $@" 117 @mkdir -p cc256xb_bt_sp_v1.8 118 @unzip -q -j -o cc256xb_bt_sp_v1.8.zip -d cc256xb_bt_sp_v1.8 CC256XB_BT_SP/v1.8/initscripts-TIInit_6.7.16_avpr_add-on.bts 119 120# Fourth generation CC256xC - TIInit_6.12.26.bts 121 122# v1.0 - unversioned files from BlueKitchen website, original: http://www.ti.com/tool/cc256xc-bt-sp 123cc256xc_bt_sp_v1.0.zip: 124 @echo "Downloading $@" 125 @curl -sS -O $(BLUEKITCHEN_URL)/cc256xc_bt_sp_v1.0.zip 126 127initscripts-TIInit_6.12.26_v1.0.bts: cc256xc_bt_sp_v1.0.zip 128 @echo "Extracting $@" 129 @unzip -q -p cc256xc_bt_sp_v1.0.zip CC256XC_BT_SP/v1.0/initscripts-TIInit_6.12.26.bts > $@ 130 131initscripts-TIInit_6.12.26_ble_add-on_v1.0.bts: cc256xc_bt_sp_v1.0.zip 132 @echo "Extracting $@" 133 @unzip -q -p cc256xc_bt_sp_v1.0.zip CC256XC_BT_SP/v1.0/initscripts-TIInit_6.12.26_ble_add-on.bts > $@ 134 135# v1.1 - unversioned files from BlueKitchen website, original: http://www.ti.com/tool/cc256xc-bt-sp 136cc256xc_bt_sp_v1.1.zip: 137 @echo "Downloading $@" 138 @curl -sS -O $(BLUEKITCHEN_URL)/cc256xc_bt_sp_v1.1.zip 139 140initscripts-TIInit_6.12.26_v1.1.bts: cc256xc_bt_sp_v1.1.zip 141 @echo "Extracting $@" 142 @unzip -q -p cc256xc_bt_sp_v1.1.zip CC256XC_BT_SP/v1.1/initscripts-TIInit_6.12.26.bts > $@ 143 144initscripts-TIInit_6.12.26_ble_add-on_v1.1.bts: cc256xc_bt_sp_v1.1.zip 145 @echo "Extracting $@" 146 @unzip -q -p cc256xc_bt_sp_v1.1.zip CC256XC_BT_SP/v1.1/initscripts-TIInit_6.12.26_ble_add-on.bts > $@ 147 148# v1.2 - unversioned files from BlueKitchen website, original: http://www.ti.com/tool/cc256xc-bt-sp 149cc256xc_bt_sp_v1.2.zip: 150 @echo "Downloading $@" 151 @curl -sS -O $(BLUEKITCHEN_URL)/cc256xc_bt_sp_v1.2.zip 152 153initscripts-TIInit_6.12.26_v1.2.bts: cc256xc_bt_sp_v1.2.zip 154 @echo "Extracting $@" 155 @unzip -q -p cc256xc_bt_sp_v1.2.zip CC256XC_BT_SP/v1.2/initscripts-TIInit_6.12.26.bts > $@ 156 157initscripts-TIInit_6.12.26_ble_add-on_v1.2.bts: cc256xc_bt_sp_v1.2.zip 158 @echo "Extracting $@" 159 @unzip -q -p cc256xc_bt_sp_v1.2.zip CC256XC_BT_SP/v1.2/initscripts-TIInit_6.12.26_ble_add-on.bts > $@ 160 161# v1.3 - unversioned files from BlueKitchen website, original: http://www.ti.com/tool/cc256xc-bt-sp 162cc256xc_bt_sp_v1.3.zip: 163 @echo "Downloading $@" 164 @curl -sS -O $(BLUEKITCHEN_URL)/cc256xc_bt_sp_v1.3.zip 165 166initscripts-TIInit_6.12.26_v1.3.bts: cc256xc_bt_sp_v1.3.zip 167 @echo "Extracting $@" 168 @unzip -q -p cc256xc_bt_sp_v1.3.zip CC256XC_BT_SP/v1.3/initscripts-TIInit_6.12.26.bts > $@ 169 170initscripts-TIInit_6.12.26_ble_add-on_v1.3.bts: cc256xc_bt_sp_v1.3.zip 171 @echo "Extracting $@" 172 @unzip -q -p cc256xc_bt_sp_v1.3.zip CC256XC_BT_SP/v1.3/initscripts-TIInit_6.12.26_ble_add-on.bts > $@ 173 174# v1.4 - unversioned files from BlueKitchen website, original: http://www.ti.com/tool/cc256xc-bt-sp 175cc256xc_bt_sp_v1.4.zip: 176 @echo "Downloading $@" 177 @curl -sS -O $(BLUEKITCHEN_URL)/cc256xc_bt_sp_v1.4.zip 178 179initscripts-TIInit_6.12.26_v1.4.bts: cc256xc_bt_sp_v1.4.zip 180 @echo "Extracting $@" 181 @unzip -q -p cc256xc_bt_sp_v1.4.zip CC256XC_BT_SP/v1.4/initscripts-TIInit_6.12.26.bts > $@ 182 183initscripts-TIInit_6.12.26_ble_add-on_v1.4.bts: cc256xc_bt_sp_v1.4.zip 184 @echo "Extracting $@" 185 @unzip -q -p cc256xc_bt_sp_v1.4.zip CC256XC_BT_SP/v1.4/initscripts-TIInit_6.12.26_ble_add-on.bts > $@ 186 187initscripts-TIInit_6.12.26_avpr_add-on_v1.4.bts: cc256xc_bt_sp_v1.4.zip 188 @echo "Extracting $@" 189 @unzip -q -p cc256xc_bt_sp_v1.4.zip CC256XC_BT_SP/v1.4/initscripts-TIInit_6.12.26_avpr_add-on.bts > $@ 190 191# Various scripts for WL chipsets 192 193# V4.2 from BlueKitchen website, original: http://www.ti.com/tool/wl18xx-bt-sp 194TIInit_11.8.32_4.2.bts: 195 @echo "Downloading $@" 196 @curl -sS -O $(BLUEKITCHEN_URL)/TIInit_11.8.32_4.2.bts 197 198TIInit_11.8.32_4.6.bts: 199 @echo "Downloading $@" 200 @curl -sS -O $(BLUEKITCHEN_URL)/TIInit_11.8.32_4.6.bts 201 202TIInit_12.10.28.bts: 203 @echo "Downloading $@" 204 @curl -sS -O $(BLUEKITCHEN_URL)/TIInit_12.10.28.bts 205 206TIInit_12.8.32.bts: 207 @echo "Downloading $@" 208 @curl -sS -O $(BLUEKITCHEN_URL)/TIInit_12.8.32.bts 209 210 211 212# convert to .c files based on main file and option add-on 213 214bluetooth_init_cc2560_2.44.c: bluetooth_init_cc2560_2.44.bts 215 @echo "Creating $@" 216 @$(CONVERSION_SCRIPT) $^ $@ 217 218bluetooth_init_cc2560A_2.14.c: bluetooth_init_cc2560A_2.14.bts 219 @echo "Creating $@" 220 @$(CONVERSION_SCRIPT) $^ $@ 221 222bluetooth_init_cc2567_2.4.c: CC2567_BT_ANT_Service_Pack_2.4.bts 223 @echo "Creating $@" 224 @$(CONVERSION_SCRIPT) $^ $@ 225 226bluetooth_init_cc2567_2.8.c: CC256x_BT_Service_Pack_2.8_ANT_1.16.bts 227 @echo "Creating $@" 228 @$(CONVERSION_SCRIPT) $^ $@ 229 230bluetooth_init_cc2564_2.14.c: bluetooth_init_cc2564_2.14.bts 231 @echo "Creating $@" 232 @$(CONVERSION_SCRIPT) $^ $@ 233 234bluetooth_init_cc2560B_1.2_BT_Spec_4.1.c: bluetooth_init_cc2560B_1.2_BT_Spec_4.1.bts 235 @echo "Creating $@" 236 @$(CONVERSION_SCRIPT) $^ $@ 237 238bluetooth_init_cc2564B_1.2_BT_Spec_4.1.c: bluetooth_init_cc2564B_1.2_BT_Spec_4.1.bts BLE_init_cc2564B_1.2.bts 239 @echo "Creating $@" 240 @$(CONVERSION_SCRIPT) $^ $@ 241 242bluetooth_init_cc2560B_1.4_BT_Spec_4.1.c: TIInit_6.7.16_bt_spec_4.1.bts 243 @echo "Creating $@" 244 @$(CONVERSION_SCRIPT) $^ $@ 245 246bluetooth_init_cc2564B_1.4_BT_Spec_4.1.c: TIInit_6.7.16_bt_spec_4.1.bts TIInit_6.7.16_ble_add-on.bts 247 @echo "Creating $@" 248 @$(CONVERSION_SCRIPT) $^ $@ 249 250bluetooth_init_cc2560B_1.5_BT_Spec_4.1.c: cc256x_bt_sp_v1.5/initscripts-TIInit_6.7.16_bt_spec_4.1.bts 251 @echo "Creating $@" 252 @$(CONVERSION_SCRIPT) $^ $@ 253 254bluetooth_init_cc2564B_1.5_BT_Spec_4.1.c: cc256x_bt_sp_v1.5/initscripts-TIInit_6.7.16_bt_spec_4.1.bts cc256x_bt_sp_v1.5/initscripts-TIInit_6.7.16_ble_add-on.bts 255 @echo "Creating $@" 256 @$(CONVERSION_SCRIPT) $^ $@ 257 258bluetooth_init_cc2560B_1.6_BT_Spec_4.1.c: cc256xb_bt_sp_v1.6/initscripts-TIInit_6.7.16_bt_spec_4.1.bts 259 @echo "Creating $@" 260 @$(CONVERSION_SCRIPT) $^ $@ 261 262bluetooth_init_cc2564B_1.6_BT_Spec_4.1.c: cc256xb_bt_sp_v1.6/initscripts-TIInit_6.7.16_bt_spec_4.1.bts cc256xb_bt_sp_v1.6/initscripts-TIInit_6.7.16_ble_add-on.bts 263 @echo "Creating $@" 264 @$(CONVERSION_SCRIPT) $^ $@ 265 266bluetooth_init_cc2560B_1.8_BT_Spec_4.1.c: cc256xb_bt_sp_v1.8/initscripts-TIInit_6.7.16_bt_spec_4.1.bts 267 @echo "Creating $@" 268 @$(CONVERSION_SCRIPT) $^ $@ 269 270bluetooth_init_cc2560B_avpr_1.8_BT_Spec_4.1.c: cc256xb_bt_sp_v1.8/initscripts-TIInit_6.7.16_bt_spec_4.1.bts cc256xb_bt_sp_v1.8/initscripts-TIInit_6.7.16_avpr_add-on.bts 271 272 @echo "Creating $@" 273 @$(CONVERSION_SCRIPT) $^ $@ 274 275bluetooth_init_cc2564B_1.8_BT_Spec_4.1.c: cc256xb_bt_sp_v1.8/initscripts-TIInit_6.7.16_bt_spec_4.1.bts cc256xb_bt_sp_v1.8/initscripts-TIInit_6.7.16_ble_add-on.bts 276 @echo "Creating $@" 277 @$(CONVERSION_SCRIPT) $^ $@ 278 279bluetooth_init_cc2560C_1.0.c: initscripts-TIInit_6.12.26_v1.0.bts 280 @echo "Creating $@" 281 @$(CONVERSION_SCRIPT) $^ $@ 282 283bluetooth_init_cc2564C_1.0.c: initscripts-TIInit_6.12.26_v1.0.bts initscripts-TIInit_6.12.26_ble_add-on_v1.0.bts 284 @echo "Creating $@" 285 @$(CONVERSION_SCRIPT) $^ $@ 286 287bluetooth_init_cc2560C_1.1.c: initscripts-TIInit_6.12.26_v1.1.bts 288 @echo "Creating $@" 289 @$(CONVERSION_SCRIPT) $^ $@ 290 291bluetooth_init_cc2564C_1.1.c: initscripts-TIInit_6.12.26_v1.1.bts initscripts-TIInit_6.12.26_ble_add-on_v1.1.bts 292 @echo "Creating $@" 293 @$(CONVERSION_SCRIPT) $^ $@ 294 295bluetooth_init_cc2560C_1.2.c: initscripts-TIInit_6.12.26_v1.2.bts 296 @echo "Creating $@" 297 @$(CONVERSION_SCRIPT) $^ $@ 298 299bluetooth_init_cc2564C_1.2.c: initscripts-TIInit_6.12.26_v1.2.bts initscripts-TIInit_6.12.26_ble_add-on_v1.2.bts 300 @echo "Creating $@" 301 @$(CONVERSION_SCRIPT) $^ $@ 302 303bluetooth_init_cc2560C_1.3.c: initscripts-TIInit_6.12.26_v1.3.bts 304 @echo "Creating $@" 305 @$(CONVERSION_SCRIPT) $^ $@ 306 307bluetooth_init_cc2564C_1.3.c: initscripts-TIInit_6.12.26_v1.3.bts initscripts-TIInit_6.12.26_ble_add-on_v1.3.bts 308 @echo "Creating $@" 309 @$(CONVERSION_SCRIPT) $^ $@ 310 311bluetooth_init_cc2560C_1.4.c: initscripts-TIInit_6.12.26_v1.4.bts 312 @echo "Creating $@" 313 @$(CONVERSION_SCRIPT) $^ $@ 314 315bluetooth_init_cc2560C_avpr_1.4.c: initscripts-TIInit_6.12.26_v1.4.bts initscripts-TIInit_6.12.26_avpr_add-on_v1.4.bts 316 @echo "Creating $@" 317 @$(CONVERSION_SCRIPT) $^ $@ 318 319bluetooth_init_cc2564C_1.4.c: initscripts-TIInit_6.12.26_v1.4.bts initscripts-TIInit_6.12.26_ble_add-on_v1.4.bts 320 @echo "Creating $@" 321 @$(CONVERSION_SCRIPT) $^ $@ 322 323 324TIInit_11.8.32_4.2.c: TIInit_11.8.32_4.2.bts 325 @echo "Creating $@" 326 @$(CONVERSION_SCRIPT) $^ $@ 327 328TIInit_11.8.32_4.6.c: TIInit_11.8.32_4.6.bts 329 @echo "Creating $@" 330 @$(CONVERSION_SCRIPT) $^ $@ 331 332 333TIInit_12.10.28.c: TIInit_12.10.28.bts 334 @echo "Creating $@" 335 @$(CONVERSION_SCRIPT) $^ $@ 336 337TIInit_12.8.32.c: TIInit_12.8.32.bts 338 @echo "Creating $@" 339 @$(CONVERSION_SCRIPT) $^ $@ 340 341all-scripts: \ 342 bluetooth_init_cc2560_2.44.c \ 343 bluetooth_init_cc2560A_2.14.c \ 344 bluetooth_init_cc2564_2.14.bts \ 345 bluetooth_init_cc2560B_1.8_BT_Spec_4.1.c \ 346 bluetooth_init_cc2564B_1.8_BT_Spec_4.1.c \ 347 bluetooth_init_cc2560C_1.4.c \ 348 bluetooth_init_cc2560C_avpr_1.4.c \ 349 bluetooth_init_cc2564C_1.4.c \ 350 TIInit_11.8.32_4.2.c \ 351 TIInit_11.8.32_4.6.c \ 352 TIInit_12.10.28.c \ 353 TIInit_12.8.32.c \ 354 355clean-scripts: 356 rm -fr cc256x*.zip CC256*.zip bluetooth_init_cc256*.c TIInit*.c *.bts BLE_init_cc256*.c cc256xb_bt_sp_v1.8 357 358 359