mattdibi / redox-keyboard

Ergonomic split mechanical keyboard
MIT License
1.82k stars 168 forks source link

ZMK firmware + nice!nano Redox build guide #126

Open mattdibi opened 2 years ago

mattdibi commented 2 years ago

As of https://github.com/zmkfirmware/zmk/pull/1002 ZMK supports the Redox keyboard. Add a build guide using nice!nano and the ZMK firmware.

chrismelba commented 2 years ago

I've just built one of these. What are you looking for exactly? Also, does ZMK support redox-w? Or just redox with a nice!nano?

mattdibi commented 2 years ago

Hi @chrismelba

thank you for reaching out!

What are you looking for exactly?

I would like to add:

for the ZMK-based Redox. Not much detail regarding the hardware (diodes, switches etc) there's already the main guide for that.

Also, does ZMK support redox-w? Or just redox with a nice!nano?

I don't think so. Only the redox rev1 supports the Pro Micro footprint. The redox-w uses the YJ-14015 (NRF51822) modules that I don't find in the ZMK docs among the supported hardware.

What do you think?

snizovtsev commented 2 years ago

I've spent last New Year's holidays unsuccessfully porting ZMK to YJ-14015. The main problem here is that it comes with NRF51822 QFAA chip with 16KB SRAM. Its not enough to get Zephyr's Bluetooth stack work. Even with super-crazy hacks I've only managed to run a simple Zephyr example that can advertise itself over BLE. However it crashes on pairing with stack overflow.

But here is a good news:

I think I could get ZMK work with QFAC version of chip on my next approach.

snizovtsev commented 2 years ago

As a hardware note, I'm not able to find any YJ-14015 modules with QFAC onboard. The only ones with 32KB of memory are original Core51822 which costs a slightly more. I've bought a few ones from Waveshare (Aliexpress) and another problem arise: they are a little bit wider than YJ-14015. However I've able to get them work with original PCB with help of hot air gun:

ghost commented 2 years ago

Guidance on making a redox1.0 that's wireless via nice!nanos and ZMK would be so useful to me, and assuredly others. Having the extra build information, firmware installation, and if you wanted to be kind, info on considerations battery wise, like voltage, connection, and other info. Users also maybe get both wired and wireless to swap to and from via this means which would also be amazing. Though currently I dont know if that's possible when you make a Redox1.0 and then make it wireless via nice!nanos because of lack of info. There's just missing info on understanding and building this version of the keyboard. I would greatly value if it was added, as I intend to make it and I assume others will too.

bmcustodio commented 2 years ago

I second this, it would be very useful to me too!

bmcustodio commented 2 years ago

@mattdibi @chrismelba would the bill of materials and the guide differ from the main ones (except, of course, for the nice!nanos)? My understanding is that the nice!nano is a drop-in replacement for the Pro Micro, but I am fairly new to this. What else would need to change?

mattdibi commented 2 years ago

@bmcustodio You're correct, the nice!nanos are a drop-in replacement for the Pro Micros. As you said the BOM wouldn't differ much:

Qty Item Difference with rev.1.0 Pro Micro build
70 Cherry MX compatible switches Still required
2 Redox PCBs Still required (rev.1.0)
70 1N4148 diodes Still required
2 PJ-320A 4 poles 3.5 mm TRRS connectors Not needed
2 4.7 kOhm resistors Not needed
2 Through hole momentary switch Still required (albeit not strictly necessary)
2 Nice!Nano Needed (new)
2 3.7v rechargeable lithium batteries Needed (new)
1 TRRS cable Not needed
1 USB-C cable For charging and programming (instead of USB micro)
70 Cherry MX compatible keycaps Still required (10x 1.25u, 6x 1.5u, 54x 1u keycaps)
14 WS2812/WS2812B leds Not needed (Would not recommend for a wireless build)

Additional details about the batteries in the nice!nano documentation:

3.7v rechargeable lithium battery that is at least 100mAh large (you can probably get away with 80mAh). Note when choosing a battery, the recharge rate is 100mA, so a 2,000mAh battery will take 20 hours to charge. The overall recommended battery for most low power (no LEDs or extra power sinks) is the 301230 battery. This battery is 3mm thick and fits underneath a socketed nice!nano very nicely. These can be found on some vendors' stores as well as on AliExpress.

In addition I highly suggest socketing the nice!nanos as mentioned in the nice!nano documentation.

bmcustodio commented 2 years ago

Thank you very much @mattdibi, this is really helpful! If I decide to try my luck at building one, I will add the guid if it hasn't been added by then!

ocfox commented 1 year ago

@snizovtsev Can you briefly describe how it needs to be done? I just got 3 QFAC 14015, and I want to continue to finish porting the Zmk firmware.

snizovtsev commented 1 year ago

@snizovtsev Can you briefly describe how it needs to be done? I just got 3 QFAC 14015, and I want to continue to finish porting the Zmk firmware.

It's not so easy. I had a barely working prototype a year ago and then give up because unplanned immigration eaten all of my free time. But I have much more time now and would like try dig into it again if its not just me interested in it.

The first thing to consider is that QFAC 14015 is not much better than QFAB. Before my QFAC chips arrived, I spent a lot of time on shrinking Zephyr's simple "bluetooth hello world" project to fit 16KB of QFAB. It almost worked but was so hacky and had no room for further applications.

With 32kb of QFAC things becomes much easier but it still a lot less than ZMK and Zephyr are designed for. A lot of time should be spent on optimizing the core of Zephyr's Bluetooth stack and ZMK for a 32kb memory chip.

I used zephyr-v2.7.1 as base. I remember that other versions had some NRF51-related regressions and didn't initialize bluetooth. Then I shrinked all large parts that prevents compilation of ZMK for QFAC. I remember I've even needed to reduce number of keys in the keymap to fit into memory. Its all is so hacky that I've haven't made any commits and left it in form of dirty project on my computer. I will try find some time to recap and publish that patches soon if you need it.

ocfox commented 1 year ago

I remember I've even needed to reduce number of keys in the keymap to fit into memory.

It doesn't sound like there's much availability, and if that's the case then I guess there's no point in continuing this work. And thanks for your reply!