Skip to content

Instantly share code, notes, and snippets.

@elfmimi
elfmimi / nuvoton.py
Last active May 27, 2023 14:00
pyOCD user script for Nuvoton ARM MCUs
# How to invoke:
# pyocd cmd --script nuvoton.py -c "ident"
# pyocd cmd --script nuvoton.py -c "read_config_regs"
# pyocd cmd --script nuvoton.py -c "write_config_regs 0xFFFFFFFF 0xFFFFFFFF"
# pyocd cmd --script nuvoton.py -c "chip_erase"
#
# and for the commander prompt, invoke it like this:
# pyocd cmd --script nuvoton.py
from pyocd.core.exceptions import TransferFaultError, TransferTimeoutError
@elfmimi
elfmimi / XC2C64-Blink-Test.ctl
Created July 24, 2021 11:06
JTAG Boundary-Scan Examples for OpenOCD
@elfmimi
elfmimi / STM32F1-PB2-to-PC13.tcl
Last active July 13, 2021 10:24
JTAG Boundary-Scan Examples for OpenOCD
# OpenOCD script to demonstrate JTAG Boundary-Scan I/O
# It will update the state of LED connected to PC13 according to input level on PB2/BOOT1.
# Supports STM32F103x8 and STM32F103xB
# See STM32F1_Med_density_LQFP48.bsd
#
# Invoke it like this:
# openocd -f interface/usb-jtag.cfg -f STM32F1-PB2-to-PC13.tcl
jtag newtap stm32f1x cpu -irlen 4 -expected-id 0x3ba00477
jtag newtap stm32f1x bs -irlen 5 -expected-id 0x06410041 -expected-id 0x16410041
@elfmimi
elfmimi / Dozen0-with-direction.json
Created March 7, 2021 02:16
remap-keys.app keyboard definition
{
"name": "Dozen0",
"vendorId": "0x04D8",
"productId": "0xEA4F",
"lighting": "none",
"matrix": {
"rows": 1,
"cols": 12
},
"layouts": {
@elfmimi
elfmimi / SimpleTcpRedirector.py
Created March 6, 2021 03:10 — forked from a1ad/SimpleTcpRedirector.py
A simple TCP redirector in python
#!/usr/bin/env python
# JR: made some very minor changes for python3
import socket
import threading
import select
import sys
terminateAll = False
{
"name": "Tartan",
"vendorId": "0x16c0",
"productId": "0x27db",
"lighting": "none",
"matrix": {
"rows": 5,
"cols": 13
},
"layouts": {
{
"name": "Melgeek Z70Ultra",
"vendorProductId": 4277005805,
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"KC_ESC",
"KC_1",
"KC_2",
"KC_3",
@elfmimi
elfmimi / NUC126.cfg
Last active August 3, 2020 04:38
Housekeeping toolbox for OpenOCD targeting Nuvoton NUC126
# Housekeeping toolbox for OpenOCD targeting Nuvoton NUC126
# by Ein Terakawa <[email protected]>
#
# based on TheLastMutt's mini51.cfg
# https://gist.github.com/TheLastMutt/d1c1948acaace7444c1c#file-mini51-cfg
# Usage example
#
# Read config regs.
# openocd -f NUC126.cfg -c ReadConfigRegs -c exit
@elfmimi
elfmimi / qmk-configurator-docker-compose.yml
Last active July 19, 2020 11:16
docker-compose.yml to configure all five qmk-configurator backend components
version: '3'
# This file should live in a directory about `qmk_api` and `qmk_compiler`
# Eventually we would have some sort of git subdir or something to contain
# this... For now, just cp (or symlink) it up a dir or something.
services:
qmk_conf:
build: ./qmk_configurator
ports:
@elfmimi
elfmimi / launch.json
Last active April 12, 2020 10:53
VisualStudio Code settings for Rust-Embedded development
{
// IntelliSense を使用して利用可能な属性を学べます。
// 既存の属性の説明をホバーして表示します。
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "gnu-debugger",
"request": "launch",