-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report of operation #2
Comments
Great, glad to hear it works. I'm using optiboot bootloader in my Arduino board and have SUT fuses set to 4.1ms pre-delay, so I didn't have to complicate it. |
Out of curiosity, what is that keyboard you have tested it on? I've another keyboard - Genesis Thor 300 RGB. There is SH68F90 on PCB. I'll try it to check if it works on different chip too. |
Setup with relying on quick bootloader doesn't work for me, because, I would also need to connect external UART and complicate it even further, but detecting vref is rather clean though I will probably need to also add high side switch to mess with other ~opcodes so hopefully I can erase and write soon. (sadly there aren't many erased bytes remaining in my stock fw, and I don't have idea about opcode for mass/sector erase so I guess I will just try all 0x40-x4F until some sector erases) Mechanical keyboard with single color LEDs (each row having different color) RE-K70-BYK800 on PCB silkscreen, HYKKER branding on case. I have some very partial pinouts for SH68F88 and they match so far (Power/USB/JTAG/Reset). Not entirely sure which one should be VDP, but one of those two :) |
@swiftgeek Why do you need to connect external UART? Optiboot just jump to sketch directly in case of POR, UART stuff should work the same as with stock one. Did you measure with oscilloscope what is going on in your case? How long was that boot delay? When I started to experiment with this, I had it all on breadboard with power controlling circuit, but ultimately just wires to Arduino Nano was the most convenient solution when I got rid of boot delay. Thanks for the info. I read that BYK800 chip is supposed to be a clone of some SinoWealth MCU, but I wouldn't guess it's 1:1 copy of SH68F881 with the same part number programmed inside. |
It's just some company hiding MCU used, BYKxxx is using variety of chips and vendors. Sadly removing markings/replacing with your own markings is a common practice those days. I have seen even regular classic opamps parts having markings scratched off/replaced, to pretend device is much smarter than it is. Additionally sinowealth supplies dice so it would be technically feasible to package it yourself with entirely different pinout/package, but I haven't seen that much effort put into hiding your supply chain chain yet. If I hotplug UART with atmega, I have to deal not only with atmega boot time, but also that one from UART chip, and UART console app on host and entire enumeration. Sensing DUT Vcc is trivial in comparison, and pretty much eliminates all timing/enumeration issues. |
You do what you need to do, but now I'm lost completely. What is your setup here? You don't need to do any of that. Just get your ATmega to execute code within first 20ms for first power-up to establish the connection, then any additional delays won't matter. But you're right about that chinese practice of sanding out of IC markings or replacing them, find datasheets for those chips is pure luck. I'm surprised that SinoWealth let firmwares for their programmers to be downloaded without some NDA bullshit. I wish every IC manufacturer were like Microchip or Renesas... |
BTW, I've failed to dump firmware of SH68F90 in second keyboard. It has all security bits set, even executing MOVC instruction is blocked at hardware level :( |
I prefer having less race conditions in my setup, and less things changing at a time. Makes debugging/troubleshooting easier (but cost/benefit also needs to be taken into account ofc, and the less connections/setup is actually required the better too) As for SH68F90 I guess "mass erase" would unlock it, but I have no expectations on how would that opcode look like / what parameters would it take (or additional opcodes required like address opcodes for read/write operations), so it's up to your reversing skills there. It's probably better to test that on SH68F88 and related dies since it doesn't seem to mention code protection capabilities but I might be wrong about that. In any case I think I can test any ideas about remaining opcodes if you run into any (I'm starting to guess that
|
Ah sorry now I get that making dump is important for backing up stock firmware, then I would guess it would easily fall to voltage glitching attacks. I have so little interest in original firmware that it completely went over my head. Though SH68F90 exposes less rails than SH68F88 so it might be a bit challenging |
Mass erase would help, but my goal is to dump the firmware, not programming or erasing the chip. I broke some firmwares out of protected chips before, but I have a feeling that this one will be hard. |
There is no It would help to get boot ROM from one of these chips, I guess there is communication protocol implemented. But I don't have chip that have boot ROM programmable, don't know if it's possible to read it from the chips we're dealing with now. |
I'm just going off sinowealth using |
I don't know if it skip invalid commands, but if |
I already started using defines heavily in I don't know what opcode Do you have a list of opcodes used by programmer (especially erase if identified that far)? |
It's not just single opcode to do flash erase/program, I'll try to document it. |
As I'm looking on it now, |
If |
If programmer give MCU time to do something, it just wait or emits clock pulses. It never sends It sends NOPs instructions in JTAG mode, but this is completely different story. In that mode raw instruction opcodes can be send and CPU executes them directly. That is why MOVC can be blocked with security bit. |
I just realized I mixed it up. The command that is sent every few milliseconds (PING, SYNC?) is 0x49 0xFF, command sent during programming is 0x46. |
Hey, Just reporting that I was able to do a partially successful dump firmware from a NuPHY Air60 which has an SH68F90A (labeled as Firmware seems to be intact:
USB Descriptor:
P.S. Yes, it really does use Apple's idVendor (probably the idProduct too) |
@carlossless Many thanks for the valuable info :) |
Started working on recreating schematics and boardview in kicad for my board, based on CCD scans annotated in gimp. So far I have following results that could be applicable for more BYKxxx boards:
|
Pushed early WIP schematics, waiting for new kicad release to hit distro's repo to generate boardview |
Turns out my part is SH68F881 (I don't have markings on package)
Binary was recreated using
xxd -r -p test.hex > test.bin
and it contains strings found in USB descriptorFirst block of ~code/data starts at
0x1000
, next0x3000
, then0x5000
, then0x7000
, and finally two tiny binary portions at0x7F00
(65 bytes) and 5 bytes at0x7FA0
Since my arduino board take quite a long time to start a sketch, I ended up using digital pin 6 as vref detection (using analog pin for this would be a massive overkill). swiftgeek@8b356de
The text was updated successfully, but these errors were encountered: