-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
[FR] Add support for TriGorilla Pro A V1.0.4 for Anycubic Kobra, Anycubic Kobra Max #24757
Comments
Chitu is the manufacturer (see the trigorilla_pro_disk environment, where the firmware is encrypted.) You should be able to start from the pro and work out the pins. |
I'll give it a shot. Can you provide an overview of the process for working the pin-outs? I'm technical (software developer), but not terribly experienced with reverse engineering hardware. I've heard of other people suggesting that this can be done, but need an outline/overview of where to start. Any links, resources etc would be useful! |
First step - Backup your firmware & bootloader. Pull the boot jumper and start that sucker up and download it using ST's flasher. Now you can always go back. Put that boot jumper back on. Second step- If it doesn't, start turning off features (TFT display comes to mind). By default it'll probably want you to listen to usb at 115200, 8, N, 1 and see if it boots up. Sometimes Marlin will tell you what goes wrong. SD_SUPPORT is another thing to turn off if it won't boot. Most people will use a multimeter with continuity testing and the pinout of the chip to determine endstops, heaters, and stepper pins, filament runout and so on. If trigorilla_pro_disk won't update for you, mail me (git hub handle at gmail ) the backup you made and I'll find out the offset for the bootloader. I leave heaters unplugged until verified and I test: in that order. |
Brilliant, thank you. That all made sense to me. Hopefully I won't fry the thing in the process. A couple of Q's: What is ST's Flasher? Presumably this is the flashing utility for the STM board, but wanted to check. Hoping it runs on linux or mac, though i guess worst case I can get windows running on something. What is When you say
This is most excellent, thank you for effort - i appreciate it. |
What processor is that on the board? A GD STM clone or actual ST? Regardless, you want to find the pinout for chip and look for boot0 and trace it, see if it goes to a pad. If it does, pulling it high (any 3.3v source) and then powering on will invoke the serial bootloader. https://www.youtube.com/watch?v=vL-JXBVUNRg shows how to back up chitu boards (which this is). I don't know if ST's tools will read GD devices. If you succeed in saving it off, drop a copy of it to me in email and I'll see if it has any different encryption than the other chitu boards. (If there's a firmware update already available for it, point me to it). |
Hey, sweet - there's no encryption on the firmware now. That's a great sign. |
So, their firmware is Marlin. Did they release the source somewhere? |
This is not a chitu board (it's made by them but doesn't use their encryption at all). I'd see if there's any other boards based on that hardware and start from those. Still use the multimeter to map the pins, but it's not exactly a chitu/trigorilla derivative like you'd expect. So the real question is "What board do you start from as a basis?" and that depends on the MCU. Sorry for the bad information on what environment to use. |
No problem, still super thankful for the guidance. I also mis-spoke; the MCU on the board is the Yes, the firmware is a modified Marlin. No, they didn't release the source (and yes, they're in violation of GPL. There are a few people on the internet who are upset about that.) Out of curiosity, how did you determine that there's no encryption on the firmware? Knowing that the board is based on |
HC32F460 is not supported in mainline Marlin yet, so they really need to post or provide their source code to see what was done to support this MCU. ST’s licensing does not allow running some of their code on non-ST MCUs, so we’d need to verify some things before adding support (see: GD32 support). |
How did I know there's no encryption? I opened in in binary ninja and read the vector table, guessed a few values and got a relatively decent disassembly. Like thisiskeithb, I'd love to see what they did. Looks to me like it would be a different HAL (and the timers are...limited). |
https://github.com/wellrun/hc32f460/tree/master/hc32f460_sdk/%E7%BC%96%E7%A8%8B%E5%B7%A5%E5%85%B7 has the programmer, so you could (maybe) backup the firmware and bootloader, if you can translate it. |
Fantastic! This is a huge step forward.. I'm afraid I don't know what all of the names for the findings mean so I may need some help making this actionable |
If you own a cheap dev board for this, it should be possible to cobble together enough Arduino functions on top of the MDK/Pack files from the website I linked to. This thing will be a lot like the M200 series of printers, motion controller on a limited MCU and probably a smart LDC (I'd guess). |
@xC0000005 There's enough here that I would need to learn to pull this off that I expect I won't have time/energy to do it for some time. I'll try posting a link to this thread on the Anycubic Reddit and maybe someone will be interested in coordinating with me on moving it forward. Thanks x100 for everything so far! |
Seems that Anycubic published their development(?) branch of the Max firmware. Maybe this will help? |
And also for Kobra: |
Yes the source is out, unfortunately you cannot use platformio, it is designed for Keil uVision |
I believe the Ender 2 Pro has the same MCU as this board #24338 as it might not work with the current STM32 implementation |
For the people with no hope, well, I'm almost there. The repo is https://github.com/maikramer/MarlinKobraMax I work on it everyday, and I'm keeping marlin updated. |
About a month later, the firmware source code was finally made available in their GitHub: https://github.com/ANYCUBIC-3D/Kobra There is this reddit post that explains how to build it in Windows using Keil https://www.reddit.com/r/anycubic/comments/y2waxu/tutorial_how_to_build_anycubic_marlin_source_code/ I couldn't find info myself about how to get it working in something more open, like PlatformIO, but seeing recent Klipper work on that specific MCU chip makes me hopeful: Klipper3d/klipper#5208 The source code has personally been useful when troubleshooting problems with the printer, like it shipping with a different thermistor that they configured in the firmware 😓 I swapped the thermistor for the one in that source code and was able to finally get PID not being a wild oscillating mess after auto-tuning! I found it weird that in Configuration.h you can see
|
I have recently got possession of the Kobra Max. Well, this has been interesting. I have been able to compile all of the official published codes, but they do not run on the printer. I am still digging to get something working via PlatformIO before I throw out this useless control board. |
I am having issues with getting platformIO to get with the ball game. Platform Manager: Installing git+https://github.com/maikramer/platform-hc32f46x.git I have all forms of GIT installed and cloned that repo. What does it want from me? |
Nevermind.... I had to restart VSCode. |
Still cannot get it to compile. There is a reference to a "loop()" in main.cpp of the platformIO toolchain that is says doesn't exist. |
In '.....platformio\packages\framework-arduino-hc32f46x\cores\arduino\main\main.cpp':
I added "extern void " to the 'loop()', 'setup()', 'timer01B_init()', 'timer02B_init()', 'timer41_init()', and 'timer42_init()'. Now, it compiles. Let's see if it runs. |
No go. The printer beeped several times before the screen booted up. The system just hangs after that. Restarting it does no good. |
I took a good look into this Here are the issues I identified with just supporting this motherboard (there are more issues with additional peripherals, ie the display and the loadcell) These features are not in the current HC32 HAL Uart4 is not supported (this seems easy to add) Is required for the LCD serial port @shadow578 Any chance you could add some or all of these to the hc32 HAL? |
Hi @ellensp
AFAIK the uart peripherals of the HC32F460 are not fixed to any pins, so just replacing UART4 with any of UART1-3 while keeping the pins should work just fine.
really not sure how the tone stuff would've to be implemented, but there's a PWM library in the core already. Maybe someone can take a look?
it'd probably be easier to just use the SD card as a eeprom replacement, idk how long the flash would hold up to repeated reprogramming (assuming that this cheap-ish chinese MCU uses similarily cheap-ish chinese flash)...
stub headers for the arduino SPI library are already present at https://github.com/shadow578/framework-arduino-hc32f46x/tree/main/libraries/SPI. as for the implementation, take a look at the DDL examples at https://github.com/shadow578/hc32f460-documentation-and-sdk/tree/main/sdk/Driver%20library%20and%20samples/hc32f460_ddl_Rev2.1.0/example/ev_hc32f460_lqfp100_v2/spi, especially the since my printer doesn't use SPI, and dev boards for the HC32F460 are basically unobtainium, i can't really do much since i cannot test anything. a bit more overall: the HC32 HAL is written in such a way that, to add support for a new board, only the pinout has to be added (assuming that no missing libraries - like SPI - are needed). for debugging + programming, the arduino core supports both via a SWD probe (like the picoprobe). if there's any questions regarding the HC32F460, i'd be happy to help. |
you can actually get these boards from aliexpress https://www.aliexpress.com/item/1005004178328026.html |
actually, after looking at the SPI ddl, it seems to be fairly straightforward to implement the basic functions of the library. if someone'd like to test, see shadow578/framework-arduino-hc32f46x#29. since i currently don't have access to a environment where i could compile this, it's very likely that the lib fails to compile. |
Is your feature request related to a problem? Please describe.
Need to add support for Trigorilla Pro 1.0.4a
Are you looking for hardware support?
Yes, the Anycubic Kobra and Anycubic Kobra Max use the TriGorilla Pro A V1.0.4 board, but Anycubic has not published the pinouts for this board.
Describe the feature you want
Add support for TriGorilla Pro A V1.0.4 board to support anycubic Kobra, Kobra Max.
Additional context
https://www.chitusystems.com/ may be the manufacturer of the Trigorilla boards (not confirmed)
Discussions on Reddit:
Picture of the Mainboard (Anycubic Kobra) TriGorilla Pro A V1.0.4
https://imgur.com/a/N4fyafO
Main Chip on the board appears to be a HC32F460 Cortex-M4
The text was updated successfully, but these errors were encountered: