carlossless / smk

A keyboard firmware for sinowealth-8051-based devices
GNU General Public License v2.0
58 stars 9 forks source link

Code Options Clarification #2

Closed thesilvanator closed 10 months ago

thesilvanator commented 10 months ago

Hey,

Was wondering if you could expand on what the Code Options described here represent? Struggling to find where they are referenced in the code. Are these similar to fuse bits on AVR? Was hoping to get a bit of a further explaination!

Thanks!

carlossless commented 10 months ago

@thesilvanator yep, they are very much like AVR fuse bits and they are also set only when programming the device.

I haven't checked this thoroughly, but I assume it's not possible to access those values through code that's running on the device, meaning that it's probably not possible to read/write them through the USB (ISP) bootloader. Instead, you would have to use:

You can find explanations for the individual code options in the device datasheets (page 93 for sh68f90), or in the GPT files found in the "Keil Driver Install Package" and decrypted with this tool.


* any 8051-capable programming device from Sinowealth. I own and use a Sinolink.

thesilvanator commented 10 months ago

Hey!

Thanks for the quick and detailed reply! I really appreciate it!

I'll be purchasing a Halo96 sometime in the next few weeks. I'll see what info I can get out of it and I'll share here (plus your sinowealth-kb-tool and the 8051-dumper if relevant).

Unfortunately, I can't seem to find any Sinowealth programmers shippable to my country for under $100 lol. So I may be limited to read only with the 8051-dumper. I took a peek at the issue threads on that repo and I saw there was some discussion about adding write support to it. I may take a stab at reverse engineering that from the gpt files.

In the meantime, I'll keep my eyes peeled for a reasonably priced sino programmer.

Thanks!

carlossless commented 10 months ago

@thesilvanator

I'll be purchasing a Halo96 sometime in the next few weeks. I'll see what info I can get out of it and I'll share here (plus your sinowealth-kb-tool and the 8051-dumper if relevant).

Nice! High-res teardown pictures are also very much appreciated!

Unfortunately, I can't seem to find any Sinowealth programmers shippable to my country for under $100 lol

I saw you can find sinolinks for ¥400 ~ 57USD in taobao, using a shipping forwarder like superbuy your total should be under 100 USD. Not sure about import fees though.

I took a peek at the issue threads on that repo and I saw there was some discussion about adding write support to it. I may take a stab at reverse engineering that from the gpt files.

I'm not sure if the GPT files would be enough to reverse-engineer writing, I did share some JTAG captures though, perhaps those could be helpful for the reverse engineering effort.

I'll close the issue, but we can continue the discussion here.