Skip to content

Instantly share code, notes, and snippets.

View whc2001's full-sized avatar
๐ŸŸ
Fish-touching

whc2001

๐ŸŸ
Fish-touching
View GitHub Profile

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.

@urish
urish / raspberrypi4-native.cfg
Created November 4, 2021 01:43
OpenOCD Configuration for Raspberry Pi 4
interface bcm2835gpio
bcm2835gpio_peripheral_base 0xFE000000
# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
# These depend on system clock, calibrated for stock 700MHz
# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET
bcm2835gpio_speed_coeffs 236181 60
# Each of the JTAG lines need a gpio number set: tck tms tdi tdo
@krdarrah
krdarrah / ATMEGA328P_TEST.ino
Last active November 12, 2025 11:15 — forked from speters/uid.ino
Arduino atmega328p unique id/serial number
//found this code here
//https://gist.github.com/speters/f889faec42b510052a6ab4be437d38ca
//Purpose is to simply run a memory check on ATMEGA238P to test for counterfeit parts
#include <avr/boot.h>
#define SIGRD 5
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
@JakeSidSmith
JakeSidSmith / launch-chromium
Last active April 22, 2024 20:26
Openbox config to launch a full screen Chromium on Raspberry Pi running Raspbian Lite
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms
# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp
# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
@lbussy
lbussy / README.md
Last active June 29, 2025 22:45
External Button Shutdown for Raspberry Pi

Shutdown Raspberry Pi with a Single Button

There are two methods:

  1. Scripted Method
  2. Boot Overlay Method (also below as "tl;dr")

tl;dr Version

Add the following to your /boot/config.txt and reboot:

@David-Lor
David-Lor / MQTTSubscribe.sh
Created July 11, 2019 12:29
Shell Script to subscribe to MQTT and execute a callback
#!/bin/bash
# This script subscribes to a MQTT topic using mosquitto_sub.
# On each message received, you can execute whatever you want.
while true # Keep an infinite loop to reconnect when connection lost/broker unavailable
do
mosquitto_sub -h "127.0.0.1" -t "test" | while read -r payload
do
# Here is the callback to execute whenever you receive a message:
@matt2005
matt2005 / lambda_function.py
Last active December 15, 2025 06:49 — forked from awarecan/lambda_function.py
Alexa Smart Home Skill Adapter for Home Assistant
"""
Copyright 2019 Jason Hu <awaregit at gmail.com>
Modified 2020 Matthew Hilton <[email protected]>
Refactor and Modernised 2025 Matthew Hilton <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@goran-rumin
goran-rumin / yt-userscript.js
Created January 14, 2019 17:30
Youtube "Video paused. Continue watching?" confirmer for Tampermonkey
// ==UserScript==
// @name Youtube-click-OK
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description clicks YES on "Video paused. Continue watching?" dialog
// @author goran
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
@FalconIA
FalconIA / vlmcsd.service
Last active May 29, 2025 01:24
vlmcsd boot script for systemd
[Unit]
Description=vlmcsd
Wants=network.target
After=syslog.target
[Service]
Type=forking
PIDFile=/var/run/vlmcsd.pid
ExecStart=/usr/local/vlmcsd/vlmcsd -l /var/log/vlmcsd.log -p /var/run/vlmcsd.pid
@YuxiUx
YuxiUx / midi-note-to-freq.md
Last active August 10, 2025 15:25
How to convert midi note to frequency in C, C++, Python, JS and PHP

JS

function noteToFreq(note) {
    let a = 440; //frequency of A (coomon value is 440Hz)
    return (a / 32) * (2 ** ((note - 9) / 12));
}

PHP

function noteToFreq($note) {