- Date written: 2024-10-30
- Python version: 3.12.7
- Rust version: 1.82.0
- PyO3 version: 0.22.5
- zlib version: 1.3.1
JLCPCB color silkscreen files are encrypted using AES-128-GCM and RSA-2048 with OAEP padding with SHA-256 as the hash function. Unfortunately, this means that, although it is possible for tools other than EasyEDA to create files, only JLCPCB can decrypt the resulting files.
The structure of an encrypted file is as follows:
- 256 bytes RSA-encrypted AES key
- 256 bytes RSA-encrypted GCM nonce
This has been reverse engineered from the toolchain only and has not been tested on hardware.
The c.lbu
, c.lhu
, c.sb
, and c.sh
opcodes replace some standard opcodes (that the QingKe cores do not implement, as the replaced opcodes require the D
extension), and they also appear to be compatible with "Huawei" extensions mentioned here.
The c.lbusp
, c.lhusp
, c.sbsp
, and c.shsp
opcodes exist in a "reserved" opcode block.
001 uimm[0] uimm[4:3] rs1` uimm[2:1] rd` 00 c.lbu (replacing c.fld)
#include <stdint.h> | |
#include <string.h> | |
#include "CH579SFR.h" | |
void write_str(const char *s) { | |
for (uint32_t i = 0; i < strlen(s); i++) { | |
while (!(R8_UART1_LSR & RB_LSR_TX_FIFO_EMP)) {} | |
R8_UART1_THR = s[i]; | |
} |
service 0xFFF0 characteristic 0xFFF2 --> commands service 0xFFF0 characteristic 0xFFF1 --> responses
0xB4 0x4B len type <payload> csum
len -> number of bytes in payload
csum -> add all of the previous bytes in the packet and truncate to 1 byte
import sys | |
def parse_cnf(infn): | |
with open(infn, 'r') as f: | |
inp = f.readlines() | |
while inp: | |
l = inp[0] | |
inp = inp[1:] |
import sys | |
def parse_cnf(infn): | |
with open(infn, 'r') as f: | |
inp = f.readlines() | |
# print(inp) | |
while inp: | |
l = inp[0] |
import struct | |
import time | |
import usb | |
dev = usb.core.find(idVendor=0x32f8, idProduct=0x424c) | |
# print(dev) | |
dev.set_configuration() | |
serno = usb.util.get_string(dev, dev.iSerialNumber) |
OUTDATED PLEASE GO TO https://github.com/rqou/linux/tree/atc-m1max | |
if instance == 0 | |
AUSPLL_CORE_AUSPLL_CFG_DCO_EFUSE_SPARE.RODCO_ENCAP_EFUSE = efuse 0xa10 >> 25 | |
AUSPLL_CORE_AUSPLL_CFG_DCO_EFUSE_SPARE.RODCO_BIASADJ_EFUSE = efuse 0xa10 >> 22 |