Hoverboard-Firmware-Hack-Gen2 icon indicating copy to clipboard operation
Hoverboard-Firmware-Hack-Gen2 copied to clipboard

Please add a makefile for my online compiler :-)

Open RoboDurden opened this issue 5 years ago • 24 comments

Hello from Germany :-) I would like to add your repo to my online compiler www.pionierland.de/hoverhack videos: https://www.youtube.com/playlist?list=PLa9VLvJBLbTMmpslED2FMClIBv5URBMIa

But you only offer the Keil project files. If you are already compiling with GCC, a port should be possible: https://community.arm.com/developer/tools-software/oss-platforms/f/gnu-toolchain-forum/45142/how-to-move-from-keil-to-linux

Ideas welcome ! www.robo4future.de :-)

RoboDurden avatar Dec 30 '19 08:12 RoboDurden

no answer :'(

RoboDurden avatar Jan 14 '20 15:01 RoboDurden

No, i am not experienced enough to copy and paste a Makefile :-/ A pity because adding repos to my online compiler just takes one line of code. Today i added all three repos of https://github.com/EmanuelFeru

RoboDurden avatar Apr 06 '20 10:04 RoboDurden

What about Florian's firmware (this branch)? Were you able to flash it in a Gen2 board?

renmalek7 avatar Apr 06 '20 11:04 renmalek7

I have no Gen2 board where there is a control board for either side.

RoboDurden avatar Apr 06 '20 13:04 RoboDurden

You are spoliing my issue here to kindly ask for a makefile.

RoboDurden avatar Apr 08 '20 09:04 RoboDurden

Hi I have 4 gen2 motherboard that I can't flash so I try Florian's firmware but where can i find it?

bricobi5 avatar Jun 05 '22 18:06 bricobi5

https://github.com/flo199213/Hoverboard-Firmware-Hack-Gen2/tree/master/HoverBoardGigaDevice But as it still have no makefile, i can not include it to my online compiler :-( I guess you have to install Keil to open the .uvoptx µVision 5 project files :-(( Someone who does not dislike Linux so strongly as i do might easily generate that makefile for me/us :-/

RoboDurden avatar Jun 05 '22 20:06 RoboDurden

https://github.com/flo199213/Hoverboard-Firmware-Hack-Gen2/tree/master/HoverBoardGigaDevice But as it still have no makefile, i can not include it to my online compiler :-( I guess you have to install Keil to open the .uvoptx µVision 5 project files :-(( Someone who does not dislike Linux so strongly as i do might easily generate that makefile for me/us :-/

Incoperating #16 may fix the issue. Compiling with PIO should be possible, but i dont know what amount of recoding this would take.

its not accepted and merge, however the firmware works. Im stuck with flashing, but im currently trying to flash my hoverboard to see if the build works.

BastelPichi avatar Jul 23 '22 14:07 BastelPichi

For a Linux believer a make file should be no issue at all. But I am rather a Linux hater. Yet if you tell me how to install PlatformIO on my Ubuntu vserer and which exact command line will successfully compile the firmware, I would add platform Io support to my online compiler :-)

RoboDurden avatar Jul 23 '22 14:07 RoboDurden

Well to install PIO, you get quite good docs here: https://docs.platformio.org/en/latest/core/installation/methods/index.html

To compile the project, all you need to do is run pio run in the HoverBoardGigaDevice directory. The build is saved at HoverBoardGigaDevice/.pio/build/GD32F130C8T6/ theres a firmware.bin and a firmware.elf, I assume they are both the same, but I would try to firmware.elf first.

The first build takes quite some time as it downloads alot, however then builds run within a few seconds.

PS: Lol ich könnte auch einfach Deutsch schreiben grafik

BastelPichi avatar Jul 24 '22 14:07 BastelPichi

Any update on this?

BastelPichi avatar Sep 03 '22 17:09 BastelPichi

no time (time = happiness) to add the PIO support. sorry.

RoboDurden avatar Sep 03 '22 21:09 RoboDurden

Ok, I broke my STLink anyways for now xD

BastelPichi avatar Sep 04 '22 16:09 BastelPichi

Here is a repository for Makefile, if you are still interested: https://github.com/weiminshen99/GD32-hover-master-slave

weiminshen99 avatar Apr 24 '23 14:04 weiminshen99

Yes great, i still would like to add a gen2 firmware to my online compiler. Your folder structure

https://github.com/weiminshen99/GD32-hover-master-slave/tree/main/Drivers/GD32F1x0_standard_peripheral/Source

is a bit different then my gen 2.x firmware

https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/tree/main/HoverBoardGigaDevice/RTE/Device/GD32F130C6

But I guess I can port your makefile.

If your makefile generates a working gen2.0 binary i would add your report to my online compiler. It might take a year before I proceed with the makefile for my repo...

RoboDurden avatar Apr 24 '23 15:04 RoboDurden

Thanks for your reply and I am glad it is still useful for you.

By the way, do you have a schematic that shows all the pins of the microcontroller? I only have this one
https://github.com/weiminshen99/GD32-hover-master-slave/blob/main/Docs/Schematic.pdf https://github.com/weiminshen99/GD32-hover-master-slave/blob/main/Docs/Schematic.pdf

If you do, could you please let me know? Thanks!

On Apr 24, 2023, at 8:03 AM, Robo Durden @.***> wrote:

Yes great, i still would like to add a gen2 firmware to my online compiler. Your folder structure

https://github.com/weiminshen99/GD32-hover-master-slave/tree/main/Drivers/GD32F1x0_standard_peripheral/Source https://github.com/weiminshen99/GD32-hover-master-slave/tree/main/Drivers/GD32F1x0_standard_peripheral/Source is a bit different then my gen 2.x firmware

https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/tree/main/HoverBoardGigaDevice/RTE/Device/GD32F130C6 https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/tree/main/HoverBoardGigaDevice/RTE/Device/GD32F130C6 But I guess I can port your makefile.

If your makefile generates a working gen2.0 binary i would add your report to my online compiler. It might take a year before I proceed with the makefile for my repo...

— Reply to this email directly, view it on GitHub https://github.com/flo199213/Hoverboard-Firmware-Hack-Gen2/issues/10#issuecomment-1520349514, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF5J5N2VNLZZABJ3XNUGHITXC2I2XANCNFSM4KBKBVFQ. You are receiving this because you commented.

weiminshen99 avatar Apr 24 '23 18:04 weiminshen99

no but i have made quite a lot of reverse engeniering: https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/tree/main/Schematics_2.0

RoboDurden avatar Apr 24 '23 19:04 RoboDurden

So i have added your repo to my online compiler. But i forked it because i needed to switch to a gcc inline compiler directive. Still get a warning

Src/bldc.c:90:38: warning: always_inline function might not be inlinable [-Wattributes]
   90 | __attribute__((always_inline))  void blockPWM(int pwm, int pwmPos, int *y, int *b, int *g) //org __INLINE not known in gcc

but the code compiles: https://pionierland.de/hoverhack/?p=gen2 Maybe someon can test it.

I also needed to increase a char buffer from 5 to 7 in comsBluetooth.c to remove sprintf warnings:

void SendBluetoothDevice(uint8_t identifier, int16_t value)
{
	int index = 0;
	char charVal[7];

This should also apply to your compiler ?

Thanks again.

RoboDurden avatar Apr 26 '23 19:04 RoboDurden

Thanks for adding my repo!

I have made the two changes you suggested and compiled here successfully and pushed the changes into my repo.

If you like, you could try to compile again to see if you can get rid of the warming (replace “_INLINE” by “inline”).

Have a good day!

On Apr 26, 2023, at 12:03 PM, Robo Durden @.***> wrote:

So i have added your repo to my online compiler. But i forked it because i needed to switch to a gcc inline compiler directive. Still get a warning

Src/bldc.c:90:38: warning: always_inline function might not be inlinable [-Wattributes] 90 | attribute((always_inline)) void blockPWM(int pwm, int pwmPos, int *y, int *b, int *g) //org __INLINE not known in gcc

but the code compiles: https://pionierland.de/hoverhack/?p=gen2 https://pionierland.de/hoverhack/?p=gen2 Maybe someon can test it.

I also needed to increase a char buffer from 5 to 7 in comsBluetooth.c to remove sprintf warnings:

void SendBluetoothDevice(uint8_t identifier, int16_t value) { int index = 0; char charVal[7];

This should also apply to your compiler ?

Thanks again.

— Reply to this email directly, view it on GitHub https://github.com/flo199213/Hoverboard-Firmware-Hack-Gen2/issues/10#issuecomment-1523908374, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF5J5N7DUC2M2CTZHNTIT7DXDFWRXANCNFSM4KBKBVFQ. You are receiving this because you commented.

weiminshen99 avatar Apr 26 '23 22:04 weiminshen99

Yes i would like to add your original and not my fork so you might be motivated to get involved. But I had already tried the official c inline and it does.not compile:

/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: build/bldc.o: in function CalculateBLDC': /var/www/html/pionierland/public/hoverhack/source/robodurden_gd32-hover-master-slave/Src/bldc.c:214: undefined reference to blockPWM' collect2: error: ld returned 1 exit status make: *** [Makefile:185: build/firmware.elf] Error 1

I can remove the inline altogether and i compiles without warning. Is that function really that time critical that there is no time to make a function call ?

RoboDurden avatar Apr 27 '23 06:04 RoboDurden

I See that the blockPWM function is used only once anyway : https://github.com/weiminshen99/GD32-hover-master-slave/blob/main/Src/bldc.c#L214

So simply copy the code there ?

I think it should be possible to make the function code a #define , that might be another was to get rid of that inline word ?

RoboDurden avatar Apr 27 '23 07:04 RoboDurden

I have taken out the “__INLINE”, and please compile again. Thanks!

On Apr 27, 2023, at 12:11 AM, Robo Durden @.***> wrote:

I See that the blockPWM function is used only once anyway : https://github.com/weiminshen99/GD32-hover-master-slave/blob/main/Src/bldc.c#L214 https://github.com/weiminshen99/GD32-hover-master-slave/blob/main/Src/bldc.c#L214 So simply copy the code there ?

I think it should be possible to make the function code a #define , that might be another was to get rid of that inline word ?

— Reply to this email directly, view it on GitHub https://github.com/flo199213/Hoverboard-Firmware-Hack-Gen2/issues/10#issuecomment-1524934256, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF5J5NZSISCE3GUJ6NQI2I3XDIL3FANCNFSM4KBKBVFQ. You are receiving this because you commented.

weiminshen99 avatar Apr 27 '23 11:04 weiminshen99

Fine, i switched the repo back to yours :-)

https://pionierland.de/hoverhack/?p=gen2

Would be nice if you could add a simple arduino example that spins the two motors a bit forward and backwards. This seems to be too much: https://github.com/gaucho1978/CHEAP-LAWNMOWER-ROBOT-FROM-HOVERBOARD/tree/master/ArduinoFirmware

For my Gen 2.x firmware i rewrote all the serial communication, so people can not rely on my arduino example when using your firmware. The original https://github.com/flo199213/Hoverboard-Firmware-Hack-Gen2/tree/master/PPMDeviceArduino_V1.0/PPMDevice is also overloaded with PPM rc-control :-/

Ideas welcome :-)

RoboDurden avatar Apr 27 '23 19:04 RoboDurden

Please open an issue at the repos: https://github.com/weiminshen99/GD32-hover-master-slave and I will add something as you requested there. Thanks!

weiminshen99 avatar Apr 28 '23 19:04 weiminshen99