Closed g992 closed 2 months ago
It seems like the N32G455 support is added since klipper 12.0 --> https://github.com/Klipper3d/klipper/blob/v0.12.0/src/stm32/Kconfig
config MACH_N32G455 bool "Nation N32G455" select MACH_N32G45x
it's also in the release notes of klipper 12: https://klipper.discourse.group/t/klipper-v0-12-0-release/11500
Several micro-controller improvements: Support for new ar100 and hc32f460 architectures. Support for stm32f7, stm32g0b0, stm32g07x, stm32g4, stm32h723, n32g45x, samc21, and
@jlodew0 Yes, because N32G455 is just an STM clone. They compiled MCU firmware for stm32f103xe and installed it on the N32G455. I can see this in Mainsail, because I think the MCUs send their version information via Klipper.
Klipper added official support only later, but it did work before. We can also see this in the Klipper Kconfig:
config MCU
string
...
default "stm32f103xe" if MACH_N32G45x
But if u just compile for stm32f103, u cant get access to analog periphery, and if u compile fw in new klipper version (0.12) mcu just cant boot
@g992 Did you manage to-rebuild the firmware with Klipper 0.11 and flash that or is anything self-built not bootable? Does Klipper need analog periphery for anything? And it works again after flashing the prebuilt MCU Firmware?
Maybe also check that clock frequency and reference are correct - but not sure if that would cause problems with booting.
The clipper needs analog peripherals at a minimum. for working with temperature sensors. I tried a lot, but nothing worked, when assembling under f103 the controller loads, but sometimes when I try to read data from the sensor it goes into error. on my printer I replaced the nation installed in the head with stm32f103, and just build a clipper for it, but I plan to replace the motherboard and head board to install your firmware, on which everything works on standard equipment
This is some interesting reading: (Google translate ) https://blog.csdn.net/weiqifa0/article/details/126025874
Also: (but not specific to nations uc)
The clipper needs analog peripherals at a minimum. for working with temperature sensors. I tried a lot, but nothing worked, when assembling under f103 the controller loads, but sometimes when I try to read data from the sensor it goes into error. on my printer I replaced the nation installed in the head with stm32f103, and just build a clipper for it, but I plan to replace the motherboard and head board to install your firmware, on which everything works on standard equipment
I saw there was a release coming soon. Was there a breakthrough?!
@g992 have you tried using the stm32 folder of klipper 12? It seems like clock frequency is different, as well as flash and ram size. There is a n32_gt45x_adc.c file included as well.
config CLOCK_FREQ int default 48000000 if MACH_STM32F0 default 64000000 if MACH_STM32F103 && STM32_CLOCK_REF_INTERNAL default 72000000 if MACH_STM32F103 default 120000000 if MACH_STM32F207 default 84000000 if MACH_STM32F401 default 168000000 if MACH_STM32F4x5 default 180000000 if MACH_STM32F446 default 216000000 if MACH_STM32F765 default 64000000 if MACH_STM32G0 default 150000000 if MACH_STM32G431 default 400000000 if MACH_STM32H7 # 400Mhz is max Klipper currently supports default 80000000 if MACH_STM32L412 default 64000000 if MACH_N32G45x && STM32_CLOCK_REF_INTERNAL default 128000000 if MACH_N32G45x
config FLASH_SIZE hex default 0x4000 if MACH_STM32F031 default 0x8000 if MACH_STM32F042 default 0x20000 if MACH_STM32F070 || MACH_STM32F072 default 0x10000 if MACH_STM32F103 || MACH_STM32L412 # Flash size of stm32f103x8 (64KiB) default 0x40000 if MACH_STM32F2 || MACH_STM32F401 || MACH_STM32H723 default 0x80000 if MACH_STM32F4x5 || MACH_STM32F446 default 0x20000 if MACH_STM32G0 || MACH_STM32G431 default 0x20000 if MACH_STM32H750 default 0x200000 if MACH_STM32H743 || MACH_STM32F765 default 0x20000 if MACH_N32G45x
config RAM_SIZE hex default 0x1000 if MACH_STM32F031 default 0x1800 if MACH_STM32F042 default 0x4000 if MACH_STM32F070 || MACH_STM32F072 default 0x2800 if MACH_STM32F103x6 default 0x5000 if MACH_STM32F103 && !MACH_STM32F103x6 # Ram size of stm32f103x8 default 0x8000 if MACH_STM32G431 default 0xa000 if MACH_STM32L412 default 0x20000 if MACH_STM32F207 default 0x10000 if MACH_STM32F401 default 0x20000 if MACH_STM32F4x5 || MACH_STM32F446 default 0x80000 if MACH_STM32F765 default 0x9000 if MACH_STM32G07x default 0x24000 if MACH_STM32G0Bx default 0x20000 if MACH_STM32H7 default 0x10000 if MACH_N32G45x Source: https://github.com/Klipper3d/klipper/blob/v0.12.0/src/stm32/Kconfig
https://github.com/Klipper3d/klipper/blob/v0.12.0/src/stm32/n32g45x_adc.c
These values seem to be for the smalest variant.
Version on the board is the REL7 E= 512K Klipper took hex 20000 that is 128K. (instead of 0x80000) Ram is 64K in klipper 12 while datsheet states 144K. (in stead of 0x24000) However, I don't know if that would cause any issues.
p.s. where you able to recover from overwriting the firmware of the n32g455? an other interesting document: https://www.nationstech.com/uploadfile/file/20220907/1662518879308537.pdf https://github.com/Klipper3d/klipper/pull/6116
I tried to flash it as is (I assembled a clipper for n32, flashed it using jlink) and nothing worked. I also tried to assemble it for s32f103, it worked, but the analog peripherals did not work. I didn't try again. as @xblax said, the system works fine with 0.11 clipper and there is no point in moving to 0.12
Does somebody build + flash .bin file to n32g455? I try to made it, but i bricked mcus. If someone succesfully update klipper firmware, please write something here or here: https://klipper.discourse.group/t/nations-mcu-support-flashing/13893