vedderb / bldc

The VESC motor control firmware
2.18k stars 1.35k forks source link

Update gcc/gdb version #548

Open Teslafly opened 1 year ago

Teslafly commented 1 year ago

Some tools have depreciated the older version of gdb we use and the issue causing https://github.com/vedderb/bldc/issues/210 on newer versions of gcc have been fixed. So it may be worth upgrading toolchains now.

Tested with vesc 6.0 mk4 in windows. Detecting and running a motor works. Also successfully tested compilation in wsl linux. Mac not tested.

One things with the newer gcc version is it throws a lot more warnings about casts and implicit conversions.

closes #210

vedderb commented 1 year ago

It would be good to check how the binary size and performance changes with later versions of gcc. Last time I tried the binary would get quite a bit larger and the code got slightly slower.

vedderb commented 1 year ago

I gave it a try now on the same hw. As the last time I tried, the code got larger and slightly slower. For now I would prefer to stay with the old compiler for that reason. It would be great to know what is going on.

Compiler : 7.3.1

   text    data     bss     dec     hex
 428988    4300  173812  607100   9437c

LBM speed test 3x: ("Seconds elapsed: " {5.257800}) ("Seconds elapsed: " {5.276200}) ("Seconds elapsed: " {5.272000})

ADC interrupt test 3x with motor running: Latest injected ADC duration: 0.0239 ms Latest injected ADC duration: 0.0239 ms Latest injected ADC duration: 0.0243 ms


Compiler : 10.3.1

   text    data     bss     dec     hex
 445040    4304  173788  623132   9821c

LBM speed test 3x: ("Seconds elapsed: " {5.361800}) ("Seconds elapsed: " {5.375900}) ("Seconds elapsed: " {5.373300})

ADC interrupt test 3x with motor running: Latest injected ADC duration: 0.0239 ms Latest injected ADC duration: 0.0239 ms Latest injected ADC duration: 0.0251 ms

Teslafly commented 1 year ago

looking at the notes on releases since the gcc-arm-none-eabi-7-2018-q2-update release,

There is this which could be increasing the memory size. Thumb1 code size regression due to new register allocation: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59535 which may be fixed now in the 10.3-2021.10 version?

Otherwise the other notes seem nonrelevant. And it's mainly changes to mainline gcc that are getting pulled in. Which would be exploit vulnerability fixes, memory safety improvements, bux fixes and tool improvements.

Teslafly commented 1 year ago

Not a candidate for the fw6.0 release. But keeping this open to potentially include in the future. unless this should really be closed?

vedderb commented 1 year ago

We can leave this one open for now and revisit it later.