-
Notifications
You must be signed in to change notification settings - Fork 7
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
[BUG] Restarts after Saving/ Store EEPROM/ M503 #37
Comments
i've been encountering this issue sporadically too, and it seems to be related to the watchdog timer timing out.
|
here is the repo to everything I use for the HC32 to compile. but if you'd like to compile a .bin I can test it out. ill be checking out the |
/**
* The watchdog hardware timer will do a reset and disable all outputs
* if the firmware gets too overloaded to read the temperature sensors.
*
* If you find that watchdog reboot causes your AVR board to hang forever,
* enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO.
* NOTE: This method is less reliable as it can only catch hangups while
* interrupts are enabled.
*/
#define USE_WATCHDOG
#if ENABLED(USE_WATCHDOG)
//#define WATCHDOG_RESET_MANUAL
#endif what if |
after trying the suggested So before in the earlier version from MAY, the screen would start up normally except BEEP. if I connect to terminal i'm sure it would show some error in the code. However, in this new Another side effect which remains is the SD Card causes a continued loop of rebooting. only when the SD card is removed it then proceeds to start normally. So the SD card issue causes it to boot loop. The BEEP is gone, that is in the previous (main/default) version it would create a long beep until the SD card is removed. but even so when the SD card is removed, it will still BEEP but just a short one instead continuous. in the UPDATE:Success! well, for JyersUI at least. saving DOES work, saving works as normal. except still SD card issue. could the SD card be on my end? such as having different files and folders causing an issue? However it would be great to have the PROUI work like it should instead. The PROUI worked for the most part before, except for the save issue - it would restart after saving, and also the SD card inserted causes it to reboot. How do we go from here so the screen doesnt freeze? because the memory is set to 256k. previously it was once set to 208k, could this be a cause? |
could you post the serial output for the cases where the screen freezes? Also, does the screen just freeze, or is the whole printer unresponsive?
it could certainly be that your SD card is formatted in a way that the HAL does not like... Could you tell me what size SD card you're using, how much of the space is used, and the filesystem the card is formatted as?
no, the difference in maximum memory is because previously the memory usage excluded the bootloader, and now it includes it. Since the bootloader is from 0x0 to 0xC000, this causes a difference of ~50k getting reported. In reality, it's still the same space usable. |
the LCD freezes and is unresponsive only when using There was ONE time that everything loaded fine with the SD card in, and the display did not restart over and over in a loop. I dont recall how or what I did to get that, or it could have been using Alex's alexqzd older H32 firmware. There was an error that popped up after the LCD initialized immediately after flashing, it said I'll attempt to connect to PC and log output in terminal. |
echo:SD card ok
*** HARDFAULT ***
- FSR / FAR:
SCB->HFSR = 0x40000000
SCB->CFSR = 0x00000100
SCB->DFSR = 0x00000000
SCB->AFSR = 0x00000000
- Bus Fault:
* IBUSERR
- Stack frame:
R0 = 0x1fffc010
R1 = 0x1fffaf01
R2 = 0x1fffaf01
R3 = 0x1fffc02f
R12 = 0x4006fc00
LR = 0x0003122b
PC = 0x73726574
PSR = 0x60000000
- Misc:
LR = 0xfffffff9
***
1.2
>UID =(0x43323132,0xFF0E5030,0xFFFF732E)
sdio init success!
Print paused at: 21:36:23
Print paused at: 21:36:23
Print paused at: 21:36:23
Print paused at: 21:36:23
Print paused at: 21:36:23
Print paused at: 21:36:23
Print paused at: 21:36:23
Print paused at: 21:36:23
Print paused at: 21:36:23
Print paused at: 21:36:23
Disk init
Tips ------ None Factory file
Tips ------ None Firmware file
GotoApp->addr=0xC000
start
-- clocks dump --
SYS=200000000
HCLK=200000000
PCLK0=200000000
PCLK1=50000000
PCLK2=50000000
PCLK3=50000000
PCLK4=100000000
EXCLK=100000000
F_CPU=50000000
SYSCLK=MPLL,XTAL
P=2
Q=4
R=4
N=50
M=1
--
Software Reset
Marlin bugfix-2.1.x
echo: Last Updated: 2023-05-13 | Author: Miguel A. Risco-Castillo (MRiscoC)
echo: Compiled: Aug 5 2023
echo: Free Memory: 2387 PlannerBufferBytes: 3456
DWIN handshake IRQ4 auto-assigned to usart rx data available
IRQ5 auto-assigned to usart rx error
IRQ6 auto-assigned to usart tx buffer empty
IRQ7 auto-assigned to usart tx complete
[USART1] begin completed
error.
DWIN handshake
DWIN handshake echo:V87 stored settings retrieved (681 bytes; crc 16632)
//action:notification Stored settings retrieved
[ADC1] initialized device
[ADC1] enable channel 15, sample_time=50
[ADC1] enable channel 14, sample_time=50
HAL_timer_start: temp timer, f=1000
[Timer02A] auto-found cmp= 3125 for fBase=50000000 and prescaler=16
IRQ8 auto-assigned to Timer0
[Timer02A] started with compare value 3125
ADC1] disable channel 5
[ADC1] disable channel 6
[ADC1] disable channel 7
IRQ9 auto-assigned to external interrupt
attachInterrupt: pin=5, irqn=9, mode=2
IRQ10 auto-assigned to external interrupt
attachInterrupt: pin=6, irqn=10, mode=2
IRQ11 auto-assigned to external interrupt
attachInterrupt: pin=7, irqn=11, mode=2
[ADC1] disable channel 13
[ADC1] disable channel 13
[ADC1] disable channel 13
[ADC1] disable channel 13
[ADC1] disable channel 12
HAL_timer_start: step timer, f=122
[Timer02B] auto-found cmp= 25614 for fBase=50000000 and prescaler=16
IRQ12 auto-assigned to Timer0
[Timer02B] started with compare value 25614
IRQ13 auto-assigned to WDT callback
IWatchdog::begin: divider=2048, count_cycle=65536
IWatchdog::begin: timeout=5000ms, actual_timeout=2000ms, base_clock=50000000
//action:prompt_end
BL24CXX Check succeeded!
echo:SD card ok repeating..... |
I was able to catch output in terminal as it was flashing/ updating the firmware. Connecting...
Update firmware at address 14000...
Update firmware at address 16000...
Update firmware at address 18000...
Update firmware at address 1a000...
Update firmware at address 1c000...
Update firmware at address 1e000...
Update firmware at address 20000...
Update firmware at address 22000...
Update firmware at address 24000...
Update firmware at address 26000...
Update firmware at address 28000...
Update firmware at address 2a000...
Update firmware at address 2c000...
Update firmware at address 2e000...
Update firmware at address 30000...
Update firmware at address 32000...
Update firmware at address 34000...
Update firmware at address 36000...
Update firmware at address 38000...
Update firmware at address 3a000...
Firmware update success!
GotoApp->addr=0xC000
start
Printer is now online.
-- clocks dump --
SYS=200000000
HCLK=200000000
PCLK0=200000000
PCLK1=50000000
PCLK2=50000000
PCLK3=50000000
PCLK4=100000000
EXCLK=100000000
F_CPU=50000000
SYSCLK=MPLL,XTAL
P=2
Q=4
R=4
N=50
M=1
--
OTS initialized
External Reset
Marlin bugfix-2.1.x
echo: Last Updated: 2023-05-13 | Author: Miguel A. Risco-Castillo (MRiscoC)
echo: Compiled: Aug 5 2023
echo: Free Memory: 2387 PlannerBufferBytes: 4096
DWIN handshake IRQ4 auto-assigned to usart rx data available
IRQ5 auto-assigned to usart rx error
IRQ6 auto-assigned to usart tx buffer empty
IRQ7 auto-assigned to usart tx complete
[USART1] begin completed
error.
DWIN handshake
DWIN handshake echo:V87 stored settings retrieved (681 bytes; crc 16632)
//action:notification Stored settings retrieved
[ADC1] initialized device
[ADC1] enable channel 15, sample_time=50
[ADC1] enable channel 14, sample_time=50
HAL_timer_start: temp timer, f=1000
[Timer02A] auto-found cmp= 3125 for fBase=50000000 and prescaler=16
IRQ8 auto-assigned to Timer0
[Timer02A] started with compare value 3125
ADC1] disable channel 5
[ADC1] disable channel 6
[ADC1] disable channel 7
IRQ9 auto-assigned to external interrupt
attachInterrupt: pin=5, irqn=9, mode=2
IRQ10 auto-assigned to external interrupt
attachInterrupt: pin=6, irqn=10, mode=2
IRQ11 auto-assigned to external interrupt
attachInterrupt: pin=7, irqn=11, mode=2
[ADC1] disable channel 13
[ADC1] disable channel 13
[ADC1] disable channel 13
[ADC1] disable channel 13
[ADC1] disable channel 12
HAL_timer_start: step timer, f=122
[Timer02B] auto-found cmp= 25614 for fBase=50000000 and prescaler=16
IRQ12 auto-assigned to Timer0
[Timer02B] started with compare value 25614
IRQ13 auto-assigned to WDT callback
IWatchdog::begin: divider=2048, count_cycle=65536
IWatchdog::begin: timeout=5000ms, actual_timeout=2000ms, base_clock=50000000
//action:prompt_end
BL24CXX Check succeeded!
core entering main loop
echo:SD card ok
*** HARDFAULT ***
- FSR / FAR:
SCB->HFSR = 0x40000000
SCB->CFSR = 0x00000001
SCB->DFSR = 0x00000000
SCB->AFSR = 0x00000000
- Memory Management Fault:
* IACCVIOL
- Stack frame:
R0 = 0x1fffc408
R1 = 0x1fffb480
R2 = 0x00000004
R3 = 0xfffffffc
R12 = 0x4006fc00
LR = 0x00030629
PC = 0xfffffffc
PSR = 0x80000000
- Misc:
LR = 0xfffffff9
***
1.2
UID =(0x43323132,0xFF0E5030,0xFFFF732E)
sdio init success!
Disk init
Print paused at: 21:50:34
Print paused at: 21:50:34
Print paused at: 21:50:34
Print paused at: 21:50:34
Print paused at: 21:50:34
Print paused at: 21:50:34
Print paused at: 21:50:34
Print paused at: 21:50:34
Print paused at: 21:50:34
Print paused at: 21:50:34
Tips ------ None Factory file
Tips ------ None Firmware file
GotoApp->addr=0xC000
start
-- clocks dump --
SYS=200000000
HCLK=200000000
PCLK0=200000000
PCLK1=50000000
PCLK2=50000000
PCLK3=50000000
PCLK4=100000000
EXCLK=100000000
F_CPU=50000000
SYSCLK=MPLL,XTAL
P=2
Q=4
R=4
N=50
M=1
--
OTS initialized
Software Reset repeats from same hardfault as above |
this is the earlier pre-core-rewrite, so not the newest one, but from a few months ago. this version also works with Manual Mesh. it is able to save using MBL however UBL or any other ABL bilinear bed mesh leveling, it doesnt save, instead it just restarts everytime you save store settings Connecting...
Update firmware at address 1a000...
Update firmware at address 1c000...
Update firmware at address 1e000...
Update firmware at address 20000...
Update firmware at address 22000...
Update firmware at address 24000...
Update firmware at address 26000...
Update firmware at address 28000...
Update firmware at address 2a000...
Update firmware at address 2c000...
Update firmware at address 2e000...
Update firmware at address 30000...
Update firmware at address 32000...
Update firmware at address 34000...
Update firmware at address 36000...
Update firmware at address 38000...
Update firmware at address 3a000...
Update firmware at address 3c000...
Update firmware at address 3e000...
Firmware update success!
GotoApp->addr=0xC000
start
Printer is now online.
External Reset
Marlin ProUI 2.1.3 MRiscoC
Build: 20230805 - 22:01
Author: Miguel A. Risco-Castillo (MRiscoC)echo: Free Memory: 3023 PlannerBufferBytes: 3456
echo:EEPROM version mismatch (EEPROM=V87 Marlin=V88)
//action:notification Hardcoded Default Settings Loaded
echo:Hardcoded Default Settings Loaded
echo:Settings Stored (1066 bytes; crc 18135)
//action:notification Settings Stored
echo:EEPROM Initialized
version 1.2
UID =(0x43323132,0xFF0E5030,0xFFFF732E)
sdio init success!
Disk init
Tips ------ None Factory file
Tips ------ None Firmware file
GotoApp->addr=0xC000
start
Software Reset
Marlin ProUI 2.1.3 MRiscoC
Build: 20230805 - 22:01
Author: Miguel A. Risco-Castillo (MRiscoC)echo: Free Memory: 3023 PlannerBufferBytes: 3456
echo:V88 stored settings retrieved (1066 bytes; crc 18135)
//action:notification Stored settings retrieved
//action:prompt_end
L24CXX Check succeeded!
echo:SD card ok
version 1.2
UID =(0x43323132,0xFF0E5030,0xFFFF732E)
sdio init fail!
Disk init
Tips ------ None Factory file
Tips ------ None Firmware file
GotoApp->addr=0xC000
start
Watchdog Reset
Marlin ProUI 2.1.3 MRiscoC
Build: 20230805 - 22:01
Author: Miguel A. Risco-Castillo (MRiscoC)echo: Free Memory: 3023 PlannerBufferBytes: 3456
echo:V88 stored settings retrieved (1066 bytes; crc 18135)
//action:notification Stored settings retrieved
//action:prompt_end
L24CXX Check succeeded!
echo:SD card released
echo: Serial 0 baud rate set to 11520ok
here is UBL version of PROUI, with previous
|
doesnt appear for the UBL version, this is the one that doesnt allow store/save settings. it starts by saying invalid mesh. also, I am still not having them read the SD card after flashing, still reboot loops using SD card. |
ok, it seems like something is going really wrong, because the cpu is trying to execute at could you please upload the
two more things:
|
I'll need a couple days to get this step done. for question 1. is ti the same firmware between comments: yes I believe they are both the same firmware without recompiling.
|
Ok, take your time. but on another note, could you also add the output of the link step during the build? Specifically the report of the binary size? if the report shows that more than |
so 212992 is the absolute limit for these chips? I was looking in the other repos which used Eclipse to compile this firmware, they had it limited to 208K, was there a reason for that which could matter now? how may I output the link step during the build? is it the log in terminal during compile? |
212992 Bytes / 1024 = 208 KBytes, so that would be the same. the chips themselves do support 256 KBytes (or 512 KBytes, depending on model), but the bootloader that handles flashing from sd card takes up ~48 Kbytes.
after compiling the firmware, at the bottom of VSCode there should be a panel listing the compiler logs, which includes the memory usage summary of the link step. it should look something like this:
i'm not quite sure if this is also shown when compiling using the marlin autobuild extension, iirc there is a checkbox to enable verbose / detailed / full log output. alternatively, you can select the 'HC32460 aquila 101' (called different, but can't look it up rn) environment and compile with platformio directly, then it is shown always. |
this is using the most recent |
ok, so the firmware is actually taking up more than please try to reduce the used flash size to be below this way, some extra code that does error checking in the DDL (for |
GREAT SUCCESS!! I tested the most recent and this issue is no more. So the issue before was it would freeze/restart when attempting to save. everything seems to work fine (WithOUT the SD card in) for the limited time I spent using it, the only unfortunate thing is just that - w/ SD card inserted, pressing the knob button freezes/restart. |
could you go into more detail what you mean by "forces the screen to restart"? Does the entire printer restart, or what is happening? If it's not the entire printer restarting, could you provide pictures to make clear what you mean? additionally, please attach serial output from the time the issue occurs, so from when pressing ENTER after inserting the SD card. |
yes let me provide a video. so this happens only with the SD card inserted AND when the encoder knob is pressed. soon as it is pressed it restarts/reboots like being turned on. the screen resets with a loading bar and goes back to the start menu. only with the SD card in which is kind of strange. but without an SD card everything is normal. |
here are some files which recorded the terminal output in Pronterface. they show what happens immediately at startup, and when the fault occurs. I used two repository types. the one labeled some things to note: Got rubbish reply from COM3 at baudrate 250000:
Maybe a bad baudrate? echo: Serial 0 baud rate set to 250000
Got rubbish reply from COM3 at baudrate 115200:
Maybe a bad baudrate? this Marlin-H32 repo ( another oddity is using MRiscoC's PROUI - with SD card inserted, when it would freeze/restart by pressing the knob, the terminal wouldn't show any HARDFAULT like the other MRiscoC's PROUI - with SD card inserted would load normally, except ONLY when the knob is pressed THEN the printer will freeze/restart - loading screen back to the main menu. in pins_Aquila_V101.h I noticed that #define EXP_03_PIN PB10
#define EXP_04_PIN PB11 were once on the brightside, the previous issue of it restarting when saving/store eeprom is gone 🥇 |
i'm assuming you've set the baudrate in marlin to 250000? if so, the 'interference' would be from either the bootloader or the core panicking. the latter can be adjusted in hc32.ini. looking at
additionally, you can also use the branch in #50 to get a better fault report. In that case, you'll have to enable |
this is all very good information. I will do this. so I did have everything set to 115200. the odd thing was it gave that error, and switching to 250000 it went away, however it didnt work after that. is |
what error? if you're talking about the
it should be fairly stable at this point, i'm only ironing out the last (annoyingly stubborn) issues... also, since i was struggeling with debugging faults inside the fault handler, i've written a little tool that might be helpful here too: https://github.com/shadow578/CrashAlyzer/ |
closing since last activity over a month ago |
Did you test the latest
bugfix-2.1.x
code?Yes, and the problem still exists.
Bug Description
When having to save, such as Z-offset, mesh build, or control /advance settings, the LCD screen stops and reboots.
it happens when using BLTouch - Bilinear or UBL bed leveling, or mesh bed leveling.
is this related in the Framework? because this behavior doesn't happen to other chips like G32 or N32.
can this be from something incorrect with flash size? because originally it was limited to 208K. now it can go up to 256K??
Bug Timeline
No response
Expected behavior
Normally, it would just save and the screen not restart
Actual behavior
Screen Restarts, LCD reboots system.
Steps to Reproduce
No response
Version of Marlin Firmware
current
Printer model
No response
Electronics
No response
Add-ons
No response
Bed Leveling
None
Your Slicer
None
Host Software
None
Don't forget to include
Configuration.h
andConfiguration_adv.h
.Additional information & file uploads
Any possibility are you going to update this repository in the near future? or what other things may be planned regarding this chipset for Voxelab Aquila?
would you be able to help guide me to fix this issue?
The text was updated successfully, but these errors were encountered: