flo199213 / Hoverboard-Firmware-Hack-Gen2

Hoverboard Hack Firmware Generation 2 for the Hoverboard with the two Mainboards instead of the Sensorboards (See Readme.md).
GNU General Public License v3.0
140 stars 112 forks source link

Please add a makefile for my online compiler :-) #10

Open RoboDurden opened 4 years ago

RoboDurden commented 4 years ago

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 commented 4 years ago

no answer :'(

RoboDurden commented 4 years ago

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

renmalek7 commented 4 years ago

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

RoboDurden commented 4 years ago

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

RoboDurden commented 4 years ago

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

bricobi5 commented 2 years ago

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

RoboDurden commented 2 years ago

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 :-/

BastelPichi commented 2 years ago

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.

RoboDurden commented 2 years ago

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 :-)

BastelPichi commented 2 years ago

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 commented 1 year ago

Any update on this?

RoboDurden commented 1 year ago

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

BastelPichi commented 1 year ago

Ok, I broke my STLink anyways for now xD

weiminshen99 commented 1 year ago

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

RoboDurden commented 1 year ago

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...

weiminshen99 commented 1 year ago

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.

RoboDurden commented 1 year ago

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 commented 1 year ago

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.

weiminshen99 commented 1 year ago

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.

RoboDurden commented 1 year ago

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 toblockPWM' 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 commented 1 year ago

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 ?

weiminshen99 commented 1 year ago

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.

RoboDurden commented 1 year ago

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 :-)

weiminshen99 commented 1 year ago

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!