Comments (22)
Hi Lukas,
The STM32 and GD32 behave a tad differently when it comes to I2C. In fact the STM32s I2C peripheral can be called "weird" - and that's a nice term.
I don't have a device to hand to tell you exactly what to modify; but here's the app note from ST concerning the errata: http://www.st.com/content/ccc/resource/technical/document/application_note/5d/ae/a3/6f/08/69/4e/9b/CD00209826.pdf/files/CD00209826.pdf/jcr:content/translations/en.CD00209826.pdf
Here's a bit of code that I know to work:
https://github.com/geoffreymbrown/STM32-Template/blob/master/Library/i2c.c
You'll see that part with 1 byte, 2 bytes and N bytes being transferred, including the irq handling and (STOP) signal generation stuff going on in between.
from waveshare-hid.
Hi Lukas,
did you manage anything on this issue?
Btw. what screen is it exactly? It's weird to have the original STM32 on the Chinese' screen. It costs nearly twice as much as the GD32F1 in 1k quantities.
from waveshare-hid.
Hey,
I didn't really find the time to experiment some more, but thanks for your reply, will try to get it working soon.
This seems to be a genuine "7inch HDMI LCD (B)" (rev1.1) by Waveshare, got it via Amazon, here are some pictures of the PCB:
Also on my board the readout-protect bits weren't set, I got a full firmware dump: original_firmware.zip
from waveshare-hid.
I tried a few more things (including copying code 1:1 from other repos) but I just can't get the I2C to work, always hangs at sending the address, not sure what's going on...
Since other people seem to have I2C working with the chip maybe it's a problem with my version of libopencm3 or with my compiler or whatever, don't really want to test all that, I already wasted way too many hours trying to get this touchscreen to work...
I'm hoping that maybe somebody else will get this to work and share their solution.
from waveshare-hid.
Hello Lukas,
sad to hear you didn't find a way through this. I think we should keep the issue open. Eventually somebody will contribute ;)
Thank you for your efforts nonetheless!
from waveshare-hid.
Hi
I tried to get this running on my display, but did not work out
My display seems to be similar to yours but has an original STM32 controller instead of the GD32
from waveshare-hid.
Hi @ReanimatorRX on first sight your display looks fairly similar (although I can't see the SWD port anywhere). As I told Lukas, the issue is to be found within the I2C routine(s), as per the errata sheet. If you feel courageous enough, give it a try. There's not much you can do that's really wrong ;) (in the way that if you don't change the IO pin mapping or do some crazy stuff I don't think you can damage any of the chips).
It would be awesome if someone manages to get that running ;)
from waveshare-hid.
from waveshare-hid.
Hi @ReanimatorRX did you have any success so far?
from waveshare-hid.
@pysco68 @ReanimatorRX
I have the same board and issue. Close inspection shows the GT811 to be connected to I2C1 and not I2C2. I tried changing the code but no luck (no clock on the SCL pin... ) My first experience with ARM / STM32 so I am still learning about the peripheral setup.
However the pin mapping is weird!
It seems
GT811 INT > PB7 I2C1_SDA
GT811 SDA > PB6 I2C1_SCL (with 10k pullup)
GT811 SCL > PB5 I2C1_SMBAI (with 10k pullup)
What is I2C1_SMBAI ?! I can't find much reference... and why this wiring scheme?
I may try a hardware mod to connect to I2C2 just to check the code is working...
from waveshare-hid.
Hi
Can you make and send me already compiled file please (bin file)?
from waveshare-hid.
Hi @ReanimatorRX I'm currently on vacation. I don't have access to my dev machine, so I can't send you anything. Do you have issues getting the stuff compiled on your own?
from waveshare-hid.
Hi ReanimatorRX !
This is compiled *.elf :
main.zip
This is compiled *.bin :
main-bin.zip
from waveshare-hid.
To pysco68:
You are a genius ! )
I flashed v 1.1 (Waveshare 7 LCD (B))
Previously, the touch did not work in Raspberry Pi. Now works without drivers.
Excellent !
Huge gratitude !
It remains to understand how to invert the coordinates of x. The mouse moves in the opposite direction from the finger. ))
from waveshare-hid.
How invert x coordinates moves, please ?
from waveshare-hid.
Hi promzona1
I flashed main-bin
I'm not seeing a usb device
main.zip
my elf file
from waveshare-hid.
How did you compile the bin file?
from waveshare-hid.
for Windows:
download toolkit:
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
compiler command:
arm-none-eabi-objcopy.exe -O binary main.elf main.bin
and flashed *.bin from Windows STM32 tool:
from waveshare-hid.
Compiled *.bin from your *.elf :
main.zip
from waveshare-hid.
Hi pysco68 !
How inverted X coordinates in you gt811.c ?
After the flashing, my X coordinates are inverted and the pointer is displayed and moves in a mirror.
Y coordinates is OK.
UPD:
I do not understand anything in C, but I did it by analogy with "inverted_y".
Strangely enough, but it works correctly )))
// NOTE: apparently the waveshare touch digitizer was mounted
// mirrored in both directions, this means we "flip" X <-> Y
// coordinates AND we have to mirror the Y axis
x_value = data[offsetData + 5] + (data[offsetData + 4] << 8);
inverted_x = 800 - x_value;
// byte[4] X coordinate LSB
hid_report->report[4] = inverted_x & 0xFF;
// byte[5] X coordinate MSB
hid_report->report[5] = (inverted_x & 0xFF00) >> 8;
from waveshare-hid.
from waveshare-hid.
Thanks all for help!
I successfully flashed Waveshare 7inch HDMI LCD (B) 800x480 v1.1.
I took .bin file from promzona1 post and flashed with ST-link V2 under Windows.
Chip on my board is GD32F103.
I using display in 1024x600 mode with RaspberryPi.
/boot/config.txt
disable_overscan=1
overscan_right=225 // these may be different
overscan_bottom=105 // these may be different
framebuffer_width=1024
framebuffer_height=600
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=87
max_usb_current=1
hdmi_cvt 1024 600 60 0 0 0 0
hdmi_drive=1
At this point you get well adjusted screen but X for the touch was swapped. I not try recompile firmware.
Install evdev.
sudo apt-get install xserver-xorg-input-evdev
sudo mv /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
edit /usr/share/X11/xorg.conf.d/45-evdev.conf
Section "InputClass"
Identifier "evdev touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "InvertX" "true"
EndSection
Reboot.
Now all work fine!!!
from waveshare-hid.
Related Issues (12)
- Question on "Finger" events HOT 5
- Touch to screen without USB connection cause firmware failure. HOT 5
- cant program stm32f1xx HOT 1
- My board has a genuine STM32 (I think) and is bricked after upload HOT 2
- Add binary release HOT 17
- Does your program work at WIN7/WIN8 ? HOT 1
- waveshare-5inch HDMI LCD (B)-Resistive touchscreen for win10 HOT 4
- hello, I am trying your firmare BUT how can I get arm-none-eabi-gcc (15:4.9.3+svn231177-1) ? HOT 2
- Waveshare LCD(C) support HOT 4
- A false event, when long pressing the button. HOT 9
- Setting touch sensitivity possible? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from waveshare-hid.