Marlin icon indicating copy to clipboard operation
Marlin copied to clipboard

[FR] (Unkown Mainboard with HC32F460 MCU)

Open n4bstar opened this issue 2 years ago • 9 comments

Is your feature request related to a problem? Please describe.

New Ender 2 pro Mainboard with HC32F460 MCU not found in list.

Are you looking for hardware support?

Yes, try fixing hardware isusses with clean Marlin Firmware for the Creality Ender 2 Pro

Describe the feature you want

Firmware for New Creality Ender 2 Pro Mainboard.

Additional context

No response

n4bstar avatar Jun 12 '22 21:06 n4bstar

Bad image, make good sharp hi-res photo of both sides with PCB traces visible and marking on the chip readable. Looks like we have F4 clone in addition to F1 https://www.hdsc.com.cn/Category83-1483

EvilGremlin avatar Jun 18 '22 23:06 EvilGremlin

I have uploaded new images, this is maximum what i can do on quality.

https://github.com/n4bstar/ce2p

n4bstar avatar Jun 26 '22 12:06 n4bstar

Another new CR-FDM this ones a V2.4.S4.??? (last 3 digits are obscured, guessing 170)

ellensp avatar Jun 26 '22 12:06 ellensp

yes it 170

n4bstar avatar Jun 26 '22 13:06 n4bstar

The Anycubic Kobra and some versions of the Voxelab Aquila also use this chip.

These machines are delivered with Marlin running on them so someone has already ported Marlin to the HC32F460 and because of the GPL license they are required to publish their modifications. I know that Anycubic has been promising to do just that for a while now but haven't seen any actual code yet.

@n4bstar you might want to send Creality a message asking for the Marlin source code for your printer.

BartVB avatar Jul 08 '22 13:07 BartVB

The Anycubic Kobra and some versions of the Voxelab Aquila also use this chip.

These machines are delivered with Marlin running on them so someone has already ported Marlin to the HC32F460 and because of the GPL license they are required to publish their modifications. I know that Anycubic has been promising to do just that for a while now but haven't seen any actual code yet.

@n4bstar you might want to send Creality a message asking for the Marlin source code for your printer.

This is correct. Good luck getting them to comply, I've been barking up that tree for years and just gave up. I hope you get it. If you want to use Marlin on that printer you're going to have to swap the board unless they cough up some source code.

th3dstudio avatar Jul 28 '22 17:07 th3dstudio

This should be same as STM32F469, but i read about differnet interrupt vectors offset and some other funny things https://translate.google.com/translate?sl=auto&tl=en&u=https://blog.csdn.net/jjp969988159/article/details/114976562

EvilGremlin avatar Jul 28 '22 17:07 EvilGremlin

I've created a dump of the flash from this board. Mine is also 2.4.S4.170. This MCU (HC32f460kcta) has 256 KB of flash and 192 KB of ram available.

pyocd> show map
 Region   Type   Start       End         Size        Access  Sector      Page
 flash    Flash  0x00000000  0x0003ffff  0x00040000  rx      0x00002000  0x00000200
 flash_1  Flash  0x03000c00  0x03000ffb  0x000003fc  rx      0x000003fc  0x000003fc
 ram      Ram    0x1fff8000  0x20026fff  0x0002f000  rwx     -           -
 ram_1    Ram    0x200f0000  0x200f0fff  0x00001000  rwx     -           -

ender2proflash+ram.zip

EDIT: Adding firmware binary I got from Creality support

Ender-2pro-hw2.4.s4xx-sw2.2.36_165.bin.zip

Update instructions from Creality:

Update Notes:
Software version: Ender-2Pro-hw2.4.s4_XXXX-SW2.2.4_xxx (firmware. Bin) XXXX: indicates a different motor socket port. XXX: indicates different print sizes. Currently, there are two sizes: 165 and 200
Production software brush in:
Create the Factory folder in the TF Kagen directory, and import the firmware.bin file into this folder.
Insert it into the TF card slot of the machine, power it on again, wait for the update to be completed and enter the system, indicating that the update is complete.
Note: After the update, you need to pull out the card. If you use this update method, the card program file,
After the system is powered on, the firmware is updated each time. After the firmware is updated, the system does not delete the updated firmware.
User software brush in:
TF Kagen directory to create the user folder, import the firware. Bin file to this folder,
Insert it into the TF card slot of the machine, power it on again, wait for the update to be completed and enter the system, indicating that the update is complete.
Note:
After the update is complete, the system automatically deletes the updated firmware. If you want to brush the firmware again, you need to re-enter the corresponding updated firmware

jpraczyk avatar Aug 16 '22 08:08 jpraczyk

The Marlin firmware is released under the GPL. I believe the focus of this topic should be to request Creality to release the firmware, as per the GPL forces them to, instead of trying to port the firmware ourselves. This is the whole point of the GPL.

uski avatar Sep 25 '22 12:09 uski

Requests are being sent like every day, all pretty much ignored. And let's be honest, their code is mostly garbage in need of complete rewrite. (mostly because they use very old codebase)

EvilGremlin avatar Sep 25 '22 12:09 EvilGremlin

Requests are being sent like every day, all pretty much ignored. And let's be honest, their code is mostly garbage in need of complete rewrite. (mostly because they use very old codebase)

The only public Marlin release for HC32F460 that I've found is https://github.com/Voxelab-64/Aquila_X2/tree/main/firmware/Sources and saying it's hacky is like not saying anything. So far the creality firmware looks similar to this, looking at the binaries in ghidra. Bootloader checks whether firmware update files are stored on the sd (factory which also contains the Bootloader or user which only contains Marlin) It writes the new firmware then jumps to 0x8000. Looks like creality uses the same ddl as Aquila, there is no arduino compatible framework for that mcu so porting will be painful. I may give it a try as soon as my skr mini e3 v3 arrives, so that I have something to fall back to, but no promises yet.

jpraczyk avatar Sep 25 '22 15:09 jpraczyk

i'm sure they're just using STM32 framework with custom linker script at most

EvilGremlin avatar Sep 25 '22 15:09 EvilGremlin

Part of the issue is that they do this while knowing/assuming they can get away without publishing anything. So far this has proven true.

If they know they are going to have to publish the code, they may make more efforts to write cleaner code and/or just push the changes upstream like so many other companies are doing when they contribute to OSS projects.

Separate discussion in issue #24801 about trying to get them to comply.

uski avatar Sep 25 '22 15:09 uski

i'm sure they're just using STM32 framework with custom linker script at most

Highly unlikely, this mcu is not meant to be a drop-in replacement for stm32 similar to gd32.

jpraczyk avatar Sep 25 '22 16:09 jpraczyk

@jpraczyk i linked article above, NVIC address is main difference, might be some other less prominent ones - but using stm32 frameworks is still easiest way @uski compelled to do cleaner code? LOL, not happening, look at Sovol SV04, look at LVGL_UI history... As were said multiple times before, the only way to make them comply is to damage their revenue enough for them to care.

EvilGremlin avatar Sep 25 '22 16:09 EvilGremlin

Requests are being sent like every day, all pretty much ignored. And let's be honest, their code is mostly garbage in need of complete rewrite. (mostly because they use very old codebase)

I setup a list and a reporting form today. That printer is now on said list: https://gplviolations.th3dstudio.com/

houseofbugs avatar Sep 26 '22 20:09 houseofbugs

@houseofbugs there is vyper source, complete with extui code, they sent it to someone via email Anycubic Vyper-vyper.zip

EvilGremlin avatar Sep 26 '22 20:09 EvilGremlin

@houseofbugs there is vyper source, they sent it to someone via email Anycubic Vyper-vyper.zip

Excellent. I will update the list. I dont have time to keep up with it hence why I am going to rely on people reporting things to me.

houseofbugs avatar Sep 26 '22 20:09 houseofbugs

i really should upload some of my stashes as fork branches...

EvilGremlin avatar Sep 26 '22 20:09 EvilGremlin

Maybe someone could make a github repo just to store the sources? Sorted by brand and model in folders. Keep it simple. I would but my time is limited.

houseofbugs avatar Sep 26 '22 20:09 houseofbugs

that too, but proper fork is way more useful, you can throw diff links around this is main grief with vendor's not-forks

EvilGremlin avatar Sep 26 '22 20:09 EvilGremlin

Anycubic has finally released their source code for their Kobra and Kobra Max using this MCU. Hopefully somebody more clever than me can put it to good use

fufuakuseru avatar Oct 12 '22 15:10 fufuakuseru

I have personally given up on the 2.4.S4.170 board. Replaced it with an skr mini e3 v3.

jpraczyk avatar Oct 12 '22 17:10 jpraczyk

anything new ?

lucas19961 avatar Oct 13 '22 06:10 lucas19961

We have working source for 2 other machines using the MCU, and they are building it in Kiel, instead of platformIO, so it will not be a simple task to get working in the standard environments. There is at least a way to work though.

InsanityAutomation avatar Oct 13 '22 14:10 InsanityAutomation

We have working source for 2 other machines using the MCU, and they are building it in Kiel, instead of platformIO, so it will not be a simple task to get working in the standard environments. There is at least a way to work though.

This is the key here. If someone who knows how to port from Kiel to platformIO can do it for the HC series that would be the major hurdle to getting these supported in Marlin.

houseofbugs avatar Oct 13 '22 15:10 houseofbugs

If someone who knows how to port from Kiel to platformIO

It sure would be nice for non-Windows users.

thisiskeithb avatar Oct 13 '22 15:10 thisiskeithb

If someone who knows how to port from Kiel to platformIO

It sure would be nice for non-Windows users.

Kiel is the arm uVision environment, it's cross platform.

We have working source for 2 other machines using the MCU, and they are building it in Kiel, instead of platformIO, so it will not be a simple task to get working in the standard environments. There is at least a way to work though.

This is the key here. If someone who knows how to port from Kiel to platformIO can do it for the HC series that would be the major hurdle to getting these supported in Marlin.

PlatformIO needs to add support for the chip first before Marlin can adopt it, but we may be able to work towards that. On the flip side, I'd like to go through this for methods to support other generic cmsis platforms that platformio doesn't support.....

InsanityAutomation avatar Oct 13 '22 16:10 InsanityAutomation

Kiel is the arm uVision environment, it's cross platform.

If you consider VMs cross-platform, sure.

thisiskeithb avatar Oct 13 '22 16:10 thisiskeithb