reversebias / mitosis

Firmware for nordic MCUs used in the Mitosis Keyboard
GNU General Public License v3.0
195 stars 125 forks source link

Compatibility with HZX-51822-16M05 #11

Closed mterhar closed 6 years ago

mterhar commented 6 years ago

The group buy run by /u/PhenixFire supplied a this controller rather than the one used originally.

It works fine on the receiver unit.

The wireless keyboard parts seem to flash okay but then do not function as a keyboard.

mterhar commented 6 years ago

Datasheet: https://www.mokosmart.com/wp-content/uploads/2017/12/HZX-51822-16M05.pdf

mterhar commented 6 years ago

This seems like a problem: Unknown device (HWID 0x0000008f)

Below is a transcript of programming the right hand unit.

$ telnet localhost 4444
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> reset halt                                                                            
target halted due to debug-request, current mode: Thread 
xPSR: 0xc1000000 pc: 0x00000d5c msp: 0x20008000
> flash write_image /Users/mterhar/GitHub/mitosis/precompiled/precompiled-basic-right.hex
Unknown device (HWID 0x0000008f)
Can't erase protected sector @ 0x00000000
Failed to write to nrf51 flash
error writing to flash at address 0x00000000 at offset 0x00000000

> nrf51 mass_erase
> flash write_image /Users/mterhar/GitHub/mitosis/precompiled/precompiled-basic-right.hex
not enough working area available(requested 32)
no working area available, falling back to slow memory writes
wrote 15684 bytes from file /Users/mterhar/GitHub/mitosis/precompiled/precompiled-basic-right.hex in 4.258803s (3.596 KiB/s)
> reset
> shutdown
shutdown command invoked
pmalecka commented 6 years ago

The HZX-51822-16M05 /u/PhenixFire sourced for the groupbuy has the nRF51822qfaa chip, which only has 16kB of RAM. This should be fixed in #7. I got it working by flashing @joric 's devel precompiled binaries here: https://github.com/joric/mitosis/tree/devel

mterhar commented 6 years ago

I attempted to flash Joric's and it did not work. Can you post a bit more detail. Did you use the typical ST-Link v2 programming method?

pmalecka commented 6 years ago

hi mterhar, have a look here: https://github.com/joric/mitosis/tree/devel/precompiled

used a chinese st-linkv2 clone, and OpenOCD on windows

mterhar commented 6 years ago

This worked finally! I have no idea what was different. I used the same precompiled binaries and everything. The receiver unit needed re-flashing as well as the hand units, but they're all working now.