-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
Add support for TFT and touch screens #18130
Add support for TFT and touch screens #18130
Conversation
Fix compilation errors for STM32F103 with HAL STM32
Add support for 320x240 TFT with touch screen TFT screen can be connected to 16-bit FSMC or dedicated SPI interface Low-level IO implemented for HAL STM32 only
What board would I build for to enable this? I'd like to hack around with the Ledge and Chitu boards to see if I can get their LCDs running with it. |
Build environment is defined in extra_config.ini Board pins are defined in pins_custom.h Check that BEEPER_PIN is disabled in your configuration. |
…into tft_and_touch_screen
@xC0000005 Build environments. USB and SD are disabled to avoid some configuration problems I did not have time to look at.
|
I have a lerdge board I can test this on - it’s an STM32F4 board, so we’ll see how it works.
… On Jun 3, 2020, at 11:58 AM, Alexander Gavrilenko ***@***.***> wrote:
@xC0000005 <https://github.com/xC0000005>
I've added support for STM32F4 in Vx and Zx variants.
Tested on black STM32F407VE and STM32F407ZE boards with ILI9341 display.
Touch works in both SPI and software SPI modes.
This probably means that code will work on F103Vx, but I no hardware to test it.
Build environments. USB and SD are disabled to avoid some configuration problems I did not have time to look at.
[env:black_STM32F407ZE]
platform = ststm32
board = black_f407ze
framework = arduino
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
build_flags = ${common.build_flags} -DARDUINO_ARCH_STM32 -IMarlin/src/HAL/STM32
-DTARGET_STM32F4 -DARDUINO_BLACK_F407ZE
-DMOTHERBOARD=BOARD_CUSTOM -DDISABLE_GENERIC_SERIALUSB
-DHAL_SRAM_MODULE_ENABLED
-DHAS_GRAPHICAL_TFT -DHAS_FSMC_TFT -DTFT_320x240 -DTOUCH_SCREEN
-DULTIPANEL -DLCD_HEIGHT=6
-DNO_LCD_REINIT
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
lib_deps =
[env:black_STM32F407VE]
platform = ststm32
board = black_f407ve
framework = arduino
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
build_flags = ${common.build_flags} -DARDUINO_ARCH_STM32 -IMarlin/src/HAL/STM32
-DTARGET_STM32F4 -DARDUINO_BLACK_F407VE
-DMOTHERBOARD=BOARD_CUSTOM -DDISABLE_GENERIC_SERIALUSB
-DHAL_SRAM_MODULE_ENABLED
-DHAS_GRAPHICAL_TFT -DHAS_FSMC_TFT -DTFT_320x240 -DTOUCH_SCREEN
-DULTIPANEL -DLCD_HEIGHT=6
-DNO_LCD_REINIT
build_unflags = -std=gnu++11
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
lib_deps =
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#18130 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHVGS4LJIBKL2FUDGPWRFPTRU2MNNANCNFSM4NL5RR6A>.
|
So far there's no place where |
Yes, this is my 'top 3' list
|
*/ | ||
|
||
#include "tft_image.h" | ||
#include "cstddef" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This include is breaking arduino builds on my build actions.
/home/jeffe/Downloads/arduino-1.8.13/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_RAMBO -DARDUINO_ARCH_AVR -I/home/jeffe/Downloads/arduino-1.8.13/hardware/arduino/avr/cores/arduino -I/home/jeffe/.arduino15/packages/rambo/hardware/avr/1.0.1/variants/rambo /tmp/arduino_build_926809/sketch/src/lcd/tft/tft_image.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for cstddef: []
ResolveLibrary(cstddef)
-> candidates: []
/tmp/arduino_build_926809/sketch/src/lcd/tft/tft_image.cpp:24:10: fatal error: cstddef: No such file or directory
#include "cstddef"
^~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board RAMBo.
It is building in platformio. But not with arduino.
I'm still trying to figure out where my repo fits into all of this, and the best way to get tests upstream. But I figured I should point this out now, while this merge is fresh.
Hi. I used the code from the PR to help Mr. Nelson with testing and porting Marlin to the Lerdge-S board. (His codebase: https://github.com/xC0000005/Marlin/tree/LerdgePlusLCD) Today, I migrated my configuration to the latest bugfix codebase. With the older code (https://github.com/mapfde/Marlin/tree/xC0000005-LerdgePlusLCD), the TFT image was fine and clear, with the latest bugfix, there is a pattern of thin vertical shade stripes on the display overlaying the image. TFT and touch both work, so it is purely cosmetical, but still irritating. |
Ported to STM32F1 :-) |
Hello Team, Marlin\src\HAL\STM32\HAL_SPI.cpp:136:8: error: #error "SS_PIN not defined!" |
If I try to use the mks_robin build it completes but the touch screen doesn't work. |
This UI is widely supported by a variety of boards and TFT, including LPC lately. |
Hello Victor,
Thank you so much for the reply. I am using the latest bug fix version of Marlin.
I have had ongoing issues with trying to get my touchscreen to work with Marlin, regardless of the version. I have a MKS_Robin TFT v1.0.
I will try the discord marlin server and see if I can get help there.
I rarely get replies on the Facebook group and when I do they are rarely of any technical value. I guess my controller / screen is too old to have many people using it.
The only reliable help has been from jmz52 but I have not had any replies from him either.
I just don’t know how to work within the code to get my issues resolved. I should have just stayed using the classic Marlin interface with my touch screen and not try the new graphical interface and now I don’t even seem to be able to revert back.
Thanks for the direction,
Matt
|
I finally found the issue.
I didn’t know I needed this line at the beginning of the configuration.h file. I wouldn't even know where to go to get help for an issue like this no one seems to know except developers.
#define CONFIG_EXAMPLES_DIR "Mks/Robin"
There is nothing to say I need it. It would be nice if it was there by default and then it could be uncommented or completed to activate it.
I found someone had posted a config files on one of the branches of the TFT usage for MKS Robin and other stuff. I added this line to my file and it worked. The poster had an older configuration_adv.h file so I had to change one definition and now everything works great and I have my printer back. It would be nice if the developers would put more explanation in the config files and not assume we are all hackers. It is very difficult to use the Facebook group as they have never been of help even if I could get someone to answer.
I have the new Marlin GUI which is much nicer than the 4 buttons at the bottom of the page but it would be nice to get rid of double tapping on everything to select it and the very text/list driven structure but maybe that is coming.
Regards,
Matt
|
This reverts commit c984003.
// Timer Definitions (optional) | ||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin | ||
#define TIMER_TONE TIM3 | ||
#define TIMER_SERVO TIM2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmz52, @rhapsodyv — Do you have any recollections why we specified these timers instead of 6 and 7 ? I'm trying to find out more for the benefit of #22369.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each timer can have one or more capabilities:
- Allow Slave mode
- Trigger source
- Channels
- PWM support
- Combined Channels
- Clock source
- and a few other options
- Nothing of these, just call the IRQ periodically
So, we need to chose timers according with the feature we need to use. It's ok if we use a timer that support PWM for something that don't need PWM (ex: just periodic irq calling), but we may run out of PWM timers if we don't chose wisely.
The thing with TIM6 and TIM7 is that they don't support any special feature: TIM6 and TIM7 are just "periodic callers of the IRQ". So, by the default, the variants try to alloc this two timers for this two things that don't need any special option.
TIM3 and TIM2 support a lot of options, so it's best to keep them free for a FAN or something else (but the PIN must match the timer too).
The change from #22369 seems good, keeping good defaults and moving the customisation (TIM2/TIM3) to build flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i used those to do like the VARIANT_Zx ... which have the same amount of timers... and reduce the differences... Most of specific ones are on RC/RE boards which have less timers and less pins
Description
Add support for TFT and touch screens
Benefits
Marlin can use TFT screen with optional touch panel
Related Issues
#18129