-
Notifications
You must be signed in to change notification settings - Fork 32
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
Anne Pro 2 support? #70
Comments
sure thing! Such info would fit nicely in the book, even if we don't have any code for it. I'll be on the look out for them |
Okay I ordered one, should be here in a few days, will see what the differences are |
I also ordered one last Saturday from China. Although it was on backorder very much to my surprise it already arrived today in Germany... |
Got mine in too, what commands would be helpful? lspci? lsusb? opening it up and taking pictures? |
Exciting! The latter, close up pictures of the chips so we can see if they're the same. |
The included images were posted in the Discord by Flashquark, the chip seems to be a HT32F52342 |
hmm these aren't as good as the ones you already have |
It does look like there is something like DFU mode if you hold esc while plugging in the usb c. Not sure if we can inspect that, maybe with a facedancer or something. |
@MvEerd Sure thing, anything in particular you'd like to see? |
Got a pic of the bluetooth chip? It's under the little metal shield on the left of the board. |
Hm, not sure I want to remove the can... There's so much plastic on the board and I'm not not I can protect that... |
Lol, the can is only hold in place by tabs, it's a CC2541. Need a photo? I'd have to fire up the microscope then, it's barely imageable using a camera. |
Cool, that's all I wanted to know :) CC2541 is the same chip as on the previous Anne. |
@ah- Is the BT chip really that relevant for anne-key? |
My excitement of the Anne Pro 2 is a bit dampened. Not sure whether the Anne Pro is the same, but the 2 is really quirky in BT operation and the key mapping is rubbish (the problem being they should either implement mapping keycodes for other layouts than US or preferably add a layout indication the HID profile as defined in HID Review Request 42) which makes it pretty much unusable for for me at the moment. |
@therealprof I was thinking about getting the Anne Pro / Anne Pro 2 to tinker around with the firmware a bit. What do you mean by "the keymapping is garbish"? |
@sirwindfield They don't indicate the keyboard layout in the communication so it will automatically use the keyboard layout which is very annoying if you're on a laptop with a foreign layout. Should be trivial to indicate a US layout in the HID profile to allow seamless swapping between keyboards... I was kind of shocked to learn to keyboards still use those idiotic arbitrarily chosen fixed scancodes instead of just sending the translated characters... |
@sirwindfield, if you want to tinker around you might want to get a Anne Pro 1, STM32 has better support for open source. Also Cortex M3 instead of M0+ :) Unless you want to help with bringup, then get the 2. |
Are there more keyboards that are flashable? I was generally thinking of getting my first mechanical and looked for some time online but a lot of them aren't even available in my country (Germany). |
Oh yeah, there are tons. However, they usually don't have Bluetooth and tend to be a bit more expensive. If you just want to play around a bit I'd recommend getting one with QMK, if you like Rust or love reverse engineering get the Anne Pro. |
@ah- By bringup you mean helping out writing the firmware right? Not sure what is means :/ |
Basically figuring out what tools to use to flash / debug the chip, how to configure them, reading the datasheet to figure out how to toggle/read pins etc. So the rather low level things vs. adding higher level features like keyboard shortcuts or similar. |
Actually, I've got a spare AP 1 that I don't use, if you want it I'll send it to you for free. It's got the red switches, don't really like them and have enough keyboards. Send me an email (see profile) with your address if interested, no strings attached. |
I see you have a todos.txt in gitignore, could you track it here too? We can then tease it out into the book sections. |
I guess this thread is enough tracking for now, getting it to work won't be super easy since I haven't immediately found great resources for the Holtek Cortex M0 chips. https://github.com/ChaoticConundrum/openocd-ht32 seems to add support to openocd, but it's in a fork not in mainline etc. The nice thing about the stm32 in the original Anne Pro was that it has great support in the open source ecosystem. |
Would it be possible to use https://github.com/rust-embedded/cortex-m-quickstart |
What's the latest status on Anne Pro 2 support? |
It's 2020 and I am basically hoping for the same thing for cheap 61 key keyboards Has anyone looked into... @MycroftHolmes1989 don't fear, we might get to it... I might contact the company that makes it. Who want to send send a message to their socials for help? |
So I've been looking into implementing a HAL for the HTF32F523 series of chips in rust (I guess this would be the first step for this goal?). And got myself some hardware (specifically HT-ESK32-30501). Now I'm currently struggling to find any open source software that is able to communicate with the on board debugger, does someone here have any suggestion for that or do I have to implement support for it in something popular like openocd? |
Instead of going for OpenOCD I'd probably go for https://probe.rs/ first. |
Oh wow I didnt know it had gotten that far since i last looked at it! Definitely will do! |
@therealprof probe-rs/probe-rs#172 just as a tracker for progress on this. |
@hargoniX I'd be happy to donate some time if you get anywhere with that! I've not got any real experience, but would be willing to try learn :) I've been toying with the idea of trying but also don't really know where to start... |
Quiiiiiick update, I've just managed to get cargo-flash to flash some random ELF onto my dev board so I'll be landing a PR for that in cargo-flash soon. @theobarberbany First of we'd have to look into a PAC, https://github.com/rmsthebest/ht32f523x2 is a thing but I am not sure how up to date/maintained etc it is. Usually though the process of building a PAC is mostly automated as one can run svd2rust over a manufacturer supplied SVD file and generate lots of (hopefully) correct code from that. Afterwards we'd be looking into writing an actual HAL + presumably USB support (not defined in embedded-hal afaik). And then on top of that a full keyboard firmware like this one. |
@hargoniX Any updates? Is there anything I could possibly do to help? |
So I created https://github.com/ht32-rs/ and yesterday published my own set of PACs (for all Holtek chips), see here and here. What we'd have to do now is look into building a HAL for the ht32f52342_52 variant of the second crate. Which essentially means reading this document and writing code that implements embedded-hal traits for it. If we want to use this HAL for Anne Pro 2 firmware ASAP it would be very useful to know which peripherals we should focus on so somebody should make a list of that and file an issue for that over at https://github.com/ht32-rs/ht32f5xxxx-hal I was gonna look into writing code for the clock setup next weekend (and probably beyond that, dunno how long that takes me) and after that look into implementing the necessary peripherals so it would certainly also be useful if someone wanted to help with the peripherals (especially with USB of course). Apart from that nothing comes to mind @philipmnelson |
And for another update, I'm done with the clock implementations as well as the GPIO implementation (see https://github.com/ht32-rs/ht32f5xxxx-hal) and will move on to the peripheral implementations for the chips posted far above by now soon ™️ |
Wow! Does flashing and debugging work? |
On the HT32 chip it has been working since https://github.com/ah-/anne-key/issues/70#issuecomment-596231100 was closed^^ Now it can already blink LEDs \o/ |
And for another update, I just got SPI working, yesterday got I2C working-ish so the only two things that's left now is UART and USB, how hard can USB be 😉 |
Quick question: once the USB part is implemented, will it be possible to run something like QMK on it? |
QMK is not at all related to what I am doing here, I'm implementing the Rust abstractions required to do sensible embedded development on the Holtek chip, QMK is a C firmware project that has absolutey 0 idea on how to deal with the Rust abstractions what so ever. TLDR; QMK is a different language and compatability between Rust embedded and it = 0 -> No Edit: If anyone actually wants to do this though and can't get Holtek to fix their links feel free to use my code as a basis for a QMK port once its done, I'm sure that's gonna make some people happy as well. A third option would be to add a compatability layer between Rust's embedded-hal and USB traits and C which I'm not willing to do though, if someone else finds the motivation for that feel free. |
As far as I remember, there was someone who ported a few functionalities of QMK to Rust. I will try to find that project. If anything remotely close works with Anne pro 2, it will be a blessing. Edit: I was expecting compatibility with something like this: https://github.com/TyberiusPrime/keytokey |
U(S)ART now works as well, will look into USB in the next days/weeks and once I got that done we should be more or less ready to go with porting! |
For a QMK port you will need to port ChibiOS. I have a port of ChibiOS for HT32F165x, at github.com/OpenDucky |
The question is, does Anne Pro 2 have enough RAM and ROM for ChibiOS + QMK? Otherwise, it might be worthwhile to cherry-pick the features we need and port them to Rust. |
yes. QMK + Chibi uses about 20K of rom which Anne pro 2 has 64 and ~6K of ram in my case but that’s having an 16bit 16*8 led matrix which you don’t need. So you can probably do it in ~5K which Anne pro 2 has 8 I’m pretty sure.
…On Jun 27, 2020, 11:11 AM -0400, M Holmes ***@***.***>, wrote:
> For a QMK port you will need to port ChibiOS. I have a port of ChibiOS for HT32F165x, at github.com/OpenDucky
The question is, does Anne Pro 2 have enough RAM and ROM for a working version of ChibiOS + QMK? Otherwise, it might be worthwhile to cherry-pick the features we need and port them to Rust.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I am currently reversing the firmware that is on stock Anne pro 2. Hoping to be able to dump the original boot loader though a custom “firmware”.
The goal is to be able to keep the old boot loader with the new firmware. Since it only uses the lower 16K and keeps the ability to roll back to stock if needed. I think that’d be nicer than having to using SWD tool to wipe the chip.
…On Jun 27, 2020, 11:11 AM -0400, M Holmes ***@***.***>, wrote:
> For a QMK port you will need to port ChibiOS. I have a port of ChibiOS for HT32F165x, at github.com/OpenDucky
The question is, does Anne Pro 2 have enough RAM and ROM for a working version of ChibiOS + QMK? Otherwise, it might be worthwhile to cherry-pick the features we need and port them to Rust.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Honestly I am thinking about making a rust port of QMK. They really don't use ChibiOS for real. They use it mainly as a good HAL. afaik they run all of their code in the ChibiOS "idle" task. Which is kind of under utilization of an RTOS. But the upside is that any user can easily expand functionality by creating a new thread and not have to worry about the existing core QMK code. |
In the old anne you could use the default bootloader to flash your own firmware by just locating it at the right offset hopefully that works on the new one as well. |
Well the problem is here that they don't use standard USB-DFU. So we need to figure out what protocol they use. The firmware is loaded at 0x4000. Hence the bootloader uses the lower 16K of flash. |
Obins Kit is very stupid in the sense that it uses a HTTP server to download the firmware. So my plan right now is to write a simple USB DFU thing like this HT32 USBDFU base it at |
Okay I started a Github Org tracking the re-firmware progress. https://github.com/OpenAnnePro |
More progress! |
I hope we get a Rust implementation of the firmware too, for those who don't want to use QMK. |
Im still looking into USB, never implemented a USB peripheral in Rust though (and the way Holtek's USB peripheral was built also makes it a bit hard to generalize into the traits from usb-device) |
I know it was just announced, but wondering if we could have a tracking issue for what chipset it is, etc.
The text was updated successfully, but these errors were encountered: