Spark Logic

Hacking the GD32 based ‘Autool X50 OBD2 Monitor and diagnostic Display’

carl0s Wed Apr 11, 2018 5:27 pm

Hi!

I’m Carl

My first project with STM32 will hopefully be to get some code onto this GD32F103 board, and drive the LCD. I first need to figure out what the driver is. It appears to be using 17 pins.. Hopefully the ILI9341.

I will then use this as a screen / controller for my vehicle datalogger that I have already built on an Adafruit Feather M0.

Here’s the thing I want to hack..

Note that the mini-USB on the back here is actually for a vehicle OBD connection, and will be expecting +12v as well as K-Line, L-Line, CAN-Hi/CAN-Lo, etc.. It’s *not* a Mini-USB connection!

(in most web browsers, you can right-click on the images below and choose Open Image in New tab, to view at full resolution).

Image

Image

Image

Image

Image

Replies

RogerClark Wed Apr 11, 2018 9:56 pm

welcome..

I have given up trying to support the GD32 because we found it’s not really compatible with the STM32.
The GD32 is based on the spec for the STM32 but that’s where the similarities end.

Some things work but others don’t.

E.g. SPI didn’t seem to work quite the same. ( possibly some sort of Mode issue)
It did not work with that display.

There are various reasons why it’s not compatible, including use of “reserved” parts of the control registers , which means potentially lots of the GD32 enhanced functionality is not configured by the Core.

Also the program runs in shadow RAM not Flash, so executed considerably faster, which potentially causes timing issues.

I have left the GD32 variant folders in the F1 core, I simply removed the lines from boards.txt which enable the use of that Variant, so you could reinstate those lines.

However if something doesn’t work, you are likely to need to debug it at the hardware level to determine what’s going wrong.
You will also need to try to find some documentation on the GD32 and compare the hardware registers to see what may or may not have been configured

I recall at least a year ago a Russian website, where someone documented at least 20 differences between the GD32 and the STM32,but I susoect its almost impossible to find that information now, unless someone posted a link to this forum when the GD32 was initially launched

carl0s Wed Apr 11, 2018 10:00 pm

Thanks Roger. All very useful! It may be that I just keep the screen. After all, my hunt was simply for a screen that is inside a gauge or housing, that I could use with my almost finished project (on the Adafruit feather m0). But I’m curious to see if I can do anything with the whole MCU part of it now seeing as though it’s in here and already connected to the screen. I’m trying to get the ST Link to talk to it at the moment, but it’s all new to me.

RogerClark Wed Apr 11, 2018 10:27 pm

I think if enough time was spent on the GD32 it could be made to work, but because there were so few GD32 boards available, there was hardly anyone with a board who had the time and skillset to resolve the problems

If you are a whiz with a hot air reflow tool, you could unsolder the GD32 and solder a STM32F103C8 in its place.

However I’ve tried to do that, and ended up pulling tracks of the board and ruining it :-(

Its probably easier to get hold of another ribbon cable connector and a Blue Pill board and use that instead of the MCU board thats in that device.

carl0s Wed Apr 11, 2018 10:49 pm

Hmm. That’s a good shout on the blue pill – given that it’s well supported already.

My other problem is that I don’t really know what this display controller is yet.

I’ve just got OpenOCD talking to this board after tracing out the SWD pins, and.. well.. while I feel like I’ve made some progress (I have no idea what I’m doing really.. I have been able to halt, read registers, and reset the MCU, that’s all), I suppose I was hoping to try simply uploading some pre-built code for a 64-pin stm32f103 that’s connected to a ILI9341 via SPI and see if by some miracle it ran and displayed something on the screen.

OTOH, you’re quite right, I could spend ages trying to reverse engineer this undocumented thing, or I could instead have a proper plan with a blue pill. My time might be better spent now trying to figure out what’s going up/down the flat flex to the TFT LCD. I have a 4 channel scope and one of those cheap fake salae logic analysers so if it’s SPI I should be able to see that.

BTW, I am actually intending to use a slightly different version of this thing in the end. I had been searching high and low for an LCD inside a nice housing, ideally a gauge for a motorbike. 2 line dot matrix lcd would have done, and I was close to giving up. So to find this for 20 quid had been a joy. I’ve had to order the gauge style one from China, so in the meantime, I got this pod style one that I have dismantled, from Amazon. I am pretty sure they will be much the same inside. They have the same system running on them, same button/dial thingy.. supposedly made by the same company.

Image

carl0s Thu Apr 12, 2018 12:03 am

Alll right. I killed it!

I guess mww in OpenOCD was writing to flash…

:)

ahull Thu Apr 12, 2018 7:02 am

If you killed it, you have nothing further to loose :D You can flash whatever code you like to it now. However before you do that, it might be worth attempting to read the original flash (although I suspect it is protected from out prying eyes).

I would start by figuring out which pins the display is on, then flash some of the display demos to it and see if it does anything interesting.

If you do a bit of deep dive google trawling you may even be lucky enough to turn up the original firmware on some obscure Chinese forum, or file sharing site.

madias Thu Apr 12, 2018 8:14 am

[RogerClark – Wed Apr 11, 2018 10:27 pm] –
If you are a whiz with a hot air reflow tool, you could unsolder the GD32 and solder a STM32F103C8 in its place.
However I’ve tried to do that, and ended up pulling tracks of the board and ruining it :-(

Roger: About resolder a Chip:
I successfully resolder (and exchanged) a 1284A from my Melzi printer board with a common DIY store hot air gun (this thing for removing varnish):

  • Wrap all not to resolder parts in tinfoil (several layer, loosely wrapped) only let the chip free.
    Blow dry the chip upside down, it falls down after a while
    Soldering the new chip: Use soldering paste! Spread it to the contacts of the layer, put the chip on it and use a hot air gun or a common soldering iron.

carl0s Thu Apr 12, 2018 10:04 am

[ahull – Thu Apr 12, 2018 7:56 am] –
That display may be this -> http://www.panelook.com/CLAA024GUF1_CPT … 31211.html

CPT CLAA024GUF1 Electronics Details
Driver IC : COG Built-in ST7789VI

http://www.allshore.com/pdf/ST7789V.pdf (older version of datasheet)
https://newhavendisplay.com/appnotes/da … T7789V.pdf

Probably being run in 8 bit parallel mode.
You would examine the ribbon cable and buzz out the pins on the main board to figure what goes where.

Hi Andy. Thanks for that. I’m new to all this, but I think I follow..
8 bit parallel 8080-I mode would use 8 data lines (d0 – d7), and the 5 control lines (RDX, WRX, D/CX, CSX, and RESX), which is 13 wires, plus maybe another 2 – 4 for backlight? It is clear from the ribbon that 2 wires do not go directly to the display controller chip. They seem to span off into a separate run of FFC (labelled as CN3 on the FFC). We have CN1 = 1 to 18, with one dummy / missing on the end, CN2 = 1 to 96, going to the display controller, with some density of connections just slightly to the left middle of the driver IC, and CN3 = 2 connections going to the top edge of the LCD, where I think some passives are located.

What makes you think it could be the ST7789BVI rather than the ILI by the way?

RogerClark Thu Apr 12, 2018 10:14 am

Matthias

Good idea about the aluminium foil.

I know I didnt get it hot enough.

carl0s Thu Apr 12, 2018 10:22 am

[RogerClark – Wed Apr 11, 2018 10:27 pm] –
I think if enough time was spent on the GD32 it could be made to work, but because there were so few GD32 boards available, there was hardly anyone with a board who had the time and skillset to resolve the problems

I’m obviously mistaken about this, given that you guys support the Blue Pill, but not GD32, but.. I thought I had read somewhere that these sub-$2 stm32f103 boards ‘must be using re-badged STM clones to be so cheap (i.e. GD32)’.

I guess that’s not the case?

carl0s Thu Apr 12, 2018 10:30 am

[ahull – Thu Apr 12, 2018 7:56 am] –
That display may be this -> http://www.panelook.com/CLAA024GUF1_CPT … 31211.html

CPT CLAA024GUF1 Electronics Details
Driver IC : COG Built-in ST7789VI

http://www.allshore.com/pdf/ST7789V.pdf (older version of datasheet)
https://newhavendisplay.com/appnotes/da … T7789V.pdf

Probably being run in 8 bit parallel mode.
You would examine the ribbon cable and buzz out the pins on the main board to figure what goes where.

Hey Andy.. I didn’t notice PanelLook let you get datasheets (only 1 though..! without paying).
I got the datasheet but it says the panel is SPI only.

http://www.internetsomething.com/autool … 24GUF1.pdf

It does look to be that panel though – good work – thanks! The not-connected pin-3 matches exactly.

RogerClark Thu Apr 12, 2018 11:18 am

We asked ST and they are not aware of any clones of the STM32.

The GD32 is quite a different device.
It’s functional is was copied from the STM32 data sheet, but GigaDevices added some enhancements.
They also didn’t manage to completely duplicate the functionality in the spec. ( they have bugs in the hardware)
GigaDevices have a license to use the Arm core of the processor, so they are not breaking any laws by doing what they did.

It’s mainly used by companies in China who are developing products from scratch and they use the GD32 standard peripheral library files supplied by GigaDevices.

The BluePill etc all use official ST32 chips.

carl0s Thu Apr 12, 2018 11:38 am

[RogerClark – Thu Apr 12, 2018 11:18 am] –
We asked ST and they are not aware of any clones of the STM32.

The GD32 is quite a different device.
It’s functional is was copied from the STM32 data sheet, but GigaDevices added some enhancements.
They also didn’t manage to completely duplicate the functionality in the spec. ( they have bugs in the hardware)
GigaDevices have a license to use the Arm core of the processor, so they are not breaking any laws by doing what they did.

It’s mainly used by companies in China who are developing products from scratch and they use the GD32 standard peripheral library files supplied by GigaDevices.

The BluePill etc all use official ST32 chips.

I see, thanks. I did see a post on here where somebody explained a few of the errata/differences, in particular I remember that SPI has to be selected between master or slave, which isn’t necessary on STM32, and a couple other things.. Think there was a list of 8 or so things but they didn’t sound big.

I want to try to get some code onto this thing anyway. I have ordered a ‘bluepill’. I’m not sure it will physically fit inside my round gauge that I have on order though. An adafruit Itsy M0 will fit.. but, that’s another £12 when I already have a more powerful MCU here, with CAN transceivers and all sorts of other gubbins built in. Plus, connecting to this 18-pin FFC on the screen is going to be a PITA if I use another board.

carl0s Thu Apr 12, 2018 11:42 am

[ahull – Thu Apr 12, 2018 7:56 am] –
That display may be this -> http://www.panelook.com/CLAA024GUF1_CPT … 31211.html

It is 100% that panel! the CAD drawing has the same part number on it!!

How did you find that? I can’t even find it when I search panellook.com for “18 pin” or “18pin” etc. ?? Thanks so much.

Would you believe though, that there are no 18-pin FFC breakout boards available anywhere? They go 10, 12, 14 ,16, 20… etc.!!

I have ordered some 18 pin FFC connectors and some 20 pin breakout PCBs to solder them to, but this is another reason why it would be easier if I could use the existing MCU & board.

ahull Thu Apr 12, 2018 1:29 pm

It would be more interesting to use the existing GD CPU too and a much cleaner solution.

To do that, we would need to reverse engineer the PCB a bit.

We need to know which pins go where on between the GD and the LCD.

Once we know that, we can try some of the existing ST7789BVI examples although they may need a little tweaking to get them to work on the GD rather than the STM. If you are up for a lot of probing with your multimeter and a fair amount of head scratching, I suspect we can get it to work.

The LCD also has a backlight, for which we need to identify the pin(s). It is probably driven via PWM and one of those transistors.

This is probably the first thing we need to identify as reading the display is going to be pretty difficult without the backlight :D

I cant make out the writing on all of the chips on your board, can you identify the numbers on them all?

Do you have an ebay/Aliexpress/Taobao listing for the one you bought, and that other one you linked a picture of?

carl0s Thu Apr 12, 2018 1:33 pm

[ahull – Thu Apr 12, 2018 1:29 pm] –
It would be more interesting to use the existing GD CPU too and a much cleaner solution.

To do that, we would need to reverse engineer the PCB a bit.

We need to know which pins go where on between the GD and the LCD.

Once we know that, we can try some of the existing ST7789BVI examples although they may need a little tweaking to get them to work on the GD rather than the STM. If you are up for a lot of probing with your multimeter and a fair amount of head scratching, I suspect we can get it to work.

The LCD also has a backlight, for which we need to identify the pin(s). It is probably driven via PWM and one of those transistors.

This is probably the first thing we need to identify as reading the display is going to be pretty difficult without the backlight :D

I cant make out the writing on all of the chips on your board, can you identify the numbers on them all?

Do you have an ebay/Aliexpress/Taobao listing for the one you bought, and that other one you linked a picture of?

I’m definitely up for that! :-)

There’s only one un-labelled chip. You can get a breakdown of the chips here: http://brano2.blogspot.co.uk/2017/09/ro … -auta.html


The circuit board includes the following integrated circuits:
U1 LM393 (K, L-line conversion)
U2 TJA1050 (HS-CAN transceiver 5V)
U3 MP1482DS (step-down 2A, sync rectified)
U4 LM6206N3 (linear voltage stabilizer 1,5-3,3V 0,25A ozn 662k)
U5?
U6 GD32F103RBT6 ARM Cortex-M3 3.3V 36-45mA 128KB flash, 20KB sram, usb2.0, can2.0b, case LQFP64
U7 S25FL216KIF pdf (2MB serial flash 3V)

Top of the printed circuit board From the inner (top) side of the link, there is an 8MHz crystal, a buzzer, a connector for the display.
As described, this is a version 4.3. From the top to the right is a J1 connector that contains 3.3 / 5V serial output from the processor (either I2C bus number 2, or Rx / Tx USART3).

At the top right is the J2 connector that is used to program the flash memory.
Here are the write-protect, gnd, SI / IO and SCK signals from the U7 external flash memory SPI.
The display connector has 18 pins, 13 used for LCD screen, 4 for LED backlighting and one unused.
The display shows the TFT240QV1-V1.0-15Z01, the 024guf1-v4-207581 2015-53 cable, the white label HYXS062563103752 on the cable.

except that on mine, the 2MB serial flash is a different chip for which I can find no data, and I was unable to read it in-circuit with my SOFI SP8A. Maybe that’s expected with it still being on the board though.

I was at it ’til 3:30am this morning. I’m not sure the girlfriend will allow that again tonight, but I’ll keep the thread updated. Thanks for your assistance and encouragement.

ahull Thu Apr 12, 2018 1:37 pm

[carl0s – Thu Apr 12, 2018 11:42 am] –
How did you find that? I can’t even find it when I search panellook.com for “18 pin” or “18pin” etc. ?? Thanks so much.

I searched for 024GUF1 which is stamped on the FPC cable. There is often little difference between these displays except the layout of the ribbon cable, so that can often be the best of the many random numbers stamped on the display to search for. I’ve had similar success looking for displays for old Canon cameras in the past.

I was a little disappointed that I didn’t turn up more info, for example some mass produced consumer device like a camera or GPS that used that exact display, but I didn’t spend much time on the task, so you may get luck and find more info if you keep trawling.

carl0s Thu Apr 12, 2018 1:50 pm

[ahull – Thu Apr 12, 2018 1:37 pm] –
[carl0s – Thu Apr 12, 2018 11:42 am] –
How did you find that? I can’t even find it when I search panellook.com for “18 pin” or “18pin” etc. ?? Thanks so much.

I searched for 024GUF1 which is stamped on the FPC cable. There is often little difference between these displays except the layout of the ribbon cable, so that can often be the best of the many random numbers stamped on the display to search for. I’ve had similar success looking for displays for old Canon cameras in the past.

I was a little disappointed that I didn’t turn up more info, for example some mass produced consumer device like a camera or GPS that used that exact display, but I didn’t spend much time on the task, so you may get luck and find more info if you keep trawling.

Thanks Andy.

ahull Thu Apr 12, 2018 2:24 pm

Another search that might be useful would be any combinations of ST7789 arduino display schematic pinout “18 pin” and so forth.

You could also try “ST7789V Interface I8080”. You never know you might turn up an exact clone of the display you have.

Regarding the flash chip, try holding the GD32 in reset using an ST-LinkV2 clone while probing the external flash chip, in case the GD32 is hogging the bus and stopping your reader from working. If all else fails you could of course unsolder it, but that might be a little tricky. I only tend to indulge in surgery if the patient absolutely requires it, or is already dead :D

There are a lot of very similar devices from different manufacturers, with similar pinouts, so you may simply have not quite the correct parameters.

Sign in to reply