Skip to content

Commit 7369901

Browse files
Merge pull request #77 from Thinkersbluff/extui
Uploads Release Candidate 61F_RC_290422_v1 to main extui
2 parents 763a12e + 696c56a commit 7369901

38 files changed

+476
-1
lines changed

How-To_information.MD

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
**CAUTION: THIS FILE IS OUT OF DATE. IT IS HERE TO PRESERVE KEY USEFUL INFO UNTIL THE REPLACEMENT DOCUMENTATION (CURRENTLY IN WIP) IS READY TO POST.** - Thinkersbluff.
2+
3+
### Translations / localization
4+
5+
Internationalization support in DGUS DWIN is very cumbersome. The background images of each page has the text hardcoded. To translate and have it first-class, you would need to duplicate all the bmps, give it a separate ID, and maintain that mapping in firmware as well or make every label an icon, which is a lot of work. The development team has no capacity to maintain localizations.
6+
7+
If you like to translate the user interface to your own language, you must fork this repository and maintain your own version of the touch screen firmware.
8+
9+
The complete workflow would look like this:
10+
11+
1. Fork this repository.
12+
2. Work on the extui branch (this is the branch for all work going forward)
13+
3. In your fork, follow [the steps in the images section of this file](#images--screen-images-sources) to change the current bitmaps and translate them. There are XCF files available as the source of these bitmaps, usable in Gimp, to make life easier but you can do what you want.
14+
4. When we change something, it is up to you to replicate those screen changes. Therefore I recommend only to update the screen backgrounds and don't use the DWIN editor for anything other than for the purpose of generating the ICL file.
15+
5. Translated touch screen builds are up to you to provide which would then need to be made from the same moment as we are releasing builds.
16+
17+
Good luck, and if you maintain your own translated firmware, please let us know!
18+
19+
## Documentation for development
20+
21+
You need [the DGUS v8.2.1.14.x software](https://github.com/CR6Community/CR-6-touchscreen/releases/download/v2.0.8.1-cr6-community-release-6.1/DGUS_Tool_V8.2.1.14.7z) for editing the touch screen.
22+
23+
You can open the .dgus project file in the [`src\DWIN`](src\DWIN) folder:
24+
25+
![DGUS II interface](https://github.com/Thinkersbluff/CR-6-touchscreen_Thinkersbluff_Fork/blob/extui/doc/dgus2util.png)
26+
27+
### Build firmware archive
28+
29+
To build a firmware archive for distribution, use the `build.cmd` script. It will do a sanity check and then zip the files to the `build` folder.
30+
31+
For development you can run the build script as follows:
32+
33+
```pwsh
34+
.\build -Deploy Q:
35+
```
36+
37+
Where Q: is the path of your flash drive with the SD card.
38+
39+
You need to have Powershell Core installed (pwsh).
40+
41+
### Images / screen images sources
42+
43+
You can find the source files where the screen bitmaps are generated from in the [`src\images_src`](src\images_src) folder.
44+
45+
To update the BMP of a screen put the **generated BMP file you made with your image editor** in the [`src\DWIN\DWIN_SOURCE`](src\DWIN\DWIN_SOURCE) folder.
46+
47+
#### Updating the touch screen firmware files
48+
49+
It will be picked up automatically by the build process of DWIN when saving or generating the project. However, the ICL file is what actually gets flashed. This is essentially a dictionary of concatenated compressed JFIF files.
50+
51+
Next, re-generate the `23_Screen.icl` ICL file are follows:
52+
53+
![Update ICL file](doc/update-screen-icl.gif)
54+
55+
Things worthy of note:
56+
57+
- Quality is set to 100%, followed by pressing the "Set all" button to apply it to each import file.
58+
- The `DWIN_SOURCE` is used as a source for generating the ICL.
59+
- The ICL is saved twice: once in the `DWIN_SOURCE` folder, once in the `DWIN_SET` folder.
60+
61+
As you can note, you update it in both `DWIN_SET` and `DWIN_SOURCE`. The first is what goes to the touch screen, the latter is what the DWIN editor uses (apparently).
62+
63+
For icon ICL generation the process is the same, except that you pick the icons from a subdirectory of `DWIN_SOURCE`.
64+
65+
### Flash space
66+
67+
DWIN uses a specific set-up of the flash space as described in the manual - as shown below.
68+
69+
![DWIN flash space](doc/flash-space.png)
70+
71+
Essentially what it boils down to:
72+
73+
- The flash space is divided into 256KB sectors
74+
- The number prefix on the ICL/HZK/BIN file name is the sector number where the file is flashed
75+
- A sector can only contain a single file
76+
- A file can span over multiple sectors, and if a file needs 1½ sectors for instance, it will allocate 2 sectors.
77+
- There is no protection against sector overwriting: if you have files overlap sectors, DWIN will happily flash the next file over the previous file
78+
79+
So with the above in mind one must take care to make sure files do not overlap. When you flash everything to the touch screen you must ensure you've deleted the old (renumbered) ICL files from your SD card, otherwise weird things will happen. Background may go missing, etc.
80+
81+
During build a script will run to make sure no sectors have been overallocated. You can also run this script manually.
82+
83+
![DWIN sector allocation check script](doc/sector-allocation-check.png)
84+
85+
### How buttons are handled with code
86+
87+
In the currently - cleaned up - source code of the touch screen handling in Marlin, the events of the touch screen are handled as described below. This may change in the future. This picture says it all:
88+
89+
![DWIN button-code correlation](doc/button_type.png)
90+
91+
For buttons:
92+
93+
- Virtual Pointers for buttons are defined in `extui/lib/dgus_creality/DGUSDisplayDef.h`
94+
- In `extui/lib/dgus_creality/DGUSDisplayDef.cpp` in the `ListOfVP` the Virtual Pointer are connected to a callback handler
95+
- Because the Creality display used the same VP all over the place, sometimes in completely different functions or values (and this is quite some work to clean up!), these "legacy" VPs are delegated to `DGUSCrealityDisplay_HandleReturnKeyEvent`
96+
- For legacy VPs handlers are defined per page in `extui/lib/dgus_creality/PageHandlers.cpp`
97+
- The "Key Data" is used to distinguish between the actual key pressed and passed to these functions as `buttonValue`
98+
99+
For dynamic updatable values:
100+
101+
- Dynamic updatable values are Virtual Pointers with a value that is pushed from the display when it is changed, and pushed to the display during the Marlin `idle` loop
102+
- The Virtual Pointers are defined in `extui/lib/dgus_creality/DGUSDisplayDef.h`
103+
- Per dynamically updated virtual pointer there is in `extui/lib/dgus_creality/DGUSDisplayDef.cpp`:
104+
- A registration in `ListOfVP`, with:
105+
- The VP ID
106+
- A pointer to the memory location to read the value from in Marlin (can be `nullptr`)
107+
- A callback that is triggered when the VP changed in the display and is pushed to firmware
108+
- A callback that is triggered to format the VP for transfer to the display. This is because strings need to be sent differently than floats, or if your VP does not point to a direct value in memory.
109+
- A mention in the specific `VPList` for the current page as referenced in `VPMap`. This is to optimize that we don't update VPs that are not displayed anyway.
110+
- Some values like the M117 text are transient and are pushed directly to the display, but are still present in the `ListOfVP`
111+
112+
#### Previous version of the code
113+
114+
If you like to see how the touch screen code is handled in the Creality firmware and the original Community Firmware release 3 and lower, please check the [cf3-legacy](https://github.com/CR6Community/CR-6-touchscreen/tree/cf-3-legacy) branch. This branch is no longer maintained and only exists for historical purposes.
115+
116+
### Touch screen configuration
117+
118+
The touch screen configuration file "T5LCFG_272480.CFG" has its specification describer in [T5L_DGUSII Application Development Guide20200902.pdf](./doc/vendor/T5L_DGUSII%20Application%20Development%20Guide20200902.pdf) chapter 4. You can use an editor like HxD to explore and edit it (with caution!). The DWIN editor also has a way to edit this file. Many parameters can also be set at runtime.
119+
120+
### Fonts
121+
122+
Font's are currently configured like below:
123+
124+
![Font Settings](doc/font-settings.png)
125+
126+
In the same folder where you have the DWIN tool unpacked a `0_DWIN_ASC.HZK` file is placed. You need to copy that to the DWIN_SET folder, and can flash it directly.
127+
The kerning of the current font is not ideal (especially using numbers that are small, like "1"), so perhaps we should look for a replacement.
128+
129+
### Other documentation
130+
131+
Vendor documentation is mirrored to the [doc/vendor](doc/vendor) folder.
132+
133+
In addition, [this is a nice resource](https://github.com/rubienr/MarlinDgusResources/tree/creality-ender-5-plus/projects).
134+
135+
## Credits
136+
137+
[The core CR-6 Community firmware dev team](https://github.com/CR6Community/Marlin#credits)
138+
139+
Icons from [Font Awesome](https://fontawesome.com/) and [Remix Icon](https://remixicon.com/).
140+
141+
Font from [Google Fonts](https://fonts.google.com/specimen/B612) and customized with [FontForge](https://fontforge.org/).

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ If you wish to contribute to the project, please provide your inputs by raising
3232

3333
## Credits
3434

35-
[InsanityAutomation](https://github.com/InsanityAutomation/Marlin/tree/CrealityDwin2.0_Bleeding) initiated and leads this project. It is upon his work that Thinkersbluff is building.
35+
[InsanityAutomation](https://github.com/InsanityAutomation/Marlin/tree/CrealityDwin2.0_Bleeding) initiated the refactoring project. It is upon his work that Thinkersbluff has built this Release.
3636

3737
[The core CR-6 Community firmware dev team](https://github.com/CR6Community/Marlin#credits) did the heavy-lifting that resulted in the CF6.1 baseline.
3838

Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# NOTE: These kernel files are not required, unless you are having problems resulting from having inadvertently overwritten the DGUS2 kernel for which your display was last calibrated.
2+
3+
## STEP1 - BEFORE ACTING ON ANY OF THE FOLLOWING RECOMMENDATIONS:
4+
1. Create an EMPTY folder at the root directory of an EMPTY micro SD card.
5+
2. Ensure that your printer power is OFF
6+
3. Place that SD card in your display and cycle power ON
7+
4. The top line of the display will report which version of DGUS2 is currently flashed .
8+
4. Make note of which DGUS version is currently flashed to your display hardware (see top line on display)
9+
5. Take care to follow the applicable instructions below.
10+
11+
## IF your display is currently running v3.5 and it should be running v4.5:
12+
STEP 2:
13+
1. Copy T5L_UI_DGUS2_V45_20220105.BIN to the DWIN_SET folder created at step 1 above, and flash that to your display.
14+
2. Verify that the top line on the blue flash screen is now overwritten in red confirming that DGUS2 v4.5 is flashed
15+
3. Optionally repeat step 1 with an empty DWIN_SET folder, to confirm v4.5 is now the DGUS2 OS
16+
17+
# OR
18+
19+
## IF your display is currently running v4.5 and it should be running v3.5:
20+
STEP 2:
21+
1. Copy T5L_UI_DGUS2_V35_20200730.BIN to the DWIN_SET folder created at step 1 above, and flash that to your display.
22+
2. Verify that the top line on the blue flash screen is now overwritten in red confirming that DGUS2 v3.5 is flashed
23+
3. Optionally repeat step 1 with an empty DWIN_SET folder, to confirm v3.5 is now the DGUS2 OS
24+
25+
26+
# Here is how to interpret what you see:
27+
28+
The top line of the blue boot screen always identifies the current DGUS2 OS in white text.
29+
30+
If the DWIN_SET folder being flashed contains a DGUS kernel BIN file, the top line is overwritten in RED text, reporting the version that has been flashed.
31+
32+
If the two lines are different, it may be difficult to read either line.
33+
34+
If the two lines are identical, the current DWIN_SET folder has reflashed the same kernel to the display.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The following issues have been observed but not resolved, at this DRAFT release:
2+
3+
1. The ABLprocess no longer uses the contents of 35_Autolevel.icl to animate the collection & display of the mesh data. To enable old eyes to read the mesh, the normally white background of the initial screen has been changed to black. As a result, when the process first initializes all of the values to 0.000 in white, those zeroes are now visible to the user, until replaced by the probing process. This will not look familiar to past users of 6.1, but should not be a problem for new users.
4+
5+
IF you find any other issues, please message @Thinkersbluff with the key info. TIA!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Release#: 61F_RC_290422_v1
2+
3+
## NOTE: As of this release, the release# is branded in orange on the load screen and on the Setup->INFO screen. If you do not see this release number on your system, you have not flashed this version of the touchscreen firmware.
4+
5+
# Introduction
6+
7+
## If you are already running CF6.1-Final successfully on your printer
8+
9+
There is no reason to flash this re-factored firmware. You can ignore this release.
10+
11+
## Background
12+
13+
The CF6.1 touch screen firmware was designed and distributed to run on the DGUS2 v3.5 operating system.
14+
15+
Creality has now begun delivering the CR6 printers running a more recent version of DGUS2 (v4.5, at the time of this release.)
16+
17+
DGUS2 v4.5+ requires a different calibration of the display screen to run than did v3.5.
18+
19+
Following the CF6.1 installation instructions to flash v3.5 with CF6.1 to these newer printers will cause the v4.5 screen calibration to be invalid. That results in the touchscreen becoming non-responsive to CF6.1. Reverting to Creality stock also then fails, until the DGUS2 v4.5 kernel is restored to the display.
20+
21+
This re-factored version of the firmware will operate correctly on all CR6 printers flashed with DGUS2 OS version 2.0 or higher, as long as:
22+
1. The motherboard has also been flashed with the correct configuration of CF6.1-Final firmware
23+
24+
2. The display hardware has already been calibrated to operate with the version of DGUS2 (2.0 or higher) that is installed on the display.
25+
26+
27+
28+
# Recommendations for using this firmware
29+
## _PLEASE read all of these recommendations, before following any of them._
30+
31+
**NOTE: As always, flashing this firmware to your system is done entirely at your own risk. The CR-6 Community firmware developers take no responsibility for any consequences of flashing this firmware to your system.**
32+
33+
34+
35+
**STEP1 - BEFORE ACTING ON ANY OF THE FOLLOWING RECOMMENDATIONS:**
36+
1. Create an EMPTY folder at the root directory of an EMPTY micro SD card.
37+
2. Ensure that your printer power is OFF
38+
3. Place that SD card in your display and cycle power ON
39+
4. The top line of the display will report which version of DGUS2 is currently flashed .
40+
4. Make note of which DGUS version is currently flashed to your display hardware (see top line on display)
41+
5. Take care to follow the applicable instructions below.
42+
43+
44+
### If you are currently running Creality stock firmware on your system, and your display is currently running DGUS2 v4.5+
45+
46+
Flash this touchscreen firmware INSTEAD of the CF6.1-Final touchscreen firmware.
47+
48+
1. Ignore the Touchscreen firmware folder in the CF6.1-Final release zip file.
49+
50+
2. INSTEAD, copy the DWIN_SET folder and contents from this release to the micro-SD card you use to flash the display
51+
52+
3. DO NOT copy ANY DGUS2 kernel upgrade files to the DWIN_SET folder before flashing it to your display.
53+
54+
### If you are currently running Creality stock firmware on your system, and your display is currently running any version of DGUS2 between v2.0 and v4.0 (e.g. v3.5)
55+
56+
EITHER: Go ahead and flash the CF6.1 TouchScreen Firmware to your system, following the CF6.1 Touchscreen Firmware README instructions precisely
57+
58+
OR:
59+
60+
Do exactly the same thing as recommended above for the v4.5 users:
61+
1. Ignore the Touchscreen firmware folder in the CF6.1-Final release zip file.
62+
63+
2. INSTEAD, copy the DWIN_SET folder and contents from this release to the micro-SD card you use to flash the display
64+
65+
3. DO NOT copy ANY DGUS2 kernel upgrade files to the DWIN_SET folder before flashing it to your display.
66+
67+
### If you already flashed the CF6.1-Final touchscreen firmware to your display hardware, your display is now running DGUS2 v3.5, and your display is non-responsive
68+
69+
You can flash this re-factored version of the CF6.1 UI to your display and restore the display to running DGUS2 to v4.5, as follows:
70+
71+
1. Delete the DWIN_SET folder from the SD card with which you previously flashed your display. (Make sure you keep a copy, just in case!) OR prepare a new blank micro SD card.
72+
2. Copy the new DWIN_SET folder distributed in this release to that SD card
73+
3. Copy T5L_UI_DGUS2_V45_20220105.BIN from the DGUS2 kernel upgrade files folder into the new DWIN_SET folder on that card
74+
4. Re-flash your display with the updated card
75+
5. Verify that the top line of the display shows the DGUS2 v4.5 OS was flashed as part of the process (it will be written in red text over the top of white text that said v3.5)
76+
6. Power off the printer
77+
7. Remove the SD card from the display and power it back up
78+
8. The CF6.1 interface should now work correctly
79+
9. Repeating the empty DWIN_SET folder trick described as STEP 1 above will allow you to confirm with confidence that DGUS2 v4.5 is now flashed to the display
80+
81+
## Instructions for Reverting a Display to the Creality Stock Firmware
82+
83+
### If you flashed the CF6.1 firmware and the DGUS v3.5 kernel upgrade files to a DWIN display that was previously configured to run on DGUS2 v4.5 and just want to revert to stock, rather than flashing this firmware release
84+
85+
1. Copy the T5L_UI_DGUS2_V45_20220105.BIN kernel upgrade file into the Creality DWIN_SET folder.
86+
2. Re-flash that DWIN_SET to your display.
87+
3. Re-flash the stock Creality firmware to the motherboard
88+
89+
The printer will now have been reverted to the Creality stock firmware.
90+
91+
### If you successfully flashed CF6.1 or this release to a DWIN display without flashing any DGUS kernel upgrade files to that display, but now wish to revert to the Creality stock firmware
92+
93+
Flash the stock Creality firmware back to the motherboard and the display, per Creality's instructions.
94+
95+
## Instructions for reverting from this re-factored version BACK to the CF6.1-Final TouchScreen Firmware on a display running DGUS2 v3.5
96+
97+
Follow the flashing instructions in the CF6.1-Final Touchscreen firmware README file.
98+
99+
100+
101+

0 commit comments

Comments
 (0)