kb45p - 45% prototype board (ALPS supported)
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
The plates have arrived. The quality is acceptable, but they do have some surface scratches. (I'll try to take detailed pics for the people interested in the kits.)
Now some photos:
More pics..
Now some photos:
More pics..
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Turns out that ST did not write the DFU bootloader in these MCUs in a smart way; and I wasn't aware of that when I designed the PCB. So, unfortunately, the only way to get into the bootloader is to press the button on the bottom of the PCB; I wasn't able to make jumping from firmware to work. The good news is that it's possible to press the button even with the bottom plate fully mounted, using e.g. a tip of a knife, screwdriver, or even just a paper clip.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
It is possible to fix this by piggybacking a capacitor on top of the pull-down resistor, like so. The point is that the DFU bootloader always checks the status of the "button pin", and the cap creates a RC circuit which will keep the pin high for a short while after a reset.
- vivalarevolución
- formerly prdlm2009
- Location: USA
- Main keyboard: IBM Beam spring
- Main mouse: Kangaroo
- Favorite switch: beam spring
- DT Pro Member: 0097
Thanks for the info. I'm accustomed to having to push a button for any bootloader functions, anything more would feel like luxury.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
OK, so people might be receiving their KB45P PCBs soonish, so here are some instructions about getting TMK running on it (the shipped PCBs have TMK already there, with my default layout).
-----------------
A) Getting into the bootloader
A1) The hardware way (always works): hold the button on the PCB and power up
A2) The "software way" (works depending on the firmware, does with my TMK):
A2a) press the button on the PCB for >=1/2sec
A2b) "press" KC_BTLD keycode in TMK
-----------------
B) Flashing
On linux/OS X, I use dfu-util. Should work on Windows as well if you get a hold of dfu-util binary. BTW Infinity KB uses the same DFU protocol, so this may be also useful.
The command then is (the last bit being the path to the firmware binary).
-----------------
C) Compiling
You'll need an ARM gcc toolchain; on Windows also cygwin/msys (pretty much the same requirement as for avr-gcc stuff). Git is also useful.
My current kb45 sources are here. They go with (at the moment a fork, but it's based on hasu's 'newapi' branch, and he seems to want to have it merged) this tmk_core fork (i.e. 'newapi' branch). Note that the fork is only necessary for the 'software bootloader entering', there are no changes to any of the core features.
So, checkout the kb45p sources, checkout tmk_core alongside, checkout 'newapi' branch in tmk_core, and you should be set.
-----------------
A) Getting into the bootloader
A1) The hardware way (always works): hold the button on the PCB and power up
A2) The "software way" (works depending on the firmware, does with my TMK):
A2a) press the button on the PCB for >=1/2sec
A2b) "press" KC_BTLD keycode in TMK
-----------------
B) Flashing
On linux/OS X, I use dfu-util. Should work on Windows as well if you get a hold of dfu-util binary. BTW Infinity KB uses the same DFU protocol, so this may be also useful.
The command then is
Code: Select all
dfu-util -a 0 -s 0x8000000 -D build/ch.bin
-----------------
C) Compiling
You'll need an ARM gcc toolchain; on Windows also cygwin/msys (pretty much the same requirement as for avr-gcc stuff). Git is also useful.
My current kb45 sources are here. They go with (at the moment a fork, but it's based on hasu's 'newapi' branch, and he seems to want to have it merged) this tmk_core fork (i.e. 'newapi' branch). Note that the fork is only necessary for the 'software bootloader entering', there are no changes to any of the core features.
So, checkout the kb45p sources, checkout tmk_core alongside, checkout 'newapi' branch in tmk_core, and you should be set.
Last edited by flabbergast on 11 Mar 2016, 21:36, edited 1 time in total.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Forgot to say that BOOTMAGIC is not implemented yet. The reason being that these small buggers don't have EEPROM (which is where BOOTMAGIC settings are stored). Faking an EEPROM with flash is in the pipeline though (it is done like this for Teensy LC for instance).
-
- Location: France
- Main keyboard: KBT Pure Pro
- Main mouse: G500
- Favorite switch: MX Red, MX Blue
- DT Pro Member: -
Got mine today! I won't be able to build it before next week but i can't wait — my TA dyesubs will be great on it. And thanks for the details on how to flash it. I'll probably use an Ubuntu VM to compile — I made one a few weeks ago to fiddle with TMK and avoid the usual problems that Windows has with AVR, and compiling within Linux was super easy. Hopefully it won't be too different with the ARM branch.
-
- Location: United States
- Main keyboard: KUL-87, clears, 1976 set
- Main mouse: some MS abomination
- Favorite switch: none
- DT Pro Member: -
Min arrived, and is now partially assembled. I'm using some paint to take care of the scratches, and it looks great.
Is there a reference of the default layout layers? If I reprogram, what matrix am I using?
Is there a reference of the default layout layers? If I reprogram, what matrix am I using?
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
I've also added the default firmware binary to the github repo here, so that if you mess up you can always get into the bootloader the hardware way (press the PCB button and power up) and flash this one. This is the one I'm using, so it definitely should work.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
OK, so some instructions for flashing firmware on Windows.
When you enter the "bootloader" mode, a.k.a. "DFU mode", Windows should automatically install drivers (you can read about this on pages 7-8 of this pdf).
This may not exactly work for some reason (google "STM32 DFU bootloader windows driver" to see some reports).
However you should see something like "STM32 BOOTLOADER" or "STM32 device in DFU mode" in the 'device manager' under 'USB devices' or 'USB controllers'.
We'll need to replace this driver with a winusb one anyway. So, get zadig. Run it while the keyboard is plugged in *and* in DFU mode. Select the relevant "STM32 DFU" device from the drop down list (you may need to do "Options" -> "List all devices"). Select "winusb" driver in the list to the right of the green arrow. Punch "replace driver" or "install driver" button. This should install/replace the current driver for the DFU device with a winusb one - which is what's needed for dfu-util to work.
Second step: dfu-util. You can get a binary from here: dfu-util-static.exe. You can use this from the command line (get into one with <Win+R>cmd.exe<Enter>). Running 'dfu-util-static.exe -l' should list the STM32 DFU device (actually 2 of them).
When you enter the "bootloader" mode, a.k.a. "DFU mode", Windows should automatically install drivers (you can read about this on pages 7-8 of this pdf).
This may not exactly work for some reason (google "STM32 DFU bootloader windows driver" to see some reports).
However you should see something like "STM32 BOOTLOADER" or "STM32 device in DFU mode" in the 'device manager' under 'USB devices' or 'USB controllers'.
We'll need to replace this driver with a winusb one anyway. So, get zadig. Run it while the keyboard is plugged in *and* in DFU mode. Select the relevant "STM32 DFU" device from the drop down list (you may need to do "Options" -> "List all devices"). Select "winusb" driver in the list to the right of the green arrow. Punch "replace driver" or "install driver" button. This should install/replace the current driver for the DFU device with a winusb one - which is what's needed for dfu-util to work.
Second step: dfu-util. You can get a binary from here: dfu-util-static.exe. You can use this from the command line (get into one with <Win+R>cmd.exe<Enter>). Running 'dfu-util-static.exe -l' should list the STM32 DFU device (actually 2 of them).
- vivalarevolución
- formerly prdlm2009
- Location: USA
- Main keyboard: IBM Beam spring
- Main mouse: Kangaroo
- Favorite switch: beam spring
- DT Pro Member: 0097
My package is in the country, I can't wait for it to arrive. I will be programming it on Linux, so I will review your instructions here and let you know if I have any issues.
- StreetWizard
- Location: US, NC
- Main keyboard: HHKB2, Planck, Satan GH60
- Main mouse: Steel series RIVAL
- Favorite switch: Vintage MX black
- DT Pro Member: -
Okay I got my board all assembled but I can't figure out how to compile this firmware for the life of me (I used easyAVR up until now). I just want to swap the backspace on the bottom row for a space.
help
help
- vivalarevolución
- formerly prdlm2009
- Location: USA
- Main keyboard: IBM Beam spring
- Main mouse: Kangaroo
- Favorite switch: beam spring
- DT Pro Member: 0097
Got my assembled and working. Keycaps are a little random, but they are all the right sizes. Just need to customize the layout, compile the firmware, and flash it to the controller.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Pretty nice!
And it's true that it's not easy to even get ALPS keycaps with the right profiles, and almost impossible to get some with the right legends Hopefully Alpine Winter will have been enough of a success that something similar is going to run again and we'll be able to get at least blanks for the more tricky keys.
Also: the compiling instructions are perhaps not so clear, and before the little bits get merged into TMK and Chibios, please use this for compiling:
1) getting an ARM toolchain plus development tools
ARM toolchain from here: https://launchpad.net/gcc-arm-embedded
You'll also need misc dev tools (make, grep, ...); these are either: http://www.mingw.org/wiki/msys
or: https://www.cygwin.com/
2) Getting the sources:
a) my sources for kb45p:
zip
b) tmk_core (newapi branch ATM):
zip
c) chibios (there's been some recent changes in chibios git that will make adjusting the sources inevitable; so you can use my branch which hasn't been updated to these (link below), or you can also probably use the latest stable chibios release):
zip
{These will change with time, as the code is being merged to upstream tmk and chibios, but at the moment these forks should be sychronised just right.}
Now unpack these: the directory structure you should end up with is:
Now go to 'flabber_kbs/kb45p' and run 'make'. This should compile the firmware, and the resulting freshly built one is 'build/ch.bin'.
And it's true that it's not easy to even get ALPS keycaps with the right profiles, and almost impossible to get some with the right legends Hopefully Alpine Winter will have been enough of a success that something similar is going to run again and we'll be able to get at least blanks for the more tricky keys.
Also: the compiling instructions are perhaps not so clear, and before the little bits get merged into TMK and Chibios, please use this for compiling:
1) getting an ARM toolchain plus development tools
ARM toolchain from here: https://launchpad.net/gcc-arm-embedded
You'll also need misc dev tools (make, grep, ...); these are either: http://www.mingw.org/wiki/msys
or: https://www.cygwin.com/
2) Getting the sources:
a) my sources for kb45p:
zip
b) tmk_core (newapi branch ATM):
zip
c) chibios (there's been some recent changes in chibios git that will make adjusting the sources inevitable; so you can use my branch which hasn't been updated to these (link below), or you can also probably use the latest stable chibios release):
zip
{These will change with time, as the code is being merged to upstream tmk and chibios, but at the moment these forks should be sychronised just right.}
Now unpack these: the directory structure you should end up with is:
Code: Select all
<empty_dir_of_your_liking>
|-- flabber_kbs (unpacked and renamed contents of the zip from a)
\-- tmk_core (unpacked and renamed contents of the zip from b)
\-- tool/chibios/chibios (unpacked and renamed contents of the zip from c)
Last edited by flabbergast on 03 Apr 2016, 09:03, edited 1 time in total.
- vivalarevolución
- formerly prdlm2009
- Location: USA
- Main keyboard: IBM Beam spring
- Main mouse: Kangaroo
- Favorite switch: beam spring
- DT Pro Member: 0097
Yea, the Alpine Winter set has all the correct sizes and profiles, but because of the issue with differing stem heights, I am not using those. Of course, it does not have the correct legends.
Fyi, the link for 2a (kb45p sources) is not working. When I click on it, I get some the 404 error nonsense. I think your text is missing the "kbs" after the underscore.
I will be compiling this on Linux, I'll check in if I run into any issues or maybe go straight to the TMK thread.
Fyi, the link for 2a (kb45p sources) is not working. When I click on it, I get some the 404 error nonsense. I think your text is missing the "kbs" after the underscore.
I will be compiling this on Linux, I'll check in if I run into any issues or maybe go straight to the TMK thread.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Thanks! Actually all the links to github were messed up (because I just pasted them in, didn't use url tags, and the forum software didn't parse them correctly for some reason).vivalarevolución wrote: ↑Fyi, the link for 2a (kb45p sources) is not working. When I click on it, I get some the 404 error nonsense. I think your text is missing the "kbs" after the underscore.
- vivalarevolución
- formerly prdlm2009
- Location: USA
- Main keyboard: IBM Beam spring
- Main mouse: Kangaroo
- Favorite switch: beam spring
- DT Pro Member: 0097
Well, I got mine working. There were a few errors along the way. I would make sure that you change those folder names to what flabbergast says and also make sure you have the keyboard in the proper bootloader mode. Those were my two main hangups (besides incorrect keyboards in the keymap file).
Great little keyboard that I probably will use for portability purposes. Well done. And the capabilities of TMK just make the little thing that much more useful.
Great little keyboard that I probably will use for portability purposes. Well done. And the capabilities of TMK just make the little thing that much more useful.
-
- Location: Madison, WI USA
- DT Pro Member: -
Finally had time to build mine. It was my first build with a PCB and I was amazed at how fast it went compared to hand-wiring. Currently running the stock firmware, but I was able to rebuild the firmware, just haven't flashed the new file yet. Almost had all the right caps (sizes and profiles, not legends), but not quite. Most are from an HP rubber dome board with alps-mount keycaps.
-
- Location: United States
- Main keyboard: KUL-87, clears, 1976 set
- Main mouse: some MS abomination
- Favorite switch: none
- DT Pro Member: -
No pics yet, but mine is getting a lot of use. I use it as my travel board. I'm out of town right now, and this little thing makes typing on my phone so much nicer. I highly recommend it.
I'll post pics eventually. Just like I will try to reprogram the layout eventually.
The big question right now is if it is small enough to fit in my suit jacket while I am at the conference tomorrow.
I'll post pics eventually. Just like I will try to reprogram the layout eventually.
The big question right now is if it is small enough to fit in my suit jacket while I am at the conference tomorrow.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Thanks for the kind words, I'm happy to hear that they're getting some use
@chuckdee: seems like I have 1 PCB left now; PM me if interested.
@chuckdee: seems like I have 1 PCB left now; PM me if interested.
- vivalarevolución
- formerly prdlm2009
- Location: USA
- Main keyboard: IBM Beam spring
- Main mouse: Kangaroo
- Favorite switch: beam spring
- DT Pro Member: 0097
The files for the PCB and the plates are in the OP. I am assuming that because he made them available, flabbergast does not mind if you use the files to make a few keyboards yourself.
I am wearing a suit right now as I type on this. Let me check. It's doable if you have deep pockets:BlueNalgene wrote: ↑No pics yet, but mine is getting a lot of use. I use it as my travel board. I'm out of town right now, and this little thing makes typing on my phone so much nicer. I highly recommend it.
I'll post pics eventually. Just like I will try to reprogram the layout eventually.
The big question right now is if it is small enough to fit in my suit jacket while I am at the conference tomorrow.
-
- Location: United States
- Main keyboard: KUL-87, clears, 1976 set
- Main mouse: some MS abomination
- Favorite switch: none
- DT Pro Member: -
I finally got around to taking some pictures of my kb45p build. I'm using my GF's Alpine Winter set on it currently. I will make the switch to a set of Dell AT101W caps after she returns from the far distant lands of Canadia and I can put on her nice caps for her.
My plates are painted. The top plate, which is mostly covered by the caps, has a black and dark blue enamel coating I added with an airbrush. I put a topcoat of nitrocellulose on it to give it the texture I like. I had airbrush issues while painting the last coat, so I had to switch to spray paint. For this I instead used a coat of solid dark blue spray paint, then dustings of white and baby blue to give it a speckled finish that catches the light well. After that I put the same nitrocellulose coating on the paint, and this caused some issues.
As you can see, the nitrocellulose dissolved the spray paint and left it with very obvious brush strokes when I put on the clear coat. At first, I was pretty pissed about this. Over time and use, I have relented. The strong brush strokes give it a shapeless quality I sort of enjoy. Additionally, since this is my de facto travel board, I'm not mortified when it gets the occasional ding or scuff.
Overall, it is the perfect travel board. It weighs in at 296.00 g, making it super light for carrying. Considering my 60% I'm using right now weighs >1kg, this is a big difference. I use it with one of those convenient OTG USB cable so I am able to use my Nexus 10 like a laptop for writing and editing on the go or with it plugged into my phone, text with the GF.
My current complaints with the board are mostly layout related. The lack of an apostrophe key really messes me up. Many a text with the GF has been sent too soon because I press Enter when I only intended to use a contraction. Other layout issues, such as the HHKB arrow key locations, are fixable with custom programming. As such, they aren't worth mentioning. However, I am not able to reprogram yet, as the ARM architecture on this board seems to be tripping me up. I don't have much/any experience working outside of AVR, and my skills in that are novice at best. Between issues with the gcc toolchain not behaving on Windows and some 32-bit errors on my 64-bit linux box, the reprogramming just hasn't happened yet. Hopefully it will soon.
Thanks again to Flabbergast for this little creation. I'm glad I could help with the plates to make this cute little board happen.
My plates are painted. The top plate, which is mostly covered by the caps, has a black and dark blue enamel coating I added with an airbrush. I put a topcoat of nitrocellulose on it to give it the texture I like. I had airbrush issues while painting the last coat, so I had to switch to spray paint. For this I instead used a coat of solid dark blue spray paint, then dustings of white and baby blue to give it a speckled finish that catches the light well. After that I put the same nitrocellulose coating on the paint, and this caused some issues.
As you can see, the nitrocellulose dissolved the spray paint and left it with very obvious brush strokes when I put on the clear coat. At first, I was pretty pissed about this. Over time and use, I have relented. The strong brush strokes give it a shapeless quality I sort of enjoy. Additionally, since this is my de facto travel board, I'm not mortified when it gets the occasional ding or scuff.
Overall, it is the perfect travel board. It weighs in at 296.00 g, making it super light for carrying. Considering my 60% I'm using right now weighs >1kg, this is a big difference. I use it with one of those convenient OTG USB cable so I am able to use my Nexus 10 like a laptop for writing and editing on the go or with it plugged into my phone, text with the GF.
My current complaints with the board are mostly layout related. The lack of an apostrophe key really messes me up. Many a text with the GF has been sent too soon because I press Enter when I only intended to use a contraction. Other layout issues, such as the HHKB arrow key locations, are fixable with custom programming. As such, they aren't worth mentioning. However, I am not able to reprogram yet, as the ARM architecture on this board seems to be tripping me up. I don't have much/any experience working outside of AVR, and my skills in that are novice at best. Between issues with the gcc toolchain not behaving on Windows and some 32-bit errors on my 64-bit linux box, the reprogramming just hasn't happened yet. Hopefully it will soon.
Thanks again to Flabbergast for this little creation. I'm glad I could help with the plates to make this cute little board happen.
- vivalarevolución
- formerly prdlm2009
- Location: USA
- Main keyboard: IBM Beam spring
- Main mouse: Kangaroo
- Favorite switch: beam spring
- DT Pro Member: 0097
I programmed mine on Linux and did not have any problems once I downloaded the proper packages for the gcc toolchain and the dependencies. Also, arranging and renaming the folders was critical. What issues are you having with ARM architecture? I just copy and pasted the code that flabbergast shared above (changed the directory for the file, of course), and everything worked fine from there.
-
- Location: United States
- Main keyboard: KUL-87, clears, 1976 set
- Main mouse: some MS abomination
- Favorite switch: none
- DT Pro Member: -
I'm out and about again. I'm typing this on the board in a hotel room in some nowheresville oil town. Can you believe my boss had the gall to shake his head at my travelling keyboard? He must be jealous.
Since I'm away from the programming computer, I can't really give the exact errors. I know I was having problems calling the toolchain, since it was not given a PATH on my commandline install. It just needs some more fixing, but work came first. Thanks for offering the help, but I will keep my questions confined to PMs and the TMK thread since my problem isn't specific to this keyboard. I don't want to derail.
Since I'm away from the programming computer, I can't really give the exact errors. I know I was having problems calling the toolchain, since it was not given a PATH on my commandline install. It just needs some more fixing, but work came first. Thanks for offering the help, but I will keep my questions confined to PMs and the TMK thread since my problem isn't specific to this keyboard. I don't want to derail.
- scottc
- ☃
- Location: Remote locations in Europe
- Main keyboard: GH60-HASRO 62g Nixies, HHKB Pro1 HS, Novatouch
- Main mouse: Steelseries Rival 300
- Favorite switch: Nixdorf 'Soft Touch' MX Black
- DT Pro Member: -
Actually I'd say that getting firmware built is probably proving to be a challenge for many people! I didn't ultimately buy one of these (too late for a plate and too many projects already) but I imagine it'd be useful for there to be documentation of fixes for others to benefit from.