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
73 stars 24 forks source link

unable to Autodetect the pins of my board GD32F130C6T6 & UART control #85

Open HRAFRH opened 1 month ago

HRAFRH commented 1 month ago

![2024-06-02 21 41](https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/assets/125764830/d41efa82-adf7-4225-94d8-e5968e69acfb 2024-06-02 21 41

2024-05-24 17 03 2024-05-20 11 40 2024-05-22 14 17 2024-05-24 17 02

I tried a lot but i need help on detecting the correct pin for only board i got (i think it's a master) that i want to control it using ESP32, but board is not listed in the Wiki could you please help me !!

HRAFRH commented 1 month ago

how is it possible to enable both of them?

I’ve enabled both remote_uart and remote_uartbus one at a time, but I still haven’t figured it out yet.

I-hate-2FA commented 1 month ago

ok, what did you enabled on the esp

RoboDurden commented 1 month ago

please use your brain. defines_2-1-4.h :

#ifdef HAS_USART0
  #define USART0_TX   PB6
  #define USART0_RX   PB7

  //#define USART0_MASTERSLAVE        // uncomment if this usart is used for master-slave communication
  #define USART0_REMOTE                       // uncomment if this usart is used for optional remote control
#endif

// GD32F130 USART1 GD32F130 TX/RX: (PA14/PA15)AF1 , (PA2,PA3)AF1  , (PA8/PB0)AlternateFunction4
#ifdef HAS_USART1
  #define USART1_TX       PA2
  #define USART1_RX       PA3

  //#define USART1_MASTERSLAVE        // uncomment if this usart is used for master-slave communication
  #define USART1_REMOTE               // uncomment if this usart is used for optional remote control
#endif
HRAFRH commented 1 month ago

ok, what did you enabled on the esp

in the ESP i can only find remote_uartbus, i'm using TestSpeed.ino

#define ESP32       // comment out if using Arduino
// #define HOVERBOARD_MM32  // uncomment if a MM32 Hoverboard firmware is connected (and no GD32 or STM32)
#define REMOTE_UARTBUS  // one serial bus to control them all :-)
#define SEND_MILLIS 100   // send commands to hoverboard every SEND_MILLIS millisesonds
HRAFRH commented 1 month ago

this is all i can get in the serial monitor so far : 00 00 00 00 80 00 00 04 00 00 00 00 00 00 00 00 00 F8 E0 E8 20 80 00 80 20 80 00 00 00 00 01 00 80 00 00 00 00 00 00 00 00 0 00 00 0 image

and the motor still not moving :(, please @RoboDurden @I-hate-2FA any guidance with the code

RoboDurden commented 1 month ago

Sorry, i will not help you anymore.

HRAFRH commented 1 month ago

please use your brain. defines_2-1-4.h :

#ifdef HAS_USART0
    #define USART0_TX   PB6
    #define USART0_RX   PB7

    //#define USART0_MASTERSLAVE        // uncomment if this usart is used for master-slave communication
    #define USART0_REMOTE                       // uncomment if this usart is used for optional remote control
#endif

// GD32F130 USART1 GD32F130 TX/RX: (PA14/PA15)AF1 , (PA2,PA3)AF1    , (PA8/PB0)AlternateFunction4
#ifdef HAS_USART1
    #define USART1_TX       PA2
    #define USART1_RX       PA3

    //#define USART1_MASTERSLAVE        // uncomment if this usart is used for master-slave communication
    #define USART1_REMOTE               // uncomment if this usart is used for optional remote control
#endif

please i really don't know what to do!

I-hate-2FA commented 1 month ago

there is 5 pin that must be set for the board to work it is the 3 hall pin and these 2

please use your brain. defines_2-1-4.h :

#ifdef HAS_USART0
    #define USART0_TX   PB6
    #define USART0_RX   PB7

    //#define USART0_MASTERSLAVE        // uncomment if this usart is used for master-slave communication
    #define USART0_REMOTE                       // uncomment if this usart is used for optional remote control
#endif

// GD32F130 USART1 GD32F130 TX/RX: (PA14/PA15)AF1 , (PA2,PA3)AF1    , (PA8/PB0)AlternateFunction4
#ifdef HAS_USART1
    #define USART1_TX       PA2
    #define USART1_RX       PA3

    //#define USART1_MASTERSLAVE        // uncomment if this usart is used for master-slave communication
    #define USART1_REMOTE               // uncomment if this usart is used for optional remote control
#endif

did you set it correctly already

I-hate-2FA commented 1 month ago

and need to use uartbus mode on both, with correct slave id set