RoboDurden / Hoverboard-Firmware-Hack-Gen2.x

with different defines_2-x.h for different board layouts :-) Compiles with Keil version 6
GNU General Public License v3.0
84 stars 28 forks source link

Gen2.1.17 (ex2.19) = GoTrax FLUXX FX3 (GD32F130C6T6) #52

Open reed-dan opened 8 months ago

reed-dan commented 8 months ago

Brand: Fluxx (GoTrax) Model: fluxx fx3 URL: https://gotrax.com/products/fluxx-fx3-self-balancing-hoverboard Manufacturer Date: 02/05/2020 Max: Speed 6mph Weight 220lb Battery: 25.2 V 2.6Ah TaoTao TTDD651-2.6 Charger: Barrel Jack 24V 0.6A

Body: Aluminium Wheels: Plastic 6.5in Board Configuration: 2 boards Chip: GD32F130C6T6 Date on PCB 2020/01/07 Notes: Battery connector is XT30

20240109_175634 20240109_180745 20240109_181605 20240109_180102 20240109_182251 20240109_182152 20240109_230625 20240109_225851

Similar to 2.17

AILIFE4798 commented 8 months ago

2.18 is used so it would be 2.19 it should be pin compatiable with 2.17 test with constant current supply

RoboDurden commented 8 months ago

Yes this will be 2.19 Layout is quite different from 2.17 (also GoTrax) so it will need some pin tracing and testing with constant current supply (cheapest way: LM2596HVS 60V 3A Buck Converter = https://www.aliexpress.com/item/4001360810712.html )

@reed-dan please upload nice top view photos from master and slave and master-backside and slave-backside, this will make pin tracing easier. A description of the pin headers would also be nice. I guess the one with the buzzer in the middle is the master as it has the onOff button and the charger socket.

RoboDurden commented 8 months ago

Okay i have added this as 2.19 to the repo. @reed-dan the 6 mosfet are compatible to my new autodetect firmware: hall pins

But i can not really see where the two SWD pins for flashing with st-link dongle goes:

PA14: SWCLK PA13: SWDIO

And you need a uart communicaton for cheap usb-uart-dongle (or esp32 with my autodetect.ino)

PA2/PA3 is usually the master/slave header: uart1 maybe

PB6 and PB7 could be on the empty header to the left: uart0 maybe But then PB6 and PB7 seem to be bridged. So you would have to access the still seperate PB6 and PB6 before the final smd resistors.

Best start with my hoverboard autodetect tx=PA2, rx=PA3.bin at https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/tree/main/BinariesToTest

AILIFE4798 commented 8 months ago

there really is no swd connector thats gonna be a bit hard to solder wire to pin of mcu but it can be done

AILIFE4798 commented 8 months ago

i guess the swd is disabled anyways just use serial to flash

RoboDurden commented 8 months ago

please upload some screentshots on how to flash via serail and not swd. To me it looks like PA13 and pA14 at least a connected to some smd resistors/capacitors. So soldering thin cable to those should not be such a big problem.

AILIFE4798 commented 8 months ago

but the problem is if the pin used for something else then swd have to be disabled anyways

AILIFE4798 commented 8 months ago

well the bootloader recover uart pin is a9 a10 which is used by motor so it cannot be used also thats gonna be a bit tricky

AILIFE4798 commented 8 months ago

image

AILIFE4798 commented 8 months ago

pattern1=boot0 pullup boot1 pulldown

RoboDurden commented 8 months ago

@AILIFE4798 please wait for @reed-dan to start trying. We already have a board that also uses a SWD pin for some LED if i remember correctly. In this case we only have to take care to not use this pin as something like #define LED_RED because after that it needs the NREST pin to be able to flash again.

reed-dan commented 8 months ago

But i can not really see where the two SWD pins for flashing with st-link dongle goes:

PA14: SWCLK PA13: SWDIO

The swclk swdio pins are filled in with solder but to the left of the mcu

Screenshot_20240118_164213_Gallery

I will get some better pictures soon. Sorry been wokring on 2.8.

reed-dan commented 8 months ago

20240118_174257 20240118_174314 20240118_174533 20240118_174543

reed-dan commented 8 months ago

How do you determine which board is the Slave & Master?

reed-dan commented 8 months ago

Tracing Work in Progress MCU Pin 30-PA9->R83->EG2133 Pin 2 Pin 28-PB15->R59->EG2133 Pin 4 Pin 26-PB13->R82->EG2133 Pin 6 Pin 31-PA10->R60->EG2133 Pin 1 Pin 29-PA8->R85->EG2133 Pin 3 Pin 27-PB14->R84->EG2133 Pin 5

Pin 37-PA14: SWCLK Pin 34-PA13: SWDIO

Mosfet Q2: D:R38 Q8: D:R39

reed-dan commented 8 months ago

20240118_212222

AILIFE4798 commented 8 months ago

The board with power button is master Most of the time they write it on the board with Chinese but apparently this time not You should not trace the pin should wait for auto detect Only trace tx rx and the swd pins

reed-dan commented 8 months ago

So are you talking about like PA2 TX & PA3 RX?

PA2->R117->pin 2 on J4 (left to right) PA3->R92->pin 3 on J4 (left to right)

Screenshot_20240119_010544_Gallery

RoboDurden commented 8 months ago

Yes . Pb6 and pb7 would be good if you plan to use the master slave cable.

RoboDurden commented 8 months ago

I am still in bed. If you have Keil installed you can compile the latest autodetect yourself. Your mosfet pins are compatible. And the hall sensors detection worked for ailife.

AILIFE4798 commented 8 months ago

is the serial fixed now

reed-dan commented 8 months ago

It will be a couple of days, I am waiting on desoldering wick so I can take the solder out of the swd holes. It looks like PB6 & PB7 are both unused on the board. Would this something I would need to have connection to permanently or just temp? If it is just temp I ordered some micro probe clips and may be able to hook onto the pins, otherwise I am not sure I can solder to those pins at this time.

Good news is I have a 2.9 board with an gd32f103c8t6 (instead of gd32f103c6t6) chip that has an "external interface" appears to be connected to PB6 & PB7!

RoboDurden commented 8 months ago

PB6 and PB7 could be on the empty header to the left: uart0 maybe But then PB6 and PB7 seem to be bridged. So you would have to access the still seperate PB6 and PB6 before the final smd resistors.

You should check my photo-pin-tracing with a needle and a diode tester:

AILIFE4798 commented 8 months ago

i dont think any micro probe can hold onto a qfn48 without shorting out lol soldering copper wire that is used in motor winding is the easiest way if it is really the case that is unused but pb6 and pb7 is the only hardware i2c pin so if they want to use hardware i2c for IMU it would be much easier thrn soldering to gd32's leg

reed-dan commented 8 months ago

I probed them to PB5 pin 41 (Alternate: SPI0_MOSI, I2C0_SMBA, TIMER15_BRKIN, TIMER2_CH1) does that seem correct?

tempFileForShare_20240119-110457

RoboDurden commented 8 months ago

PB5 can not be used as serial0.

Why do i not see the back connections on your transparent pcb photo ? grafik grafik

Am i mixing wrong layouts ?

reed-dan commented 8 months ago

I didn't upload the back side transparent, but you are spot on. I tested those pads previously with my fine point meter probes, but they seemed to no be connected to anything. When I got out the needles we are making progress, and there are nice pads to solder to.

tempFileForShare_20240119-122155 20240119_122400

RoboDurden commented 8 months ago

But you can see the footprint of a bluetooth module there :-) grafik

RoboDurden commented 8 months ago

uart0

AILIFE4798 commented 8 months ago

to easily solder pin header without removing the solder in the hole first you can first cut the pin header into a single pin and solder it 1 by 1(melt the solder from one side of board and push the pin header in)

reed-dan commented 7 months ago

I desoldered the swd header pin holes today, but the holes are smaller than standard header pins.

RoboDurden commented 7 months ago

https://youtu.be/qVJqOmmUm2c