STM32 TFT library (PB3 and PB4 problem)

Post here all questions related to LibMaple core if you can't find a relevant section!
Post Reply
Posts: 2
Joined: Fri Mar 27, 2020 12:28 pm

STM32 TFT library (PB3 and PB4 problem)

Post by BinaryPentode »

I'm trying to program STM32F103C8T6 in popular cheap oscilloscope DSO138 with custom software further "custom software". As I am struggling to do it, I am currently fighting with following issue:

Adapted Adafruit TFT display library ... 8bit_STM32 doesn't work. I'm able to load simple programs by Serial to STM32 using STM32duino. My current target is to get the display working in any fashion. However using said library I cannot make TFT work (I tried both library example test file and simple display function from said DSO custom software)

Here are probable issues behind that:

First, in the library description it is said "The four control pins must all be one output register". However, in the DSO schematic ... 13802k.pdfit is visible that those pins are PB10, PC13, PC14, PC15 (so for my understanding, from both B and C registers).

Second possibility: when loading simple programs (Blink) PB3 and PB4 pins aren't working. They are used for debug mode. There are solutions how to change that when building bootloader from scratch ... _3746.html and also solution like this (I don't understand it fully).

I flashed a few bootloaders at random (and simple serial programming or even USB programming worked), but I'm not closer to solving the issue.

Important note is the custom software surely worked at one point in the past (seeing different forums on the Internet), however I failed to find any detailed walkthroughs. Also the jyetech hex file loaded and worked on the DSO every time I checked (after applying changes), so I'm sure the board is operational.

If I ever complete that project I'll probably document it in some way, as I'm finding this process vaguely described on the Internet.

If this is a wrong place for such topic, I will be eternally grateful for recommending site where I can get the answers.
Posts: 476
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany

Re: STM32 TFT library (PB3 and PB4 problem)

Post by stevestrong »

The TFT library needs to have adapted LCD pins to your hw setup.
I see that your project uses the data pins PB0..PB7. That correspond to the lib setup.

For the control pins RD, WR, CS, you can define ctrlRegs1 for port B and ctrlRegs2 for post C control pins, and adapt the defines here and here accordingly.

For a starting test, you can define SLOW_WRITE to 1 to see if it works.

But be aware, this lib is only tested with the Libmaple (aka Roger's or my) core.

PB3 and PB4 will work if you call early in setup:

Code: Select all

enableDebugPorts(); // if you want to debug
disableDebugPorts(); // no debug, but will free up PA13 and PA14, too
Post Reply

Return to “General discussion”