Skip to content

Commit 763a12e

Browse files
Add Tools directory and files to Feat/dwin nextgen support (#68)
* Support for newer DWIN hardware by @InsanityAutomation * Create Tools directory The link to the DGUS tools used to build versions 5, 6 and 6.1 of this firmware are no longer available at the link provided in the ReadMe file. Rather than risk losing the ability to repair existing screens, and potentially losing the tools to be used to build fuure releases, this directory shall hold an archived copy of each toolset used to build and maintain all display firmware on this project. * Adds archived (7z) files containing the DGUS tools DGUS Toolv8.0 was used to build and maintain versions 5 and 6 of the Community display firmware. DGUS Tool v8.2 will be used to build and maintain the Community display firmware after version 6.1-Final. It is too large to store as a single file in GitHub, so it has been split into two files. Download and recombine those two files with 7zip. * Thinkersbluff Update - 20 Apr 22 These files flash correctly to my CR6-SE and run on DGUS2 v4.0 Fastboot. (See Known Issues text file for an explanation of the two issues that remain in this DRAFT.) * Thinkersbluff Update - 20 Apr 22 These files flash correctly to my CR6-SE and run on DGUS2 v4.0 Fastboot. (See Known Issues text file for an explanation of the two issues that remain in this DRAFT.) * Delete chinese versions of 13.bin and 14.bin Otherwise, Build flags them as overlapping files. * Do not bundle kernel upgrade in DWIN_SET folder "Upgrading" v4.5 displays to v3.5 has been known to "brick" the display. Better to let the user decide which DGUS kernel to flash when they install the UI. * Add a BUILD folder to DOC GitHub Desktop did not push build as its own folder. Wanted to find a way to capture and post DRAFT builds, to facilitate collaboration without tainting the upstream repository * Corrected folder name Have actually edited/replaced some of the 20 april files in this version. * Update README.md Tailored this file to this particular fork * Update README.md * Rename README.txt to README.md * 23 April DRAFT Known issues include: 11. Upon completion of Filament Load or Unload: - the final message confirming that the process has completed IS NOT displayed 2. The two buttons at the top of the Prepare menu (LED and Sound) are meant to have ON/OFF icons that confirm the currently commanded state of those controls. Neither ICON is appearing. 3. The LED ON/OFF button on the Printing->Tune screen is actually using the Retract Override icons. The button does control the LED, though. * Post 24 April Draft, Update README.MDs Updates the Build folder with the latest DRAFT as of 24 April. Still chasing two "mysteries" 1. The ON/OFF icons are not displaying for LED or Sound. The Tune menu LED icons were 3 & 4 instead of 1 & 2. At least they used to appear. I corrected the icon #'s and regenerated. Now no icons appear when the button is toggled. 2. The Filament Load/Unload Completed message used to appear on the control screen, in miniature text. Now it does not appear at all. * Copied 24 April files to GitHub Overwriting src files to ensure the latest files I am working with are also the ones in this development branch of the repository * Delete T5L_UI_DGSU2_V40_Fast boot_20210917.BIN Removes kernel upgrade file from DWIN_SET folder. Users must install the kernel upgrade file of their own choosing, after reviewing the README.MD and considering their particular situation vis-a-vis display hardware. * Update 24 April DRAFT with corrected ON/OFF toggles for LED and Sound Figured out that the ON/OFF "icons" were actually coded as "Toggles". Pointed those objects to 32_toggles.icl instead of 45_icons.icl & positioned them correctly. Updated Known Issues.txt accordingly. This DRAFT has just two known issues remaining: 1. Upon completion of Filament Load or Unload, the message confirming that the process has completed IS NOT displayed. The M117 message space is instead just blank. 2. 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. This will not look familiar to past users of 6.1, but should not be a problem for new users. * Add v4.5 and v3.5 DGUS kernel files to upgrades folder For convenience of users who wish to experiment. * Update README.md Added bold text to end of Recommendations section. * Update README.md * Update all Project Files to 24 April 2022 DRAFT Update all Project Files to those from which 24 April 2022 DRAFT build was built * Update README.md * Update README.md * Update README.md Fix typo * Update README.md Refined the recommendations and clarified the Example * Update README.md Refined the Background section. * Update README.md * Update README.md * Update README.md Corrected a typo * Update README.md * Update README.md * Update README.md * Update README.md Added a copy of the T5LCFG_Calibrate_Touchscreen.CFG file to the repository and updated these instructions. * Create T5LCFG_Calibrate_Touchscreen.cfg Uploaded a CFG file to use * Update README.md Moved and annotated the DWIN display calibration instructions into their own file, to avoid confusing users with them. * Moved display calibration instructions to their own folder Created a "FOR DEVELOPERS AND TESTERS ONLY" folder, to avoid suggesting to other users that any sort of display calibration is required. These instructions are purely intended to help developers and testers who would like to verify UI functionality under both v3.5 and v4.5+ * Update KNOWN ISSUES.txt Added an observation that the LED ON/OFF button is slightly out of position on the Printing->Tune screen. That will be fixed in the next DRAFT. * Update note on Screen 78 The note says assumes a hot-end capable of 6mm retraction, but the code actually commands 4mm of retraction. A future release will enable users to modify this value by editing the value of G26_RETRACT_MULTIPLIER in Configuration.h. At that point, this note should be reviewed and probably should be revised to whatever value is baked into the released compiled firmware. * Uploading latest nextgen UI firmware The LED ON/OFF button on the Printing->Tune menu has now been nudged to the correct location. The M117 Scrolling Text field is not displaying messages on the screen, but I have not yet deduced the why not. One way to solve the problem may be to ensure that all messages are less than 29 characters in length, which will then be displayed to the M117 Static text field. * Uploaded Release Candidate dated 26 April 2022 Solved the scrolling message problem, after reviewing this YouTube DWIN tutorial: https://www.youtube.com/watch?v=7Zd0995evaU * Uploading source files for 26 April 2022 Release Candidate * Remove DRAFT builds Not needed in the PR * Split the README into basic instructions + a Troubleshooting File I think this covers the rest of your request. * Add units to Setup->Temperature->Bed Temperature field Units character field was blank. The Units text was instead in the Boot Text field. Moved 'C to the units character field and changed the Boot Text to 0. * Update 26 April Release Candidate to v2 Added 'C to Bed Temperature field on screen#48 Updated 13.bin, 14.bin, 22.bin in DWIN_SET. Renamed folder for 26 April 2022 Release Candidate to add " v2" * Update README.md Elaborated the credits section to emphasize the foundational role of the core CR6 Community FIrmware dev team. * Create RefactoredCF6.1TouchscreenFirmware-RC_26042022_v2.zip * Update README.md Incorporates review feedback * Update README.md Co-authored-by: Sebastiaan Dammann <[email protected]>
1 parent 2fe1497 commit 763a12e

File tree

624 files changed

+389
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

624 files changed

+389
-175
lines changed

README.md

+23-138
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,40 @@
1-
# CR-6 Touchscreen software
2-
Attempt to extend the CR-6 touch screen software. This repository belongs to the [forked Marlin firmware repository](https://github.com/CR6Community/Marlin/).
1+
# CR-6 Touchscreen firmware
2+
Attempt to extend the CR-6-touchscreen firmware to operate with DWIN display hardware flashed with and calibrated to run DGUS2 v4.5 or higher, such as those being sold with new CR6 machines as of approximately Dec 2021.
33

4-
## Downloads
5-
6-
Please find official releases in the [Releases section](https://github.com/CR6Community/CR-6-touchscreen/releases). Take the release which belongs to the particular firmware you are going to flash.
4+
**NOTE: The June 2021 release of the CF6.1 Touchscreen firmware remains valid for use on all CR6 printers currently running and calibrated for DGUS2 v3.5.**
75

8-
Ensure you take the right assets: the `CR-6-touchscreen-[date].zip`. You should not download the `Source code` archive if you are downloading with the purpose of flashing your LCD.
6+
**To find out which version of DGUS2 is running on your display, "flash" your display with a micro SD card that contains ONLY an EMPTY folder named DWIN_SET. The top line on the blue screen will display the current DGUS2 version.**
97

108
*If you have [a BTT SKR board with the BTT TFT](https://damsteen.nl/blog/2020/11/25/how-to-btt-skr-cr6-installation) you do not need this firmware. This firmware is only for when you use the stock Creality LCD with the stock or BTT motherboard.*
119

12-
## Contributing
13-
14-
We are open for contributions. **Please open an issue in the issue tracker first before you start work on a pull request.**
15-
16-
The reason for this is that the DWIN project is not friendly for source control and any files cannot be merged (all binary). So, using our Discord server, we synchronize who is working on the files to prevent conflicts.
17-
18-
### Translations / localization
19-
20-
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.
21-
22-
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.
23-
24-
The complete workflow would look like this:
25-
26-
1. Fork this repository.
27-
2. Work on the extui branch (this is the branch for all work going forward)
28-
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.
29-
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.
30-
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.
31-
32-
Good luck, and if you maintain your own translated firmware, please let us know!
33-
34-
## Documentation for development
35-
36-
You need the [DGUS v8.0.x software](http://dwin.com.cn/home/Index/download_file?download_id=4796) for editing the touch screen.
37-
38-
You can open the .dgus project file in the [`src\DWIN`](src\DWIN) folder:
39-
40-
![DGUS II interface](doc/dgus2util.png)
41-
42-
### Build firmware archive
43-
44-
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.
45-
46-
For development you can run the build script as follows:
47-
48-
```pwsh
49-
.\build -Deploy Q:
50-
```
51-
52-
Where Q: is the path of your flash drive with the SD card.
53-
54-
You need to have Powershell Core installed (pwsh).
55-
56-
### Images / screen images sources
57-
58-
You can find the source files where the screen bitmaps are generated from in the [`src\images_src`](src\images_src) folder.
59-
60-
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.
61-
62-
#### Updating the touch screen firmware files
63-
64-
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.
65-
66-
Next, re-generate the `23_Screen.icl` ICL file are follows:
67-
68-
![Update ICL file](doc/update-screen-icl.gif)
69-
70-
Things worthy of note:
71-
72-
- Quality is set to 100%, followed by pressing the "Set all" button to apply it to each import file.
73-
- The `DWIN_SOURCE` is used as a source for generating the ICL.
74-
- The ICL is saved twice: once in the `DWIN_SOURCE` folder, once in the `DWIN_SET` folder.
75-
76-
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).
77-
78-
For icon ICL generation the process is the same, except that you pick the icons from a subdirectory of `DWIN_SOURCE`.
79-
80-
### Flash space
81-
82-
DWIN uses a specific set-up of the flash space as described in the manual - as shown below.
83-
84-
![DWIN flash space](doc/flash-space.png)
85-
86-
Essentially what it boils down to:
87-
88-
- The flash space is divided into 256KB sectors
89-
- The number prefix on the ICL/HZK/BIN file name is the sector number where the file is flashed
90-
- A sector can only contain a single file
91-
- A file can span over multiple sectors, and if a file needs 1½ sectors for instance, it will allocate 2 sectors.
92-
- There is no protection against sector overwriting: if you have files overlap sectors, DWIN will happily flash the next file over the previous file
93-
94-
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.
95-
96-
During build a script will run to make sure no sectors have been overallocated. You can also run this script manually.
97-
98-
![DWIN sector allocation check script](doc/sector-allocation-check.png)
99-
100-
### How buttons are handled with code
101-
102-
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:
103-
104-
![DWIN button-code correlation](doc/button_type.png)
105-
106-
For buttons:
107-
108-
- Virtual Pointers for buttons are defined in `extui/lib/dgus_creality/DGUSDisplayDef.h`
109-
- In `extui/lib/dgus_creality/DGUSDisplayDef.cpp` in the `ListOfVP` the Virtual Pointer are connected to a callback handler
110-
- 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`
111-
- For legacy VPs handlers are defined per page in `extui/lib/dgus_creality/PageHandlers.cpp`
112-
- The "Key Data" is used to distinguish between the actual key pressed and passed to these functions as `buttonValue`
113-
114-
For dynamic updatable values:
115-
116-
- 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
117-
- The Virtual Pointers are defined in `extui/lib/dgus_creality/DGUSDisplayDef.h`
118-
- Per dynamically updated virtual pointer there is in `extui/lib/dgus_creality/DGUSDisplayDef.cpp`:
119-
- A registration in `ListOfVP`, with:
120-
- The VP ID
121-
- A pointer to the memory location to read the value from in Marlin (can be `nullptr`)
122-
- A callback that is triggered when the VP changed in the display and is pushed to firmware
123-
- 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.
124-
- 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.
125-
- Some values like the M117 text are transient and are pushed directly to the display, but are still present in the `ListOfVP`
126-
127-
#### Previous version of the code
128-
129-
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.
130-
131-
### Touch screen configuration
132-
133-
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.
134-
135-
### Fonts
10+
## Downloads
13611

137-
Font's are currently configured like below:
12+
When code is ready for users to experiment with, the Source and zip files are posted as Assets in the Releases section of this repository.
13813

139-
![Font Settings](doc/font-settings.png)
14+
* Zip files with "ReleaseCandidate" in their name are ready to download for beta test and feedback.
14015

141-
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.
142-
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.
16+
* Zip files with "Source" in their name are the DGUS project and source files for this project.
14317

144-
### Other documentation
18+
## Installing This Firmware to your Touchscreen
19+
1. Download the applicable .zip file from the Releases Assets list
20+
2. Extract all contents from the .zip file into a new blank directory
21+
3. Find and read ALL of the README files BEFORE attempting to flash your display (You'll be glad you did!)
22+
4. Figure-out which DGUS 2 is presently running on your display
23+
5. Flash the other DGUS2 kernel ONLY if you should (per the README in the kernel upgrades folder)
24+
6. Verify that you have satisfied all of the Pre-Requisites for flashing this firmware (Which you will know after reading the README files...)
25+
7. Flash your display with the DWIN_SET folder
26+
8. If anything went wrong, try the TROUBLESHOOTING.MD instructions
27+
9. Please provide feedback in Comments or Issues, as applicable
14528

146-
Vendor documentation is mirrored to the [doc/vendor](doc/vendor) folder.
29+
## Contributing
14730

148-
In addition, [this is a nice resource](https://github.com/rubienr/MarlinDgusResources/tree/creality-ender-5-plus/projects).
31+
If you wish to contribute to the project, please provide your inputs by raising a new Issue or by commenting on an Open Issue on this repository, and/or by contributing to the discussion on the [CR6Community Discord #lcd-discussion channel](https://discord.gg/yDY6pb2BQS)
14932

15033
## Credits
15134

152-
[The core CR-6 Community firmware dev team](https://github.com/CR6Community/Marlin#credits)
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.
36+
37+
[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.
15338

15439
Icons from [Font Awesome](https://fontawesome.com/) and [Remix Icon](https://remixicon.com/).
15540

Tools/.gitkeep

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Create Tools directory, to hold and preserve the DGUS toolsets used to build and maintain this display firmware.

Tools/DGUS_TOOL_V8.0.1.1.zip

21.8 MB
Binary file not shown.

Tools/DGUS_Tool_V8.2.1.14.7z.001

20 MB
Binary file not shown.

Tools/DGUS_Tool_V8.2.1.14.7z.002

11.2 MB
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.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## FOR COMMUNITY FIRMWARE DEVELOPERS AND TESTERS ONLY: Instructions for Calibrating the DWIN Display Hardware
2+
3+
**CAUTION - DWIN display calibration is definitely NOT NECESSARY TO INSTALL OR RUN THIS FIRMWARE and NOT for the faint-hearted. DWIN warn that you can brick your display, if you don't do this correctly. These instructions are included FOR TESTERS ONLY**
4+
5+
DWIN display calibration is normally done at the factory & should not need to be done again by the user.
6+
7+
If, however, you wish to re-calibrate your display hardware (e.g. to enable changing the DGUS2 OS from v3.5 to v4.5 or higher OR to revert from v4.5 back to v3.5), you do this at your own risk.
8+
9+
**Our Discord Community member @ScratchFury has posted this YouTube video of this process, to go from DGUS2 v3.5 to v4.5+: https://youtu.be/oaiXSls1NXs**
10+
To revert your display from v4.5+ back to v3.5 requires a similar configuration process. What differs is that you need to flash the v3.5 kernel upgrade files with the T5LCFG_Calibrate_Touchscreen.CFG file, at step 0 (or step 3)
11+
12+
The process is as follows:
13+
14+
0. Ensure that your display is already flashed with the DGUS2 version that you wish to calibrate. (OR include the applicable kernel file in DWIN_SET with the T5LCFG_Calibrate_Touchscreen.CFG file)
15+
16+
1. [Optionally] You can use any Hex editor program to view and edit a copy of the T5LCFG_272480.CFG to create your own copy of T5LCFG_Calibrate_Touchscreen.CFG, by making the following three edits to that file:
17+
18+
1.1 Change the contents of address 0x05 to 38
19+
20+
1.2 Change the contents of address 0x20 to 5a
21+
22+
1.3 Change the contents of address 0x21 to 0b
23+
24+
Alternatively - Download and open T5LCFG_Calibrate_Touchscreen.CFG from this repository in a HEX editor
25+
26+
The resulting file should look like this, in the HEX editor:
27+
28+
![image](https://user-images.githubusercontent.com/36551518/165141828-cffbc04c-117e-4b0d-8958-bf83b1f37e03.png)
29+
30+
2. Save the modified file as T5LCFG_Calibrate_Touchscreen.CFG.
31+
32+
3. To activate the calibration screen on your display, put T5LCFG_Calibrate_Touchscreen.CFG into a folder called DWIN_SET on your SD card (IMPORTANT: Make sure it is the ONLY CFG file in the DWIN_SET folder)
33+
34+
4. Flash T5LCFG_Calibrate_Touchscreen.CFG to your display
35+
5. Cycle power off/on
36+
6. The screen displays coloured noise on this first power-up. Keep the faith.
37+
7. Cycle power off/on
38+
8. The screen now displays a series of five crosses as you perform the calibration routine. Your goal is to tap the pixel at the center of each cross (use a stylus for best results)
39+
9. When you have tapped all 5 crosses, power off the display.
40+
10. Delete the DWIN_SET folder from the SD card
41+
11. Copy/paste the DWIN_SET folder from this repository onto the SD card.
42+
12. Flash this DWIN_SET to your display.
43+
13. Cycle power off/on
44+
14. Same as step 6 above.
45+
15. Same as step 7 above
46+
16. The screen should now display the CF6.1 UI and all should be well.
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!

0 commit comments

Comments
 (0)