Git Product home page Git Product logo

hoverboard-sideboard-hack-gd's Introduction

hoverboard-sideboard-hack-gd's People

Contributors

eferu avatar maxgerhardt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hoverboard-sideboard-hack-gd's Issues

Alternative Uses for Sideboards / Arduino Alternative

Hi,
I have a few sideboards lying around and was wondering if I could repurpose these boards for other projects, like a simple Neopixel controller or similar applications. Essentially, Iโ€™d like to use them as an Arduino alternative.
I have a few questions:

  1. Is it possible to program and flash the MCU using the Arduino IDE?
  2. What voltage range does the +15V pin support? (e.g., can the board be powered with 12V or 5V?)
  3. How much current can the buck converter handle at 3.3V and 5V?
  4. Is there a complete schematic of the board available?
  5. Would it be possible to connect other I2C or SPI modules/sensors?
  6. Is there a way to retrofit a WiFi module onto the board?

Thanks in advance for your help!

Sensor Fusion

Dear Teacher,
_ Between DMP, Kalman Filter and Complementary filter which way you think that is the most stable and reliable.
_ How can we add bias in the DMP (i saw that there are dmp_set_bias_...() functions but can we set bias for each axis?)
_ There is gyro calib feature in DMP, but it only works after 8 secs of no motion, so can we save the bias for the next time?
Thank you very much my teacher.

GD32F130C8T6

My sideboard chipset is GD32F130C8T6 different from yours (C6T6). I have flashed your firm ware to my chip success but it can't read MPU data. Do you know what i have to do to make project is suitable with C8T6 chip

Zero value and IMU failed

Hey @EmanuelFeru,
I followed all the steps to get sideboard data (GD32F130C6T6 with MPU-6050A).
I unlocked the board and got it flashed. However, when I monitored Euler value I got only zeros.

Command = e
Roll:0 Pitch:0 Yaw:0
Roll:0 Pitch:0 Yaw:0
Roll:0 Pitch:0 Yaw:0
Roll:0 Pitch:0 Yaw:0
Roll:0 Pitch:0 Yaw:0
Roll:0 Pitch:0 Yaw:0

When I run a self-test, I get this result

accel: 319802219 -323885 134236467
gyro: -1743067344 1087314292 -1256236507
Gyro failed
Accel failed
Compass failed

Any idea what's causing this ?
Thanks for your help
Cheers ๐Ÿ˜ƒ

PS: After the flash, I have a steady green LED light.

'FLASH' overflowed on VARIANT_DEBUG make

Hi, I'm obviously missing something since make fails with errors.

Help, please?

Ubuntu 16.04
stlink installed from stlink-1.6.1-1_amd64.deb
VARIANT_DEBUG selected
Makefile: added -std=gnu99 (else I get "'for' loop initial declarations are only allowed in C99 or C11 mode")

Result:
(...)
arm-none-eabi-gcc build/gd32f1x0_adc.o build/gd32f1x0_can.o build/gd32f1x0_cec.o build/gd32f1x0_cmp.o build/gd32f1x0_crc.o build/gd32f1x0_dac.o build/gd32f1x0_dbg.o build/gd32f1x0_dma.o build/gd32f1x0_exti.o build/gd32f1x0_fmc.o build/gd32f1x0_fwdgt.o build/gd32f1x0_gpio.o build/gd32f1x0_i2c.o build/gd32f1x0_ivref.o build/gd32f1x0_misc.o build/gd32f1x0_opa.o build/gd32f1x0_pmu.o build/gd32f1x0_rcu.o build/gd32f1x0_rtc.o build/gd32f1x0_slcd.o build/gd32f1x0_spi.o build/gd32f1x0_syscfg.o build/gd32f1x0_timer.o build/gd32f1x0_tsi.o build/gd32f1x0_usart.o build/gd32f1x0_wwdgt.o build/system_gd32f1x0.o build/main.o build/util.o build/systick.o build/mpu6050.o build/mpu6050_dmp.o build/setup.o build/i2c_it.o build/gd32f1x0_it.o build/startup_gd32f1x0.o -mcpu=cortex-m3 -mthumb -specs=nano.specs -TGD32F130C6T_FLASH.ld -lc -lm -lnosys -Wl,-Map=build/firmware.map,--cref -Wl,--gc-sections -o build/firmware.elf
(...)
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/lib/armv7-m/libc_nano.a(lib_a-errno.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: build/firmware.elf section .rodata' will not fit in region FLASH'
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 684 bytes
collect2: error: ld returned 1 exit status

By the way, EmanuelFeru/hoverboard-firmware-hack-FOC (the mainboard) builds successfully.

Theremin device.

Used hoverboard-firmware-hack-FOC. In complete delight. Thanks to the author.
I wanted to have fun with the side boards of the hoverboard. Create a theremin device.
When the board is tilted, it emits a sound of varying frequency.
Instead of LED1, I connected a speaker.
Using the STM32 ST-LINK Utility program, change Option Bytes Protection - Disabled, apply,
then check the box WDG_SW, apply.
The programmer gives errors, but changes the settings.
Download the program from ARM Keil v5.37
Create project, change compiler options c90 to gnu90 , No Warning
Debug Use options: ST-Link Debugger

file config.h
#define VARIANT_HOVERBOARD

file systick.c
// if (SysTick_Config(SystemCoreClock / 1000)){
if (SysTick_Config(SystemCoreClock / 200000)){

file mpu6050.c
// delay_ms(100);
delay_ms(20000);

file gd32f1x0_it.c
void SysTick_Handler(void)
{
tick_count_increment();
delay_decrement();
sound();
}

file util.c
extern MPU_Data mpu;
volatile int32_t x,x1;
void sound2(void) {
mpu_get_data(); x= mpu.euler.pitch >>2; if (x>1000) x=1000;
}
void sound(void) {
x1--; if (x1<1) {x1=x; toggle_led(LED1_GPIO_Port, LED1_Pin);}
}

file main.c
while(1) {
delay_1ms(100);
sound2();

// delay_1ms(DELAY_IN_MAIN_LOOP);

// handle_mpu6050();
// handle_sensors();
// handle_usart();
// handle_leds();
// main_loop_counter++;


Alternatively, you can compile with gcc-arm-none-eabi,
then rename the output file from proj.elf to proj.axf
and substitute in ARM Keil. And from it to load into the controller.

GD32F103C8T6 vs GD32F130C6T6

Hi Emanuel,

I have two sets of sideboards one of each shown below. One set has GD32F103C8T6 and the other set has GD32F130C6T6.

Programming the GD32F130C6T6 fails usually after writing somewhere between 4 and 12 pages and this is consistent for both sideboards in the pair. They unlock and erase / erase verify ok. I think there was another issue already open where people had experienced the same problem but no solution yet.

Programming the GD32F103C8T6 boards always succeeds, however the code does not appear to run properly, LED 4 or 5 turns on and nothing further happens, no communication with main board. Have you ever successfully run on this MCU? I suppose it is not working because of unsupported MPU 6052C?

Do you have any experience with either of these issues or any idea where to start to look to debug?

GD32F103C8T6
3386EF03-9248-498A-8F05-9B113BEACDD1

MPU appears to be 6052C.
5DFC246C-2A03-460C-BCCF-AE7E7133AD1F

GD32F130C6T6
8FBAD1E2-CC0D-4C6E-9AA1-EE4906DBE2F4

MPU is 6050.
81377D00-1E1C-4715-B1B8-E2A2A88F2D9F

Different SWD Programming Pins

On my hoverboard sideboards the SWD programming pins differ from the ones specified in sideboard pinout. From top -> bottom mine go:

  • VDD 3.3V
  • PA14 / SWCLK
  • PA13 / SWDIO
  • GND

It took a while to figure out since I thought there was something wrong with my STLINK/V2 programmer, so it might help others with the same board to add a notice in the readme for that.

Firmware.bin Will Not Flash

I tried forking the code and when I try and upload firmware.bin it will not download, ST-Link is saying "warning core is locked up." It will download firmware.elf (idk what that is) and when I power the board it beeps in sets of three. I am attempting to use US_ARtT variant. When I hook it to an Arduino it seems to have no effect.

Can't flash firmware

I tried with keul uvision5 and st-link software. Keul gives error about missing packet (i installed GD32F130 package). St-link detect chip as some st version and start to flash it, but stops at beginning. I can disable read out protection.

Do i have to install some button to put chip in programmin mode like mainboard (must hold power button while flashing)?

Help with this board

So I've cracked an old hoverboard containing these identical 2 pcbs. It uses GD32F130C6T6 (reports 32k, I was able to upload the whole bin file, I had to hold the power button during flash)
And I was able to compile & flash the DEBUG example without the MPU_SENSOR definition
IMG_20220404_194632

Any help of the pinout of where is that UART that I can hook and observe/send commands?
One additional question - with that VARIANT_DEBUG can I send commands to move the motor? and what I should use if that's not the right variant (not interested in MPU sensor just sending command to move in specified direction and speed)

New Sideboard layout found with same processor

I have a new variant of sideboard with 2 led headers and a slightly changed pinout. I will update with the pinout I find.
20231031_131136~2

So far, a lot of the pins line up for the sensors and battery meter pins. One notable difference is that this board is fed +36V instead of +15V, so the LEDs are most likely a different voltage config. There is also 3 colors in the front lights, so they are potentially RGB. will update!

Hoverboard not working

I tried forking the code and when I try and upload firmware.bin it will not download, ST-Link is saying "warning core is locked up." It will download firmware.elf (idk what that is) and when I power the board it beeps in sets of three. I am attempting to use US_ARtT variant. When I hook it to an Arduino it seems to have no effect.

No data received via Main Serial

Hello, I am having some problems in getting data from the IMU with an Arduino via Serial. First I have to say that im new to this kind of projects, so I apologize if can't explain properly.
I have a sideboard with a GD32F130 C6T6 and a MPU-6050A. I have unlocked the micro and then flashed it (with lot of difficulties because most of the time I get errors meanwhile writing the pages). Before flashing, I modified config.h to have the Hoverboard Variant because it includes the Serial Control via serial port (I have also tested with Serial Feedback deactivated).
Then, I modified this Arduino program to define the same Feedback struct that is sent via serial by the Sideboard.
And finally, I connected the 3.3V and GND pins from the SWD programming pins to power the board, and the GND and RX (pin number 2) pins from Arduino have been connected to GND and TX from the connector that connects the Mainboard with the Sideboard.
However, Arduino does not receive anything via serial. In fact, I have enabled DEBUG_RX in the Arduino program and I only receive 0s.
I have also tested to disable DMP as said in this comment, but again nothing happens.
I don't know what is wrong and I don't have more ideas. Any help would be appreciated.
Thanks

Communicating with sideboard via USART

Hi!
I'd like to use sideboard as UART-driven sensor, i.e. the goal is to read gyro/accelerometer data via UART.
Had some problems flashing the GD chip using ST-link utility, but solved them with st-flash.
Connected sideboard to external power source with 15V and connected it via USB-TTL adapter to PC's USB port (this have worked earlier with main board)
Tried different variants and noticed the following:

  • 4-pin board LEDs (red/green) starts blinking in circle
  • in VARIANT_HOVERCAR and VARIANT_HOVERBOARD I can see RX blinks on the USB-TTL adapter, so seems like firmware flashed correctly (not sure though)
  • oscilloscope shows periodical bursts on TX pin of sideboard and they doesn't look like zeroes
  • when reading serial port to 16 byte buffer, 14 bytes is returned, like sizeof(SerialSideboard)

But values in the buffer are all zeroes.
Again, this setup worked normally when used with gyro's mainboard (sending commands, reading feedback).
I'm out of ideas. Maybe serial setup is different for sideboard?

HANDLE serialHandle = CreateFile("COM4", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

DCB serialParams = { 0 };
serialParams.DCBlength = sizeof(serialParams);
GetCommState(serialHandle, &serialParams);
serialParams.BaudRate = CBR_115200;
serialParams.ByteSize = 8;
serialParams.StopBits = ONESTOPBIT;
serialParams.Parity = NOPARITY;
SetCommState(serialHandle, &serialParams);

while (true)
{
	static char buf[16];
	memset(buf, 0xcc, sizeof(buf)); // just to make sure that zeroes comes from serial port
	DWORD bytesRead;
	ReadFile(serialHandle, buf, sizeof(buf), &bytesRead, NULL);

	std::string str;
	for (int i = 0; i < bytesRead; ++i)
	{
		str += format_string("%02x ", buf[i]);
	}

	log_msg("[%u] %s", bytesRead, str.c_str());
}

MPU init and config intermittent failure

Hi,
sometimes the mu_init() and mpu_config() fail. When I power cycle the board it's good again for some time.

  • So I was wondering is there a software method to reset the mpu6050 ? Not sure if the I2C is failing or the MPU6050.
  • I don't find anymore a detailed schematic ? Somebody knows a location of the pdf ? The old link doen't work anymore.

Any help is appreciated,
Lieven

Wrong Euler Angle.

I saw that Euler angles that calculate from DMP are so wrong.

When i checked with 3D Visualization Demo, the angle rotated more about 8 times than reality.

I saw your clip upload on Telegram, it's so cool and smooth.

Have you ever meet that behavior? Please help me teacher.

I have sent you a short clip on telegram, please accept my request (https://t.me/tonvanhieu)

getting Cortex M3 legacy target in uVision

Here is a picture of the Windgoo sensorboard that was inside my Hoverboard. The SWD programming pins are directly below the connector for the mainboard. I have measured the pins and added them to the picture.
Windgoo_Hoverboard_GD_sensorboard-SWD-programming

Connecting the board through ST-Link utility and unlocking the flash went okay. No errors.

After that I tried to install uVision and open the .UVPROJ file but I get a lot of errors about missing files for the M3 Cortex boards. Probably the custom algorithm for the flashing utility. I have tried to install the legacy database but not sure what to do next.

The Hex file that is already in the build folder of the repository doesn't flash with ST-Link utility. Is it possible to get a pre-build bin file of the Hoverboard version?

Reset in 300-500ms

i've tested couple of such devices, and it seems that internal watchdog reset device in 300-500 ms
i've solved it by adding fwdgt_counter_reload(); inside delay_1ms while in systick.c , but not sure this is correct place for it

What does it do?

Hi, could you add an abstract to the readme, pointing out what this firmware does, e.g. does it reimplement the original behavior? Thanks.

debug variant not compiling

Hello, i'm trying to compile a debug variant, however i get the following error:

/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: build/firmware.elf section .rodata' will not fit in region FLASH'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 2696 bytes

so it seems it's bigger than flash region on the GD chip.

Arduino control

Hello.
Would you share a code to control this board via UART?
Thank you.

Support for GD32F130C8T6 based board

Is this firmware compatible with my GD32F130C8T6 board? It looks like this chip has double the flash and ram, but otherwise the same as the 6T6.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.