kb45p - 45% prototype board (ALPS supported)

User avatar
flabbergast

05 Mar 2016, 18:17

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:

Image

Image

More pics..

User avatar
flabbergast

06 Mar 2016, 00:46

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.

User avatar
flabbergast

06 Mar 2016, 14:19

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.

User avatar
vivalarevolución
formerly prdlm2009

06 Mar 2016, 20:34

Thanks for the info. I'm accustomed to having to push a button for any bootloader functions, anything more would feel like luxury.

User avatar
flabbergast

11 Mar 2016, 09:39

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

Code: Select all

dfu-util -a 0 -s 0x8000000 -D build/ch.bin
(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.
Last edited by flabbergast on 11 Mar 2016, 21:36, edited 1 time in total.

User avatar
flabbergast

11 Mar 2016, 10:36

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).

Matt_

11 Mar 2016, 17:08

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.

BlueNalgene

18 Mar 2016, 05:12

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?

User avatar
flabbergast

18 Mar 2016, 07:48

Thanks! Looking forward to some photos ;)

The default layout is here,
some reprogramming instructions a few posts above (you can see the matrix from the sources). Hope this helps...

User avatar
flabbergast

18 Mar 2016, 10:42

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.

User avatar
flabbergast

22 Mar 2016, 23:46

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).

User avatar
vivalarevolución
formerly prdlm2009

23 Mar 2016, 14:24

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.

mfr000

23 Mar 2016, 19:29

I got home from a trip yesterday and my package was waiting for me. Hope to find time to build it soon. Thanks, flabbergast!

User avatar
StreetWizard

30 Mar 2016, 04:49

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 :?

User avatar
flabbergast

30 Mar 2016, 10:02

PM'd ...

User avatar
vivalarevolución
formerly prdlm2009

01 Apr 2016, 04:00

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.
DSCN6018.JPG
DSCN6018.JPG (366.3 KiB) Viewed 6830 times

User avatar
flabbergast

01 Apr 2016, 08:51

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:

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)
Now go to 'flabber_kbs/kb45p' and run 'make'. This should compile the firmware, and the resulting freshly built one is 'build/ch.bin'.
Last edited by flabbergast on 03 Apr 2016, 09:03, edited 1 time in total.

User avatar
vivalarevolución
formerly prdlm2009

03 Apr 2016, 03:02

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.

User avatar
flabbergast

03 Apr 2016, 09:05

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.
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).

User avatar
vivalarevolución
formerly prdlm2009

05 Apr 2016, 05:34

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.

mfr000

08 Apr 2016, 16:24

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.

Image

ahhyes

08 Apr 2016, 20:36

What do you have left for this?

I really like the look of it and have been looking for a project to try alps on.

User avatar
chuckdee

09 Apr 2016, 05:29

I'd be interested also.

BlueNalgene

09 Apr 2016, 06:37

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.

User avatar
flabbergast

09 Apr 2016, 09:57

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.

User avatar
vivalarevolución
formerly prdlm2009

09 Apr 2016, 23:01

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.
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.
I am wearing a suit right now as I type on this. Let me check. It's doable if you have deep pockets:
DSC_0009 - Edited.jpg
DSC_0009 - Edited.jpg (469.47 KiB) Viewed 6678 times

BlueNalgene

13 Apr 2016, 23:04

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.

Image

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.

Image

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.

User avatar
vivalarevolución
formerly prdlm2009

14 Apr 2016, 02:07

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.

BlueNalgene

14 Apr 2016, 06:31

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.

User avatar
scottc

14 Apr 2016, 10:06

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.

Post Reply

Return to “Workshop”