Skip to content

Instantly share code, notes, and snippets.

CC2652 unbricking with Raspberry Pi and OpenOCD

I was a bit quick when flashing my generic CC2652R and ended up dowloading and flashing firmware for CC2652P.. Since it was the wrong firmware, the bootloader also didn't work anymore, making me unable to flash the correct firmware with the integrated USB serial programmer.

Luckily the module has a cJTAG debugging interface, that should make it possible to flash directly onto the chip without the bootloader. But I don't have any serial debuggers, so I have had to come up withj my own from various limited information I could find.

Approach

Using OpenOCD we can use a Raspberry Pi as a JTAG debugger. It does not support cJTAG for debugging, so it will instead send a signal to make the CC2652 switch to normal JTAG. We will then have to connect a few additional cables to the TDO and TDI pins for a full 4-pin JTAG connection.

@tothi
tothi / mitmproxy-jwt-refresh-addon.py
Created August 28, 2022 20:52
mitmproxy addon for handling oauth access and refresh tokens automatically
# run: mitmproxy -k -p 8090 -s mitmproxy-jwt-refresh-addon.py
# set burp upstream proxy to localhost:8090
#
# use case:
# - application authorization is implemented by OAuth 2.0
# - testing is performed using Burp as primary and mitmproxy as upstream proxy
# - mitmproxy takes care of the Authorization tokens using this addon
# - user gets an access_token and a refresh_token during the 1st login (e.g. password login)
# - mitmproxy addon caches access_token and refresh_token
# - mitmproxy addon adds Authorization: Bearer [access_token from cache] header for every request
@sylvainfaivre
sylvainfaivre / thinkpad_cpu_throttling_lap_mode.md
Last active December 4, 2025 06:46
CPU throttling and "lap mode" on Lenovo Thinkpad laptops

CPU throttling and "lap mode" on Lenovo Thinkpad laptops

Test setup

Hardware : Lenovo Thinkpad P14s, Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz

Software : Ubuntu 21.10, Gnome 40.4.0, Linux 5.13.0

Background

@masselmello
masselmello / rsg_group_mcfit_high5_johnreed_capacity_widget.js
Last active September 24, 2025 09:49
iOS widget powered by the Scriptable app that shows the current capacity of your McFit gym (RSG group)
/**
* Script for scriptable to get the current capacity of McFit Gyms
*/
let gymId = 1731068920
let param = args.widgetParameter
if (param != null && param.length > 0) {
gymId = param
}
const currentGymCapacity = await fetchGymCapacity(gymId)
@mbreksopuro
mbreksopuro / start_reindex.sh
Last active September 26, 2023 18:28
Reindex API from Remote ElasticSearch to Local ElasticSearch Servers (for up to ES 6.x)
#!/bin/bash
###################################################
## Start ElasticSearch Reindex Same Indices
##
## Created by : Hartfordfive - 2019-02-01
## Modified by : Marjono B. Reksopuro - 2019-03-11
##
##
###################################################
@jackm
jackm / can-packages-and-tools.md
Last active October 9, 2025 06:51
Collection of CAN bus packages and tools

Collection of CAN bus packages and tools

This document assumes the use of Linux as the chosen development platform. Items in bold are highly recommended.

It is recommended to use SocketCAN when working with CAN bus on Linux. It is supported by the Linux kernel mainline and follows the Linux interface model, allowing you to use other network tools such as Wireshark. This also allows the creation of virtual CAN interfaces where no physical hardware is required to simulate or replay CAN messages.

@tmkdev
tmkdev / SWCAN_test_m2.ino
Created October 7, 2017 18:26
SWCAN on the macchina M2.
#include <SPI.h>
#include <MCP2515_sw_can.h>
// Pin definitions specific to how the MCP2515 is wired up.
#define CS_PIN SPI0_CS3
#define INT_PIN SWC_INT
#define Serial SerialUSB
// Create CAN object with pins as defined
SWcan CAN(CS_PIN, INT_PIN);
@tralston
tralston / reload-config-postgresql.md
Created August 21, 2017 08:18
[Reload PostgreSQL config] After updating pg_hba.conf or postgresql.conf, the server needs the config needs to be reloaded. #postgres

After updating pg_hba.conf or postgresql.conf, the server needs the config needs to be reloaded. The easiest way to do this is by restarting the postgres service:

service postgresql restart

When the service command is not available (no upstart on Synology NAS, for example), there are some more creative ways to reload the config. Note this first one needs to be done under the user that runs postgres (usually the user=postgres).

user#  sudo su postgres
postgres#  pg_ctl reload
@codexss
codexss / smstools3.md
Last active December 11, 2024 23:03
Openwrt/LEDE smstools3 forward sms to telegram
opkg update
opkg install kmod-usb-serial kmod-usb-serial-wwan kmod-usb-serial-option usb-modeswitch smstools3 curl iconv

vi /usr/local/bin/pushsms

#!/bin/sh
@gkoyuncu
gkoyuncu / main.c.in.diff
Last active July 15, 2017 06:00
squidguard 1.5b + squid 3.5.6 workaround
--- src/main.c.in
+++ src/main.c.in
@@ -185,7 +185,7 @@
sgReloadConfig();
}
if(failsafe_mode) {
- puts("");
+ puts("ERR");
fflush(stdout);
if(sig_hup){