VESC, and B-G431B-ESC1 and stm32g4xx development progress...

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
jscott
Posts: 129
Joined: Tue Jul 03, 2012 3:50 pm
Location: Middle Georgia, USA
Contact:

VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby jscott » Sun Nov 24, 2019 9:48 pm

I just got a couple of the ST B-G431B-ESC1 eval boards and I am getting ready to start playing with them using the ST Motor Lib, and notices that there seems to be some work going on here for the st32g4xx chip.

How is the progress going on the hal?

JMifune, any progress on porting VESC? It would be great to run Chibios-VESC on the B-G431B-ESC1!

I can help do some testing through ChibiStudio if needed...

-John Scott

User avatar
Giovanni
Site Admin
Posts: 12949
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 733 times
Been thanked: 609 times
Contact:

Re: VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby Giovanni » Mon Nov 25, 2019 11:02 am

Hi,

STM32G4 support is in progress, in trunk there are already demos and many drivers are functional.

Giovanni

rreignier
Posts: 21
Joined: Sat Apr 15, 2017 11:49 pm
Has thanked: 7 times
Been thanked: 4 times

Re: VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby rreignier » Mon Nov 25, 2019 2:02 pm

jscott wrote:JMifune, any progress on porting VESC? It would be great to run Chibios-VESC on the B-G431B-ESC1!


I was not aware of this WIP port.

The first time I have seen B-G431B-ESC1, my first though was that it would be nice to port VESC on it.

If the porting effort is made publicly available, I might help working on it.

User avatar
Giovanni
Site Admin
Posts: 12949
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 733 times
Been thanked: 609 times
Contact:

Re: VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby Giovanni » Mon Nov 25, 2019 3:26 pm

Hi,

The effort is public, you need to checkout the trunk code. It is basically done except ADC and CANFD which require new drivers.

Giovanni

rreignier
Posts: 21
Joined: Sat Apr 15, 2017 11:49 pm
Has thanked: 7 times
Been thanked: 4 times

Re: VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby rreignier » Mon Nov 25, 2019 4:17 pm

Giovanni wrote:The effort is public, you need to checkout the trunk code. It is basically done except ADC and CANFD which require new drivers.


Sorry, I was talking about the VESC port.

Thank you

jscott
Posts: 129
Joined: Tue Jul 03, 2012 3:50 pm
Location: Middle Georgia, USA
Contact:

Re: VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby jscott » Mon Nov 25, 2019 5:09 pm

The stm32g431 port is really the key item to porting VESC to the B-G431B-ESC1.

Of course it uses both the ADC and the CAN interface. Although it can work without the CAN for starters, It needs the ADC.

I will start looking at the ADC drivers, but I haven't done any driver work on Chibios...

-John Scott

User avatar
Giovanni
Site Admin
Posts: 12949
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 733 times
Been thanked: 609 times
Contact:

Re: VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby Giovanni » Mon Nov 25, 2019 6:41 pm

Hi,

The ADC driver is quite complex, the G4 ADC should be a modification of the F3/L4 driver so it should happen soon enough.

Giovanni

rreignier
Posts: 21
Joined: Sat Apr 15, 2017 11:49 pm
Has thanked: 7 times
Been thanked: 4 times

Re: VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby rreignier » Thu Mar 05, 2020 2:27 pm

Hi jscott,

For your information, I have been working on porting the VESC firmware on the B-G431B-ESC1.

I had planned to do it on several steps:

  1. Update ChibiOS to get G4 support
  2. Switch to ST LL Driver instead of stdperiph F4 to get G4 support
  3. Make the VESC hardware work with it
  4. Shrink the FLASH and ROM footprint to fit in the G431
  5. Create a G431 hardware configuration
  6. Create a driver for the MOSFET drivers, different from the ones used in the VESC project

For now, I am still in steps 3 and 4 and will not have much time to continue soon.

Currently I have some timing issues and watchdog reset after updating to new ST libs, I need to investigate further the ADC part.

About the RAM and FLASH usage, the major consumers are the threads stacks and buffers for communication. I did not tried yet to reduced them but for now, the firmware does not fit in the B-G431B-ESC1, even by removing most features like IMU, NRF and even CAN and USB. And if the threads stacks are this big, maybe it was needed.

My work-in-progress is on my Github account here: https://github.com/romainreignier/bldc

  • branch update_libs: I used a script provided by ST to switch to LL driver
  • branch stm32g4_port: I did the port to ST LL Drivers manually
  • branch reduce_size: Some attempts to reduce the size of the firmware
  • branch minimal: I have deleted all unneeded features in order to reduce the firmware size

But I am not sure I will be able to update them soon, because I need a working BLDC controller for a project so I will either use original VESC or use ST Motor Workbench on the B-G431B-ESC1.

User avatar
Giovanni
Site Admin
Posts: 12949
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 733 times
Been thanked: 609 times
Contact:

Re: VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby Giovanni » Thu Mar 05, 2020 2:47 pm

Hi,

Have you considered NIL? it could help with memory usage.

Giovanni

rreignier
Posts: 21
Joined: Sat Apr 15, 2017 11:49 pm
Has thanked: 7 times
Been thanked: 4 times

Re: VESC, and B-G431B-ESC1 and stm32g4xx development progress...

Postby rreignier » Thu Mar 05, 2020 3:12 pm

Hi,

No, I did not consider NIL because I though that the OS was not the culprit for the memory usage.
If I find the time to investigate further, I might try it.
I think that the first step would be to try to reduce the stack size of the several threads, maybe they are big just to be comfortable and and the current target (F405TG) has plenty of memory.

Does the stack size should be a power of 2, like 2048 or 4096 or there is no problem to set a value between the two?

Thank you.


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 4 guests