Skip to content
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

Latest firmware bootloops when compiled from scratch for Ender 3 S1 F4 #1180

Closed
stickmansam4 opened this issue Dec 19, 2023 · 44 comments
Closed
Labels
bug: Fixed This was a bug, but has been fixed in the new firmware versions.

Comments

@stickmansam4
Copy link

stickmansam4 commented Dec 19, 2023

Did you test with a precompiled firmware?

Yes, problem fixed. printer boots fine.

Bug Description

When compiling MRISCO Source from scratch, causes Ender 3 S1 to soft brick and bootloop.

However if i load the precompiled binary file from GIT repo "Ender3S1-F4-UBL-20231214.bin" it boots just fine.

Alternatively if i compile creality stock firmware from GIT using marlin vers 2.0.8.3 that also boots OK.

Bug Timeline

New, 2023 Release

Expected behavior

I expect the newly complied binary to boot successfully just the same as the precompiled binary provided from GIT

Actual behavior

printer hangs on Creality splash screen and seems to bootloop when viewing the COM port.

Steps to Reproduce

  1. Unpack MRISCO Source from GIT "Ender3V2S1-Ender3V2S1-Released.zip"
  2. Unpack MRISCO Configurations from GIT "Special_Configurations-main.zip"
  3. Using IDLE, run "Configurator.pyw"
  4. Select Ender 3 S1 stock settings shown attached PNG
  5. Generate Files, and move to .../src/Marlin/
  6. moved platformio.ini to .../src/
  7. Execute Build "STM32F401RC (256K)"
  8. Create "SMT32F4_UPDATE" folder on root of SDCARD and copy .bin file into that folder.
  9. insert into printer and power on.

Version of Professional Firmware

2.1.3

Printer model

Creality Ender 3 S1, F4

Electronics

STM23F401RC

LCD/Controller

DWIN

Other add-ons

No response

Bed Leveling

ABL Bilinear mesh

Your Slicer

Cura

Host Software

OctoPrint

Additional information & file uploads

BuildLog.txt
AutoMarlinDisplayMRISCOS1
MRISCO Configurator

@mriscoc mriscoc added the bug: Confirmed Something isn't working, the bug was confirmed. label Dec 19, 2023
@mriscoc
Copy link
Owner

mriscoc commented Dec 19, 2023

Thanks, that issue was reported first here: #1164 (reply in thread)

Indeed the current sources and precompiled firmware for the F4 202312XX version have a bug that prevents to reboot. Unfortunately I don't have that board for do the proper debug. I suspect about the CRC corruption in settings.cpp.

I need the debugging information sent by the printer to a serial console when the printer reboots.

@stickmansam4
Copy link
Author

Ok I will try to get that info tonight.

I tried several configurations and even manually disabled the items you mentioned in your post to reduce program size but still gets the same result.

Last time I hooked the serial console up during boot it read back mostly garbage characters but eventually I started to see repeating "SD bootloader" and then the name of the bin file over and over.

That was using baud 115200, all other baudrates were illegible.

@mriscoc
Copy link
Owner

mriscoc commented Dec 19, 2023

Thanks, try with the baud rate in 250000

@thecactiboi
Copy link

I have experienced this same or a similar issue with my F4 S1, when trying to load a custom-compiled professional firmware from SD card the printer is stuck on the "wait for reboot" screen and stays like this until another firmware is flashed. When connected to a host (pronterface at 250000 baud), this is the output I received:

Marlin ProUI Version: 2.1.3 MRiscoC
CUSTOM BUILD: 20231214 - 13:42
Author: Miguel Risco-Castillo (MRiscoC)
echo: Free Memory: 42351 PlannerBufferBytes: 1728
Warning:EEPROM CRC mismatch - (stored) 62963 != 64046 (calculated)!
//action:notification Err: EEPROM CRC
//action:notification Hardcoded Default Settings Loaded
echo:Hardcoded Default Settings Loaded
echo:Settings Stored (1065 bytes; crc 62963)
//action:notification Settings Stored
echo:EEPROM Initialized
Got rubbish reply from COM3 at baudrate 250000:
Maybe a bad baudrate?
Software Reset

This repeated until the printer was turned off, and rebooting even without the SD card inserted produced the same output.

By disabling EEPROM_AUTO_INIT and EEPROM_INIT_NOW and adding DEBUG_EEPROM_READWRITE in Configuration.h and recompiling I was able to get the custom firmware to boot, though it would give the message "Error: EEPROM CRC" on the printer screen at startup and when rebooted would discard any saved settings. Sometimes a message with "EEPROM Size" would show on the printer screen as well.

@mriscoc
Copy link
Owner

mriscoc commented Dec 20, 2023

Thanks, that confirms my suspicions, CRC was corrupt. So, a firmware where CRC is tested at different places is needed to discover where it is being corrupted, please enable DEBUG_EEPROM_READWRITE and paste here the serial console results.

@stickmansam4
Copy link
Author

Just got home and tried it as well looks like i got the same thing.

Marlin ProUI Version: 2.1.3 MRiscoC
CUSTOM BUILD: 20231218 - 20:18
Author: Miguel Risco-Castillo (MRiscoC)
echo: Free Memory: 53711 PlannerBufferBytes: 1856
Warning:EEPROM CRC mismatch - (stored) 31692 != 34548 (calculated)!
//action:notification Err: EEPROM CRC
//action:notification Hardcoded Default Settings Loaded
echo:Hardcoded Default Settings Loaded
echo:Settings Stored (1050 bytes; crc 31692)
//action:notification Settings Stored
echo:EEPROM Initialized

@thecactiboi
Copy link

Here is the output I received when DEBUG_EEPROM_READWRITE was enabled and EEPROM_BOOT_SILENT was disabled:

External Reset
Marlin ProUI Version: 2.1.3 MRiscoC
CUSTOM BUILD: 20231219 - 21:47
Author: Miguel Risco-Castillo (MRiscoC)
echo: Free Memory: 54431 PlannerBufferBytes: 1536
echo:EEPROM version mismatch (EEPROM=V89 Marlin=P89)
//action:notification Hardcoded Default Settings Loaded
echo:Hardcoded Default Settings Loaded
Field: proui_data
Field: e_factors
Field: home_offset
Field: runout_sensor_enabled
Field: planner_autotemp_max
Field: probe_offset
Field: planner_leveling_active
Field: servo_angles
Field: bltouch_od_5v_mode
Field: bltouch_high_speed_mode
Field: ui_material_preset
Field: hotendPID
Field: lpq_len
Field: bedPID
Field: chamberPID
Field: power_monitor_flags
Field: lcd_contrast
Field: lcd_brightness
Field: controllerFan_settings
Field: recovery_enabled
Field: fwretract_settings
Field: parser_volumetric_enabled
Field: tmc_stepper_current
Field: tmc_hybrid_threshold
Field: tmc_stealth_enabled
Field: planner_extruder_advance_K
Field: motor_current_setting
Field: coordinate_system
Field: fc_settings
Field: backlash_distance_mm
Field: dwin_data
echo:Settings Stored (1049 bytes; crc 7352)
//action:notification Settings Stored
echo:EEPROM Initialized
Got rubbish reply from COM3 at baudrate 250000:
Maybe a bad baudrate?
Software Reset
Marlin ProUI Version: 2.1.3 MRiscoC
CUSTOM BUILD: 20231219 - 21:47
Author: Miguel Risco-Castillo (MRiscoC)
echo: Free Memory: 54431 PlannerBufferBytes: 1536
Field: proui_data
Field: e_factors
Field: home_offset
Field: runout_sensor_enabled
Field: probe_offset
Field: planner_leveling_active
Field: servo_angles
Field: bltouch_od_5v_mode
Field: bltouch_high_speed_mode
Field: ui_material_preset
Field: lpq_len
Field: power_monitor_flags
Field: lcd_contrast
Field: lcd_brightness
Field: controllerFan_settings
Field: recovery_enabled
Field: fwretract_settings
Field: parser_volumetric_enabled
Field: tmc_stepper_current
Field: tmc_hybrid_threshold
Field: tmc_sgt
Field: tmc_stealth_enabled
Field: planner_extruder_advance_K
Field: motor_current_setting
Field: coordinate_system
Field: fc_settings
Field: backlash_distance_mm
Field: dwin_data
Warning:EEPROM CRC mismatch - (stored) 7352 != 10178 (calculated)!
//action:notification Err: EEPROM CRC
//action:notification Hardcoded Default Settings Loaded
echo:Hardcoded Default Settings Loaded
Field: proui_data
Field: e_factors
Field: home_offset
Field: runout_sensor_enabled
Field: planner_autotemp_max
Field: probe_offset
Field: planner_leveling_active
Field: servo_angles
Field: bltouch_od_5v_mode
Field: bltouch_high_speed_mode
Field: ui_material_preset
Field: hotendPID
Field: lpq_len
Field: bedPID
Field: chamberPID
Field: power_monitor_flags
Field: lcd_contrast
Field: lcd_brightness
Field: controllerFan_settings
Field: recovery_enabled
Field: fwretract_settings
Field: parser_volumetric_enabled
Field: tmc_stepper_current
Field: tmc_hybrid_threshold
Field: tmc_stealth_enabled
Field: planner_extruder_advance_K
Field: motor_current_setting
Field: coordinate_system
Field: fc_settings
Field: backlash_distance_mm
Field: dwin_data
echo:Settings Stored (1049 bytes; crc 7352)
//action:notification Settings Stored
echo:EEPROM Initialized
Got rubbish reply from COM3 at baudrate 250000:
Maybe a bad baudrate?
Software Reset

When EEPROM_AUTO_INIT and EEPROM_INIT_NOW were disabled, this is what I got on boot:

External Reset
Marlin ProUI Version: 2.1.3 MRiscoC
CUSTOM BUILD: 20231219 - 22:00
Author: Miguel Risco-Castillo (MRiscoC)
echo: Free Memory: 54431 PlannerBufferBytes: 1536
Warning:EEPROM datasize error.
echo:Index: 8 Size: 1045
//action:notification Err: EEPROM Size
//action:notification Hardcoded Default Settings Loaded
echo:Hardcoded Default Settings Loaded
//action:prompt_end
BL24CXX Check succeeded!
echo:SD card ok
Printer is now online.

I then clicked the "Store Settings" option on the printer, which slowly output these:

Field: proui_data
Field: e_factors
Field: home_offset
Field: runout_sensor_enabled
Field: planner_autotemp_max
Field: probe_offset
Field: planner_leveling_active
Field: servo_angles
Field: bltouch_od_5v_mode
Field: bltouch_high_speed_mode
Field: ui_material_preset
Field: hotendPID
Field: lpq_len
Field: bedPID
Field: chamberPID
Field: power_monitor_flags
Field: lcd_contrast
Field: lcd_brightness
Field: controllerFan_settings
Field: recovery_enabled
Field: fwretract_settings
Field: parser_volumetric_enabled
Field: tmc_stepper_current
Field: tmc_hybrid_threshold
Field: tmc_stealth_enabled
Field: planner_extruder_advance_K
Field: motor_current_setting
Field: coordinate_system
Field: fc_settings
Field: backlash_distance_mm
Field: dwin_data
Got rubbish reply from COM3 at baudrate 250000:
Maybe a bad baudrate?

At this point the printer froze and quickly rebooted. When the reboot finished, Err: EEPROM Version showed on the printer's status bar. On subsequent reboots this does not happen when saving settings, though settings are still not saved when turning the printer off and on.

@classicrocker883
Copy link

classicrocker883 commented Dec 20, 2023

On subsequent reboots this does not happen when saving settings, though settings are still not saved when turning the printer off and on.

echo:EEPROM version mismatch (EEPROM=V89 Marlin=P89)

that is also something I have experience. but only using Bilinear_auto_bed_leveling where it wouldn't save the mesh

@Arturchik29
Copy link

It looks like the problems are with these settings:
motor_current_setting
tmc_sgt

Quick fix: comment out everything about these settings in Marlin\src\module\settings.cpp
Also define new eeprom structure vesion here:
#define EEPROM_VERSION "P89"
change to
#define EEPROM_VERSION "P90"

@mriscoc
Copy link
Owner

mriscoc commented Dec 23, 2023

It looks like the problems are with these settings: motor_current_setting tmc_sgt

Quick fix: comment out everything about these settings in Marlin\src\module\settings.cpp Also define new eeprom structure vesion here: #define EEPROM_VERSION "P89" change to #define EEPROM_VERSION "P90"

Thanks for your findings, but I can't understand why F4 UBL version doesn't suffer of bootloops. Trying to give more details, if follow your steps. there isn't a bootloop, but ¿are the settings saved and loaded correctly?

@thecactiboi
Copy link

I made the changes suggested by @Arturchik29, commenting out all instances of motor_current_setting and tmc_sgt in settings.cpp, as well as changing the EEPROM version to P90. At least in my case, the printer was able to save and load settings on reboot when I made these changes to my custom firmware build. I also tried only changing the EEPROM version, but it went back to bootlooping as usual, so there appears to be something wrong with motor_current_setting and tmc_sgt being present in settings.cpp.

@Arturchik29

This comment was marked as off-topic.

@Arturchik29
Copy link

are the settings saved and loaded correctly?

yes

@mriscoc
Copy link
Owner

mriscoc commented Dec 24, 2023

Please test it:
firmware-20231224-140101.zip

@Arturchik29
Copy link

Please test it:

Bootloop. Console output:

 Software Reset
Marlin ProUI Version: 2.1.3 MRiscoC
OFFICIAL BUILD: 20231224 - 14:00
Author: Miguel Risco-Castillo (MRiscoC)
echo: Free Memory: 53711  PlannerBufferBytes: 1856
Warning:EEPROM CRC mismatch - (stored) 46634 != 54985 (calculated)!
//action:notification Err: EEPROM CRC
//action:notification Hardcoded Default Settings Loaded
echo:Hardcoded Default Settings Loaded
echo:Settings Stored (823 bytes; crc 46634)
//action:notification Settings Stored
echo:EEPROM Initialized
▒▒▒▒▒▒x`▒▒▒▒▒▒▒▒怘▒x~▒▒▒▒▒▒▒▒▒▒~▒▒▒f▒▒▒▒▒f▒▒▒▒▒▒▒▒▒▒8▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒~▒~▒~~~▒▒▒▒▒x▒▒~▒▒▒▒x▒▒▒▒▒▒▒▒`▒`▒`▒▒▒▒▒>▒▒▒~▒x怘怘▒▒▒▒▒▒▒▒▒▒▒▒▒▒>▒▒▒~▒▒start

@mriscoc
Copy link
Owner

mriscoc commented Dec 24, 2023

Bootloop. Console output:

Thanks, so I can't replicate the successful of here #1180 (comment)

Maybe the bug is feature dependent and moves according to the use of the used EEPROM space

@Arturchik29
Copy link

It looks like something happened with the bootloader. I cant reflash to custom build or stock firmware. It's always "OFFICIAL BUILD: 20231224 - 14:00"
There is also an empty DWIN_SET folder in STM32F4_UPDATE. Never seen this before. It is now created by the bootloader every time on strartup if STM32F4_UPDATE exists

@mriscoc
Copy link
Owner

mriscoc commented Dec 24, 2023

It looks like something happened with the bootloader. I cant reflash to custom build or stock firmware. It's always "OFFICIAL BUILD: 20231224 - 14:00" There is also an empty DWIN_SET folder in STM32F4_UPDATE. Never seen this before. It is now created by the bootloader every time on strartup if STM32F4_UPDATE exists

Try with another SD card, format it.

@mriscoc

This comment was marked as off-topic.

@mriscoc
Copy link
Owner

mriscoc commented Jan 8, 2024

This firmware build should help us to know where the CRC was corrupted, please log the error messages for EEPROM read and EEPROM write without change any settings.
Ender3S1-F4-DEBUG-20240108.zip

@Witska
Copy link

Witska commented Jan 10, 2024

This firmware build should help us to know where the CRC was corrupted, please log the error messages for EEPROM read and EEPROM write without change any settings. Ender3S1-F4-DEBUG-20240108.zip

After this firmware i cant flash to custom build or stock firmware. Always OFFICIAL BUILD: 20240108 - 14:18. Reflash only after bootloader flash.

External Reset
Marlin ProUI Version: 2.1.3 MRiscoC
OFFICIAL BUILD: 20240108 - 14:18
Author: Miguel Risco-Castillo (MRiscoC)
echo: Free Memory: 53719  PlannerBufferBytes: 1856
READ: stored_ver CRC: 18057
READ: stored_hash CRC: 32557
READ: stored_crc CRC: 5859
READ: stored_size CRC: 44129
READ: meshSet CRC: 9031
Field: proui_data
READ: proui_data CRC: 29806
READ: meshViewer.meshmode CRC: 16434
Field: e_factors
READ: e_factors CRC: 27365
READ: (uint8_t *)tmp1 CRC: 41944
READ: planner.settings.min_segment_time_us CRC: 35965
READ: (uint8_t *)tmp2 CRC: 63355
READ: (uint8_t *)tmp3 CRC: 59653
READ: planner.settings.acceleration CRC: 6336
READ: planner.settings.retract_acceleration CRC: 13494
READ: planner.settings.travel_acceleration CRC: 17813
READ: planner.settings.min_feedrate_mm_s CRC: 16656
READ: planner.settings.min_travel_feedrate_mm_s CRC: 23371
READ: planner.max_jerk CRC: 23743
READ: dummyf CRC: 57242
Field: runout_sensor_enabled
READ: runout_sensor_enabled CRC: 41106
READ: runout_distance_mm CRC: 237
READ: new_z_fade_height CRC: 48227
READ: planner.autotemp.max CRC: 64431
READ: planner.autotemp.min CRC: 63611
READ: planner.autotemp.factor CRC: 24324
Field: probe_offset
READ: zpo CRC: 53067
READ: grid_max_x CRC: 62090
READ: grid_max_y CRC: 54388
READ: grid_check CRC: 36584
READ: spacing CRC: 59614
READ: start CRC: 7429
READ: bedlevel.z_values CRC: 59994
Field: bltouch_od_5v_mode
READ: bltouch_od_5v_mode CRC: 1636
Field: bltouch_high_speed_mode
READ: bltouch_high_speed_mode CRC: 5351
Field: ui_material_preset
READ: ui.material_preset CRC: 45534
READ: pidcf CRC: 22774
Field: lpq_len
READ: lpq_len CRC: 51064
READ: pid CRC: 62587
Field: lcd_brightness
READ: lcd_brightness CRC: 23523
READ: ui.backlight_timeout_minutes CRC: 22587
Field: recovery_enabled
READ: recovery_enabled CRC: 57597
Field: fwretract_settings
READ: fwretract_settings CRC: 63582
READ: autoretract_enabled CRC: 12311
Field: parser_volumetric_enabled
READ: storage CRC: 60545
Field: coordinate_system
Field: fc_settings
READ: fc_settings CRC: 34157
Field: dwin_data
READ: dwin_data CRC: 24735
Field: sound_on
READ: ui.sound_on CRC: 58247
READ: hotend_idle.cfg CRC: 47205
Warning:EEPROM CRC mismatch - (stored) 55430 != 47205 (calculated)!
//action:notification Err: EEPROM CRC
//action:notification Hardcoded Default Settings Loaded
echo:Hardcoded Default Settings Loaded
WRITE: ver CRC: 35498
WRITE: data_size CRC: 44129
WRITE: meshSet CRC: 9031
Field: proui_data
WRITE: proui_data CRC: 29806
WRITE: meshViewer.meshmode CRC: 16434
Field: e_factors
WRITE: e_factors CRC: 27365
WRITE: planner.settings CRC: 23371
WRITE: planner.max_jerk CRC: 23743
WRITE: dummyf CRC: 57242
Field: runout_sensor_enabled
WRITE: runout_sensor_enabled CRC: 41106
WRITE: runout_distance_mm CRC: 237
WRITE: zfh CRC: 48227
Field: planner_autotemp_max
WRITE: planner.autotemp.max CRC: 64431
WRITE: planner.autotemp.min CRC: 63611
WRITE: planner.autotemp.factor CRC: 24324
Field: probe_offset
WRITE: zpo CRC: 53067
WRITE: grid_max_x CRC: 62090
WRITE: grid_max_y CRC: 54388
WRITE: grid_check CRC: 36584
WRITE: bedlevel.grid_spacing CRC: 59614
WRITE: bedlevel.grid_start CRC: 7429
WRITE: bedlevel.z_values CRC: 59994
Field: bltouch_od_5v_mode
WRITE: bltouch_od_5v_mode CRC: 1636
Field: bltouch_high_speed_mode
WRITE: bltouch_high_speed_mode CRC: 5351
Field: ui_material_preset
WRITE: ui.material_preset CRC: 45534
Field: hotendPID
WRITE: pidcf CRC: 22774
Field: lpq_len
WRITE: lpq_len CRC: 51064
Field: bedPID
WRITE: bed_pid CRC: 62587
Field: lcd_brightness
WRITE: lcd_brightness CRC: 23523
WRITE: ui.backlight_timeout_minutes CRC: 22587
Field: recovery_enabled
WRITE: recovery_enabled CRC: 57597
Field: fwretract_settings
WRITE: fwretract.settings CRC: 63582
WRITE: autoretract_enabled CRC: 12311
Field: parser_volumetric_enabled
WRITE: parser.volumetric_enabled CRC: 8531
WRITE: planner.filament_size CRC: 37226
WRITE: dummyf CRC: 60545
Field: coordinate_system
Field: fc_settings
WRITE: fc_settings CRC: 34157
Field: dwin_data
WRITE: dwin_data CRC: 24735
WRITE: ui.sound_on CRC: 58247
WRITE: hotend_idle.cfg CRC: 55430
WRITE: version CRC: 58035
WRITE: build_hash CRC: 24014
WRITE: final_crc CRC: 47914
echo:Settings Stored (823 bytes; crc 55430)
//action:notification Settings Stored
echo:EEPROM Initialized
//action:prompt_end
BL24CXX Check succeeded!
echo:SD card ok

@mriscoc
Copy link
Owner

mriscoc commented Jan 12, 2024

Excellent:

READ: hotend_idle.cfg CRC: 47205
WRITE: hotend_idle.cfg CRC: 55430

So, now I need to analyze why the CRC is different.

@dmenzie
Copy link

dmenzie commented Jan 18, 2024

Any update to this? i suspect im running into the same issue with my compiled build but am not tech savvy enough to be useful for debugging

@dmenzie
Copy link

dmenzie commented Jan 18, 2024

It looks like something happened with the bootloader. I cant reflash to custom build or stock firmware. It's always "OFFICIAL BUILD: 20231224 - 14:00" There is also an empty DWIN_SET folder in STM32F4_UPDATE. Never seen this before. It is now created by the bootloader every time on strartup if STM32F4_UPDATE exists

i am also unable to reflash after using this firmware

@Arturchik29
Copy link

@dmenzie unfortunately, I my case the only thing what can help is reflashing with ST-Link. The bootloader area seems to be overwritten after flashing. Do you need help with this?

@Arturchik29

This comment was marked as off-topic.

@mriscoc

This comment was marked as off-topic.

@dmenzie
Copy link

dmenzie commented Jan 21, 2024

@Arturchik29 yes please, any advice/guidance would be appreciated. I have an ST-link clone and/or an Arduino to get it done, but am unfamiliar with programming microcontrollers, id assume the process is similar to an older ender 3 (which I can find video documentation on how to do), but am unsure if there is anything specific to the stm32f4 boards that I need to be aware of

@mriscoc
Copy link
Owner

mriscoc commented Jan 24, 2024

Issue solved!, We just found that Creality implemented some kind of flag zone in the EEPROM for the Ender3S1 F4 bootloader, if that zone is written with non 0 values the bootloader refuses to flash a new firmware.

That solves the mystery of why that printer sometimes refuses to update new firmware and only can be solved by using a ST-link device, also that solves the mystery about the CRC EEPROM corruption

@TheWebMachine
Copy link

That also means we have even less space to work with. 😮‍💨

@mriscoc
Copy link
Owner

mriscoc commented Jan 24, 2024

That also means we have even less space to work with. 😮‍💨

it is not a problem with the flash program memory is a matter of EEPROM memory

@TheWebMachine
Copy link

With the new per-slot ABL 2.0 settings, are we at any risk of filling it up?

@mriscoc
Copy link
Owner

mriscoc commented Jan 24, 2024

With the new per-slot ABL 2.0 settings, are we at any risk of filling it up?

UBL has its own EEPROM zone out of that flag zone. But normal firmware without UBL is affected. Ok that mystery also was solved.

@TheWebMachine
Copy link

And we don't have room for UBL in the CVLM firmware without some other major sacrifice, correct?

@mriscoc
Copy link
Owner

mriscoc commented Jan 24, 2024

And we don't have room for UBL in the CVLM firmware without some other major sacrifice, correct?

But don't worry, the solution is on the way, we are trying it here: https://t.me/ender3v2s1firmware/66444 of course if more people test the fixes we will able to release it soon.

@TheWebMachine
Copy link

I could perhaps give it a try this evening.

@mriscoc
Copy link
Owner

mriscoc commented Jan 25, 2024

A PR MarlinFirmware/Marlin#26729 was posted in Marlin repository which solves this issue.

mriscoc added a commit that referenced this issue Jan 25, 2024
That zone is used by some boot loaders to save flags that control the flashing at boot process.

The exclusion zone should be defined in the **.INI** board environments that require it by:
```log
 -DEEPROM_EXCL_ZONE=100,200
```
or in the board pin file by:
```c++
#define EEPROM_EXCL_ZONE 100,200  // Test a range
or
#define EEPROM_EXCL_ZONE 333      // Test a single byte
```
For example, in the Ender-3S1 F4: Marlin\src\pins\stm32f4\pins_CREALITY_V24S1_301F4.h:
```c++
#define EEPROM_EXCL_ZONE 919,926  // Test a range
```

### Related Issues

In the Ender-3 S1 with the STM32F401 SoC the range of exclusion is from 919 to 926. Even if the zone is filled with 0xFF values, the boot loader changes it when the printer is rebooted:

```log
0370: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0380: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0390: FF FF FF FF 00 FF FF FF FF FF FF FF FF 66 FF FF
03A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
03B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
```
If the zone is not excluded, the boot loader may not allow flashing new firmware and may also cause CRC EEPROM corruption.

Perhaps related to:
#125
#1180
MarlinFirmware/Marlin#26144
@mriscoc
Copy link
Owner

mriscoc commented Jan 25, 2024

Seems to be resolved in the latest sources.

@mriscoc mriscoc closed this as completed Jan 25, 2024
@mriscoc
Copy link
Owner

mriscoc commented Jan 26, 2024

For people with an Ender3S1F4 printer which refuses to flash new firmware, @trotus47 has prepared a G-code file which could help with the flash process, simply put the new firmware (in the folder STM32F4_UPDATE), this file in the SD card and select and click on it in the Media menu, then reboot the printer.

; Professional Firmware Configuration File
;=====================================================
C10                    ; Mark as a configuration file
M117 Applying configuration
;-----------------------------------------------------
M86 S0 T3 E0 B0        ; Reset flag zone
M500                   ; Save all settings
;-----------------------------------------------------
G4 S1                  ; Wait a second
M300 P200              ; Beep
M117 Configuration Applied
;-----------------------------------------------------

config_reset.zip

@MagicAlien
Copy link

MagicAlien commented Feb 9, 2024

For people with an Ender3S1F4 printer which refuses to flash new firmware, @trotus47 has prepared a G-code file which could help with the flash process, simply put the new firmware (in the folder STM32F4_UPDATE), this file in the SD card and select and click on it in the Media menu, then reboot the printer.

; Professional Firmware Configuration File
;=====================================================
C10                    ; Mark as a configuration file
M117 Applying configuration
;-----------------------------------------------------
M86 S0 T3 E0 B0        ; Reset flag zone
M500                   ; Save all settings
;-----------------------------------------------------
G4 S1                  ; Wait a second
M300 P200              ; Beep
M117 Configuration Applied
;-----------------------------------------------------

config_reset.zip

  • The config reset g-code worked well;
  • The compiled firmware from the updated released branch, with Fix Ender-3 S1F4 EEPROM exclusion zone, still doesn't work:
    --> At boot the new firmware is installed as expected;
    --> The printer start with the new boot;
    --> Bootloop rebooting without SD card;
    --> Booting with SD card will re-install the firmware again (without name changing)
  • Modified in #define EEPROM_EXCL_ZONE 915,926 // Exclude EEPROM area used as bootloader flag zone
    --> Compiled, installed, worked

@mriscoc
Copy link
Owner

mriscoc commented Feb 9, 2024

  • The compiled firmware from the updated released branch, with Fix Ender-3 S1F4 EEPROM exclusion zone, still doesn't work

None of the S1 F4? or an specific bin file?

@MagicAlien
Copy link

  • The compiled firmware from the updated released branch, with Fix Ender-3 S1F4 EEPROM exclusion zone, still doesn't work

None of the S1 F4? or an specific bin file?

I was following the topic, meaning that compiling from scratch the firmware with the "Fix Ender-3 S1F4 EEPROM exclusion zone" won't work.
To fix properly the EEPROM exclusion zone, I had to #define EEPROM_EXCL_ZONE 915,926 [was 916]

@mriscoc
Copy link
Owner

mriscoc commented Feb 12, 2024

In our test board the 916 was the start of the EEPROM exclusion zone that was checked doing a EEPROM dump. If the zone is filled with 0xFF values, the boot loader changes it when the printer is rebooted:

0370: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0380: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0390: FF FF FF FF 00 FF FF FF FF FF FF FF FF 66 FF FF
03A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
03B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

So maybe the zone changes depending on the bootloader version installed in the printer board. If more reports are obtained, the exclusion zone will have to be expanded.

Apie56 pushed a commit to Apie56/Ender-3-V2-Mrisco that referenced this issue Apr 6, 2024
That zone is used by some boot loaders to save flags that control the flashing at boot process.

The exclusion zone should be defined in the **.INI** board environments that require it by:
```log
 -DEEPROM_EXCL_ZONE=100,200
```
or in the board pin file by:
```c++
#define EEPROM_EXCL_ZONE 100,200  // Test a range
or
#define EEPROM_EXCL_ZONE 333      // Test a single byte
```
For example, in the Ender-3S1 F4: Marlin\src\pins\stm32f4\pins_CREALITY_V24S1_301F4.h:
```c++
#define EEPROM_EXCL_ZONE 919,926  // Test a range
```

### Related Issues

In the Ender-3 S1 with the STM32F401 SoC the range of exclusion is from 919 to 926. Even if the zone is filled with 0xFF values, the boot loader changes it when the printer is rebooted:

```log
0370: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0380: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0390: FF FF FF FF 00 FF FF FF FF FF FF FF FF 66 FF FF
03A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
03B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
```
If the zone is not excluded, the boot loader may not allow flashing new firmware and may also cause CRC EEPROM corruption.

Perhaps related to:
mriscoc#125
mriscoc#1180
MarlinFirmware/Marlin#26144
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
@mriscoc mriscoc added bug: Fixed This was a bug, but has been fixed in the new firmware versions. and removed bug: Confirmed Something isn't working, the bug was confirmed. labels Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: Fixed This was a bug, but has been fixed in the new firmware versions.
Projects
None yet
Development

No branches or pull requests

9 participants