-
Notifications
You must be signed in to change notification settings - Fork 17
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
STM32-Compatibility: Hanging at I2C #7
Comments
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: 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. |
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. |
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 |
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. |
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! |
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 ;) |
Hi @ReanimatorRX did you have any success so far? |
@pysco68 @ReanimatorRX 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... |
Hi |
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? |
Hi ReanimatorRX ! This is compiled *.bin : |
To pysco68: |
How invert x coordinates moves, please ? |
Hi promzona1 |
How did you compile the bin file? |
for Windows: |
Compiled *.bin from your *.elf : |
Hi pysco68 ! UPD:
|
Thanks all for help!
At this point you get well adjusted screen but X for the touch was swapped. I not try recompile firmware. sudo apt-get install xserver-xorg-input-evdev edit /usr/share/X11/xorg.conf.d/45-evdev.conf Section "InputClass" Reboot. Now all work fine!!! |
in my card ,I use x11,/usr/share/X11/xorg.conf.d/10-evdev.conf notwork in my card |
Hey,
I tried to get this running on my display, but I'm seeing a little problem...
My display seems to be identical to yours but has an original STM32 controller instead of the GD32 controller, I replaced everything that seemed to be controller-specific and I got the code to run, but it seems to hang at the following piece of code:
If I disable the gt811 code completely I'm seeing a usb device, so it seems to be running fine except for I2C communication.
After attaching a logic analyzer I can see that it transfers the first I2C packet but stops afterwards, SDA and SCL never seem to change state again, clearing flags and removing the while loop doesn't seem to work either, at the next transmit it just hangs.
I don't have much hope, but do you by any chance have an idea of what may be going wrong? I tried searching for this problem online but I didn't really find much useful information...
The text was updated successfully, but these errors were encountered: