{"id":16879281,"url":"https://github.com/delan/usb3sun","last_synced_at":"2025-11-12T02:41:33.492Z","repository":{"id":145957334,"uuid":"575279716","full_name":"delan/usb3sun","owner":"delan","description":"usb input adapter for sun workstations","archived":false,"fork":false,"pushed_at":"2025-05-26T07:04:19.000Z","size":13062,"stargazers_count":40,"open_issues_count":13,"forks_count":8,"subscribers_count":9,"default_branch":"default","last_synced_at":"2025-08-23T02:55:31.557Z","etag":null,"topics":["keyboard","mouse","sparcstation","sun","usb"],"latest_commit_sha":null,"homepage":"https://funny.computer.daz.cat/usb3sun/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/delan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-07T06:36:47.000Z","updated_at":"2025-07-23T22:35:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"3600d4cf-6991-4db2-9ad8-b10b52d0b254","html_url":"https://github.com/delan/usb3sun","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/delan/usb3sun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delan%2Fusb3sun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delan%2Fusb3sun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delan%2Fusb3sun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delan%2Fusb3sun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delan","download_url":"https://codeload.github.com/delan/usb3sun/tar.gz/refs/heads/default","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delan%2Fusb3sun/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283966764,"owners_count":26924587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-12T02:00:06.336Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keyboard","mouse","sparcstation","sun","usb"],"created_at":"2024-10-13T15:53:28.851Z","updated_at":"2025-11-12T02:41:33.474Z","avatar_url":"https://github.com/delan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"usb3sun\n=======\n\nusb3sun is an adapter that allows you to connect USB keyboards and mice to the Sun 8-pin mini-DIN interface.\n\n* [buy now](https://www.tindie.com/products/funnycomputer/usb3sun/) on tindie\n* read more about\n    * [the breadboard prototype](https://cohost.org/delan/post/787278-usb3sun-a-usb-input)\n    * [the development of rev A1](https://cohost.org/delan/post/1650431-usb3sun-rev-a1-a-us)\n    * [the development of rev A2](https://cohost.org/delan/post/2042852-usb3sun-rev-a2-now)\n    * [the development of rev A3](https://cohost.org/delan/post/2973101-usb3sun-rev-a3-guar)\n    * [the development of firmware 2.0](https://cohost.org/delan/post/5806830-usb3sun-2-0-faster)\n    * [the development of rev B0](https://cohost.org/delan/post/6029886-usb3sun-rev-b0-a-us)\n    * [the funny computer museum](https://funny.computer.daz.cat/)\n\nsee also:\n\n* [USB2Sun](https://github.com/jgilje/USB2Sun) by @jgilje\n* [sun2usb](https://github.com/jareklupinski/sun2usb) by @jareklupinski\n\n**note:** this repo uses submodules! clone with `--recursive`, or if you forgot to do that:\n\n```sh\n$ git submodule update --init --recursive\n```\n\ndocumentation\n-------------\n\n* **[user guide](doc/manual.md)**\n* hacking and assembly docs\n    * [firmware](doc/firmware.md)\n    * [breadboard prototype](doc/prototype.md)\n    * [pcb](hardware/pcb) docs coming soon!\n* maintainer docs\n    * [how to release](doc/releasing.md)\n\nwhat’s new\n----------\n\n**rev B0** allows for debug logging (and the new debug cli) **without disabling the sun keyboard interface**, and fixes some [minor bugs](https://github.com/delan/usb3sun/blob/B0/doc/manual.md#errata) that happen when resetting the adapter.\n\nnew in **firmware 2.0**:\n\n- support for **NeXTSTEP** and **Plan 9**, which require the mouse to run at 1200 baud\n- configurable **mouse baud rate** — 9600 (default), 4800, 2400, or 1200 baud\n- **debug cli** over UART_RX, allowing you to automate keyboard and mouse inputs\n\nas of **firmware 1.5**, usb3sun can now [**reprogram your idprom**](https://funny.computer.daz.cat/sun/nvram-hostid-faq.txt) with just a few keystrokes, making it easier to boot your workstation with a dead nvram battery!\n\nhardware features\n-----------------\n\nusb3sun includes an **audible buzzer** to emulate the bell and click functions that would normally be included with a Sun keyboard.\n\nusb3sun also emulates the **power key** in two ways:\n\n* **soft power key** (Right Ctrl+P)\n    * sends the power key scancodes (30h/B0h)\n    * can turn on your workstation (only when usb3sun is powered externally)\n* **onboard power button** (near the display)\n    * doesn’t send any scancodes\n    * can turn on your workstation (even when not powered externally)\n\nusb3sun has an **oled display** that shows:\n\n* keyboard led indicators (caps, compose, scroll, num)\n* visual buzzer (click, bell)\n* the settings menu\n\nusb3sun has an **onboard reset button** in case the firmware gets stuck, and a **0.1″ debug header** (pins available as an option) that allows you to power the adapter externally for flashing or debugging.\n\nfirmware features\n-----------------\n\nusb3sun has **persistent settings** for:\n\n* forcing click mode (no/off/on)\n* click duration (5–100 ms)\n* mouse baud rate (for NeXTSTEP and Plan 9)\n* your hostid\n\nfeatures planned for a future firmware version:\n\n* settings for bell/click tone frequency\n* led indicators on your USB keyboard itself\n\nrelease notes\n-------------\n\n### firmware ?.? (????-??-??)\n\n* added experimental support for **leds on your usb keyboard** — led updates are not yet reliable, and currently has bugs that can cause usb devices to stop responding\n* added experimental support for **analysing other sun keyboards** — this allows us to improve our firmware by observing the behaviour of real sun keyboards\n\n### firmware 2.1 (2025-05-26)\n\n* [pio_pkg_list.txt](https://github.com/delan/usb3sun/blob/2.1/pio_pkg_list.txt) = dependency tree at time of release\n* [#15](https://github.com/delan/usb3sun/issues/15) — fixed “The IDPROM contents are invalid” when reprogramming the idprom on some machines, including the Ultra5\n* [#20](https://github.com/delan/usb3sun/issues/20) — fixed a bug where the display may not work correctly on a cold start (affects rev B0 units starting from B1#7)\n\n### pcb rev B1 (2025-04-20)\n\n* this board **requires firmware 2.1** or newer — firmware 2.0 is affected by [#20](https://github.com/delan/usb3sun/issues/20)\n* changed J1 from [USB-U267-BWS](https://jlcpcb.com/partdetail/HanboElectronic-USB_U267BWS/C2962392) to the compatible [USB-269-BRW](https://jlcpcb.com/partdetail/Xunpu-USB_268BRY/C720548) due to stock shortage\n* migrated from kicad 7 to kicad 8\n\n### pcb rev B0 (2024-05-25)\n\n* this board **requires firmware 2.0** or newer\n* [#2](https://github.com/delan/usb3sun/issues/2) — fixed a limitation where the workstation **drops you into an ok prompt** when resetting the adapter\n* [#11](https://github.com/delan/usb3sun/issues/11) — fixed a bug where the adapter can **hang until power cycled** after being reset, especially when reset frequently\n* [#10](https://github.com/delan/usb3sun/issues/10) — added support for logging over UART_TX/UART_RX **without disabling the sun keyboard interface**\n* reworked component layout and routing for **sun interfaces** and **led indicators** — none of the user-facing component locations have changed\n* replaced transistors Q1 through Q4 (2N7000) with dual transistors Q1 and Q3 (2N7002DW)\n* removed solder jumpers JP1 and JP2, which were added in rev A2 in case of errata\n\n### firmware 2.0 (2024-05-02)\n\n* [pio_pkg_list.txt](https://github.com/delan/usb3sun/blob/2.0/pio_pkg_list.txt) = dependency tree at time of release\n* added support for adapters with **pcb rev B0** — these use pinout v2, while older revs use pinout v1\n* added a **mouse baud setting** that can be set to 9600 baud (default), 4800, 2400, or 1200 baud\n    * this adds support for **NeXTSTEP** and **Plan 9**, which require the mouse to run at a lower baud rate ([#8](https://github.com/delan/usb3sun/issues/8))\n* you can now choose whether to **save or discard settings changes** when you close the menu\n    * this change was made as part of a workaround for usb devices that malfunction when saving settings ([#14](https://github.com/delan/usb3sun/issues/14)); if you have any affected devices, hold **Shift** while pressing **Enter** to reboot the adapter after saving settings\n* the displayed **version number** can now include **uncommitted and/or unreleased changes** (`2.0+` / `2.0+1` / `2.0+1+`)\n* several other improvements to the user interface\n    * you can now **close the menu by pressing Esc**\n    * the menu now **automatically closes** after *Reprogram idprom* and *Wipe idprom (AAh)*\n    * the menu now **shows four menu items**, rather than three menu items and the version number\n    * *Click duration* now **beeps to preview your changes**, regardless of whether clicks are enabled\n    * *Reprogram idprom* now **tells you what hostid is being programmed** into your idprom\n* **updated our usb host stack**, making usb devices enumerate faster\n    * Adafruit TinyUSB Library (2.0.1 → 3.1.0), Pico PIO USB (0.5.2 → 0.5.3)\n    * this may affect [compatibility](https://github.com/delan/usb3sun/blob/default/doc/manual.md#compatibility) with your usb devices; please [report any regressions or improvements](https://github.com/delan/usb3sun/issues?q=is%3Aissue+is%3Aopen+label%3Acompatibility)\n* added support for logging over UART_TX/UART_RX **without disabling the sun keyboard interface** ([#10](https://github.com/delan/usb3sun/issues/10))\n    * this feature requires **pcb rev B0** or newer, due to the pinout changes required\n    * please report any regressions with the **buzzer** or **sun mouse interface**; the buzzer had to be moved from pio to hardware pwm, and the sun mouse had to be moved from hardware uart to pio\n* added a **debug cli** over UART_RX — this lets you press keys and move the mouse without a usb keyboard or mouse\n* the firmware can now be **built as a normal program for linux**, thanks to a new hardware abstraction layer; as a result:\n    * added an **interactive demo** (`run-demo.sh`) that can be used to play with or develop the user interface\n    * added a **test suite** (`run-tests.sh`) for the setup and pinout routines, sun keyboard interface (reset sequence), buzzer (click and bell), settings (reads, writes, upgrades), and menu (confirm-save, hostid, i/o)\n    * we can **catch some memory access violations** with dynamic analysis by **AddressSanitizer** (asan)\n* added some **build tests** (`run-build-tests.sh`) to catch compile errors with custom build flags\n* fixed some potential future compatibility issues in the settings formats (variable-width integer types and variable struct padding)\n    * your existing settings in their v1 formats will be upgraded automatically\n* fixed a compile error when debug logging was enabled (**PICOPROBE_ENABLE**, now known as **DEBUG_OVER_UART**)\n* fixed all compile warnings under -Wall with the current toolchains for `pico` and `linux` (via nix-shell)\n* fixed incorrect debug log output for **report id**, **usage**, and **usage page** when enumerating usb hid devices\n* fixed missing newline in debug log output when reporting ErrorRollOver inputs from usb keyboards\n* fixed missing newline in UHID_VERBOSE output when reporting inputs from non-boot-protocol usb devices\n* removed the splash screen from debug logging — this significantly slowed down the setup routine\n* removed the fake sun emulation feature — this wasn’t too useful, and was broken by the pinout changes\n* several changes to config.h\n    * added **DEBUG_OVER_CDC** to disable logging over usb cdc\n    * added **UHID_LED_ENABLE** to opt into experimental usb hid led support\n    * added **UHID_LED_TEST** to blink leds on all usb keyboards\n    * added pin definitions **PINOUT_V2_PIN**, **KTX_ENABLE**, **DISPLAY_ENABLE**, **DEBUG_UART**, **SUNK_UART_V1**, **SUNK_UART_V2**, and **SUNM_UART_V1**\n    * removed **SUNM_BAUD** in favour of the new menu setting\n    * renamed **PICOPROBE_ENABLE** to **DEBUG_OVER_UART**\n    * renamed **PICOPROBE_BAUD** to **DEBUG_UART_BAUD**\n    * renamed **PICOPROBE_TX** to **DEBUG_UART_TX**\n    * renamed **PICOPROBE_RX** to **DEBUG_UART_RX**\n    * **SUN_KTX**, **SUN_KRX**, **SUN_MTX**, and **SUN_MRX** were split into pinout v1 and v2 variants\n    * **DEBUG_OVER_UART** no longer disables logging over usb cdc (see **DEBUG_OVER_CDC**)\n    * **SUNK_ENABLE** was moved to platformio.ini, and takes precedence over **DEBUG_OVER_UART** in pinout v1\n    * **SUNM_ENABLE** was moved to platformio.ini\n\n### pcb rev [A3](https://github.com/delan/usb3sun/releases/tag/A3) (2023-10-15)\n\n* fixed the inconsistent and excessive brightness of the led indicators (D2, D3)\n* fixed a bug where the VBUS indicator led (D2) can be dimly lit without VBUS being connected\n* changed J1 from [UJ2-ADH-W1-TH](https://jlcpcb.com/partdetail/CuiDevices-UJ2_ADH_W1TH/C5201729) to the compatible [USB-U267-BWS](https://jlcpcb.com/partdetail/HanboElectronic-USB_U267BWS/C2962392) due to stock shortage\n* cleaned up unused kicad libraries, and checked in libraries that were missing from the repo\n\n### firmware [1.5](https://github.com/delan/usb3sun/releases/tag/1.5) (2023-07-18)\n\n* [pio_pkg_list.txt](https://github.com/delan/usb3sun/blob/1.5/pio_pkg_list.txt) = dependency tree at time of release\n* added a **macro to reprogram your idprom** — this makes it easier to boot your workstation with a dead nvram battery\n* added a **macro to wipe your idprom** — this makes your idprom contents invalid, as if you had a dead nvram battery\n* added a **hostid setting** — this sets the hostid used when reprogramming your idprom\n* changed behaviour of builtin led to turn on at the very start of setup — this may help troubleshoot problems with CDC serial port initialisation\n\n### firmware [1.4](https://github.com/delan/usb3sun/releases/tag/1.4) (2023-07-17)\n\n* [pio_pkg_list.txt](https://github.com/delan/usb3sun/blob/1.4/pio_pkg_list.txt) = dependency tree at time of release\n* **fixed a serious bug** where opening the settings menu can make the adapter start releasing keys at the wrong times\n* **fixed a serious bug** where special key bindings (Right Ctrl) can get stuck down if Right Ctrl is released early\n* you can now press special key bindings (Right Ctrl) together with other modifiers (e.g. [Shift+Undo](https://docs.oracle.com/cd/E19683-01/806-7612/startup-tbl-5/index.html) for Redo)\n* improved performance of keyboard processing — this reduces the latency of key presses by up to 90 µs\n\nyou should update your firmware if you have any of the following symptoms:\n\n* modifiers like Shift stop working after closing the settings menu\n* modifiers like Shift appear to have a delayed effect after closing the settings menu\n* when a key gets stuck down, it remains stuck even after pressing and releasing another key\n\nyou can also work around these bugs by resetting the adapter.\n\n### firmware [1.3](https://github.com/delan/usb3sun/releases/tag/1.3) (2023-07-16)\n\n* [pio_pkg_list.txt](https://github.com/delan/usb3sun/blob/1.3/pio_pkg_list.txt) = dependency tree at time of release\n* added **firmware version to display** — this replaces the logo, which became a bit redundant\n* added **marquee display for long menu items** — this fixes a bug where they would wrap in an unreadable way\n\n### pcb rev [A2](https://github.com/delan/usb3sun/releases/tag/A2) (2023-06-30)\n\n* added usb-c port J4 — this makes firmware updates much easier, and makes it possible to debug the sun keyboard and mouse interfaces simultaneously\n* added polyfuse F3 after power supply switches — this protects the adapter under more fault conditions, in addition to faults in the downstream usb ports\n* changed led resistors R12 and R13 from 200R to 1K — this reduces the luminous intensity from ~80% down to ~10% relative to 20mA\n* changed tactile switches SW1 and SW2 from [TS-1187A-C-H-B](https://jlcpcb.com/partdetail/XkbConnectivity-TS_1187A_C_HB/C528025) to [TS-1187A-B-A-B](https://jlcpcb.com/partdetail/XkbConnectivity-TS_1187A_B_AB/C318884) — this reduces the extended parts fee with jlcpcb\n\n### firmware [1.2](https://github.com/delan/usb3sun/releases/tag/1.2) (2023-06-11)\n\n* [pio_pkg_list.txt](https://github.com/delan/usb3sun/blob/1.2/pio_pkg_list.txt) = dependency tree at time of release\n* added **audible usb plug/unplug notifications**\n* added **persistence for settings** — including click duration!\n* added **“force click” setting** — this replaces the old disable/enable click option in the settings menu, which toggled the same state as the host machine, with an independent override\n* changed the initial click mode state to off\n* changed the initial led indicator states to off\n* fixed theoretical(?) race condition in buzzer management\n* fixed errors in the README bindings table\n\n### pcb rev [A1](https://github.com/delan/usb3sun/releases/tag/A1) (2023-05-10)\n\n* added display mechanical support — **committed later in [74b367a12600d](https://github.com/delan/usb3sun/commit/74b367a12600d712eb7a05a9fc67c958bae3fe62)**\n* added tactile switches for reset and hard power key\n* added header pins for debug logging over UART0\n* added mounting holes for display mechanical support\n* added LED indicators for VBUS and VSUN\n* improved enclosure compatibility by moving mini-din beyond bottom edge\n* improved ground plane islands by stitching vias\n* made all corner mounting holes padded on both sides — previously this was only the case for the hole connected to GNDPWR, but not the other three\n\n### firmware [1.1](https://github.com/delan/usb3sun/releases/tag/1.1) (2023-05-06)\n\n* [pio_pkg_list.txt](https://github.com/delan/usb3sun/blob/1.1/pio_pkg_list.txt) = dependency tree at time of release\n* fixed regressions due to dependency updates\n    * fixed panic regression with *Pico Pio USB* 0.5.2 by removing non-idempotent workaround for a bug that was fixed upstream (sekigon-gonnoc/Pico-PIO-USB#77)\n    * worked around unsolved usb hid regression (adafruit/Adafruit_TinyUSB_Arduino#296) by pinning *Adafruit TinyUSB Library* to 2.0.1\n* fixed panic when combining PICOPROBE_ENABLE and CFG_TINYUSB_DEBUG\n* changed default DISPLAY_ROTATION to 0 — this better suits pcb rev A0 than the old value, and is equally suitable for the breadboard prototype\n* changed debug/upload protocols to cmsis-dap — this fixes compatibility with new picoprobe firmware\n* pinned sensitive dependencies to reduce future breakage — note that not all dependencies are pinned yet (platformio/platformio-core#4613), but see above for known-good dependency tree\n\n### pcb rev [A0](https://github.com/delan/usb3sun/releases/tag/A0) (2023-04-28)\n\n* initial release\n\n### firmware [1.0](https://github.com/delan/usb3sun/releases/tag/1.0) (2023-01-08)\n\n* initial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelan%2Fusb3sun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelan%2Fusb3sun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelan%2Fusb3sun/lists"}