<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title><![CDATA[Dobrica Pavlinušić's random unstructured stuff: CH552G]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?ch552g</link>
<description></description>
<pubDate>Tue, 17 Dec 2024 08:56:49 -0000</pubDate>
<webMaster>root@saturn.ffzg.hr</webMaster>
<generator>Socialtext Workspace v2.19.0.2</generator>

<item>
<title><![CDATA[CH552G]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?ch552g</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div class="wiki">
<p>
<a target="_blank" title="(external link)" href="https://altbier.us/ch552g/Intro_to_the_CH552G_Microcontroller.pdf">https://altbier.us/ch552g/Intro_to_the_CH552G_Microcontroller.pdf</a></p>
<h1 id="rgb_micropad_3_keys_1_rotary_encoder">RGB micropad 3 keys 1 rotary encoder</h1>
<p>
RGB micropad with three buttons and rotary encoder based on CH552G</p>
<p>
<a target="_blank" title="(external link)" href="https://github.com/eccherda/ch552g_mini_keyboard/">https://github.com/eccherda/ch552g_mini_keyboard/</a></p>
<p>
<a target="_blank" title="(external link)" href="https://hackaday.io/project/189914-rgb-macropad-custom-firmware">https://hackaday.io/project/189914-rgb-macropad-custom-firmware</a></p>
<p>
<a target="_blank" title="(external link)" href="https://github.com/biemster/3keys_1knob">https://github.com/biemster/3keys_1knob</a></p>
<p>
fork with hid sending (which somehow doesn't work) <a target="_blank" title="(external link)" href="https://github.com/mgrenonville/3keys_1knob/tree/serial">https://github.com/mgrenonville/3keys_1knob/tree/serial</a></p>
<p>
fork with ability to send sequence of keys (with different eeprom config) <a target="_blank" title="(external link)" href="https://github.com/MrGeorgeK55/Macropad-3-keys-1-knob">https://github.com/MrGeorgeK55/Macropad-3-keys-1-knob</a></p>
<h2 id="flashing_tools">flashing tools</h2>
<p>
<a target="_blank" title="(external link)" href="https://github.com/MarsTechHAN/ch552tool">https://github.com/MarsTechHAN/ch552tool</a></p>
<p>
<a target="_blank" title="(external link)" href="https://github.com/rgwan/librech551">https://github.com/rgwan/librech551</a></p>
<p>
<a target="_blank" title="(external link)" href="https://github.com/frank-zago/isp55e0">https://github.com/frank-zago/isp55e0</a> - can read and write flash data</p>
<h2 id="usb_original">usb original</h2>
<pre>
[Thu Dec 12 11:24:45 2024] usb 3-3.3.4.4: new full-speed USB device number 28 using xhci_hcd
[Thu Dec 12 11:24:45 2024] usb 3-3.3.4.4: New USB device found, idVendor=1189, idProduct=8890, bcdDevice= 0.00
[Thu Dec 12 11:24:45 2024] usb 3-3.3.4.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[Thu Dec 12 11:24:45 2024] input: HID 1189:8890 as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.3/3-3.3.4/3-3.3.4.4/3-3.3.4.4:1.0/0003:1189:8890.0022/input/input70
[Thu Dec 12 11:24:46 2024] hid-generic 0003:1189:8890.0022: input,hidraw6: USB HID v1.11 Keyboard [HID 1189:8890] on usb-0000:00:14.0-3.3.4.4/input0
[Thu Dec 12 11:24:46 2024] usbhid 3-3.3.4.4:1.1: couldn't find an input interrupt endpoint
[Thu Dec 12 11:24:46 2024] input: HID 1189:8890 Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.3/3-3.3.4/3-3.3.4.4/3-3.3.4.4:1.2/0003:1189:8890.0023/input/input71
[Thu Dec 12 11:24:46 2024] hid-generic 0003:1189:8890.0023: input,hidraw7: USB HID v1.00 Keyboard [HID 1189:8890] on usb-0000:00:14.0-3.3.4.4/input2
[Thu Dec 12 11:24:46 2024] input: HID 1189:8890 as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.3/3-3.3.4/3-3.3.4.4/3-3.3.4.4:1.3/0003:1189:8890.0024/input/input72
[Thu Dec 12 11:24:46 2024] hid-generic 0003:1189:8890.0024: input,hidraw8: USB HID v1.10 Mouse [HID 1189:8890] on usb-0000:00:14.0-3.3.4.4/input3
</pre>
<br /><p>
after shoring unpopulated pad on bottom of board and plugging back in to enter bootloader mode</p>
<pre>
[Thu Dec 12 11:31:40 2024] usb 3-3.3.4.4: new full-speed USB device number 29 using xhci_hcd
[Thu Dec 12 11:31:40 2024] usb 3-3.3.4.4: New USB device found, idVendor=4348, idProduct=55e0, bcdDevice= 2.40
[Thu Dec 12 11:31:40 2024] usb 3-3.3.4.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
</pre>
<br /><h1 id="arduino">Arduino</h1>
<p>
After compiling and flashing doesn't work with error because of permissions to device in bootloader mode.</p>
<p>
Re-run flashing command with sudo:</p>
<pre>
dpavlin@nuc:~$ sudo /home/dpavlin/.arduino15/packages/CH55xDuino/tools/MCS51Tools/2023.10.10/linux/vnproch55x -r 2 -t CH552 -c 3 /tmp/arduino_build_734169/ch552g_mini_keyboard.ino.hex
------------------------------------------------------------------
CH55x Programmer by Deqing
Updated on: 2023/10/10
------------------------------------------------------------------
usbRertySeconds 2
target: CH552
config bytes: 3
Load file as hex
   Loaded 12673 bytes between: 0000 to 31CE
DeviceVersion of CH55x: 2.40
MCU ID: 52 11
Found Device CH552
Bootloader: 2.4.0
ID: 4E 8F 51 BC
XOR Mask: EA EA EA EA EA EA EA 3C
Write 12751 bytes from bin file.
..................................................
Write complete!!!
Verify chip
..................................................
Verify complete!!!
------------------------------------------------------------------
Reset OK

dpavlin@nuc:~$ 

[Thu Dec 12 11:36:59 2024] usb 3-3.3.4.4: USB disconnect, device number 29
[Thu Dec 12 11:36:59 2024] usb 3-3.3.4.4: new full-speed USB device number 30 using xhci_hcd
[Thu Dec 12 11:36:59 2024] usb 3-3.3.4.4: New USB device found, idVendor=1209, idProduct=c55d, bcdDevice= 1.00
[Thu Dec 12 11:36:59 2024] usb 3-3.3.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Thu Dec 12 11:36:59 2024] usb 3-3.3.4.4: Product: CH55xduino
[Thu Dec 12 11:36:59 2024] usb 3-3.3.4.4: Manufacturer: Deqing
[Thu Dec 12 11:36:59 2024] usb 3-3.3.4.4: SerialNumber: CH55x kbd mos
[Thu Dec 12 11:36:59 2024] input: Deqing CH55xduino Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.3/3-3.3.4/3-3.3.4.4/3-3.3.4.4:1.0/0003:1209:C55D.0025/input/input73
[Thu Dec 12 11:36:59 2024] input: Deqing CH55xduino Mouse as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.3/3-3.3.4/3-3.3.4.4/3-3.3.4.4:1.0/0003:1209:C55D.0025/input/input74
[Thu Dec 12 11:36:59 2024] hid-generic 0003:1209:C55D.0025: input,hidraw6: USB HID v1.10 Keyboard [Deqing CH55xduino] on usb-0000:00:14.0-3.3.4.4/input0
[Thu Dec 12 14:40:42 2024] input: WH-1000XM5 (AVRCP) as /devices/virtual/input/input75
</pre>
<br /><p>
better yet, copy udev rules</p>
<pre>
dpavlin@nuc:~/.arduino15/packages/CH55xDuino/tools/MCS51Tools/2023.10.10$ sudo cp -v linux/99-ch55xbl.rules /etc/udev/rules.d/
'linux/99-ch55xbl.rules' -&gt; '/etc/udev/rules.d/99-ch55xbl.rules'

root@nuc:~# udevadm control --reload-rules &amp;&amp; udevadm trigger
</pre>
</div>
]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category></category>
<guid isPermaLink="true">https://saturn.ffzg.hr/rot13/index.cgi?ch552g</guid>
<pubDate>Tue, 17 Dec 2024 08:56:49 -0000</pubDate>
</item>
</channel>
</rss>