jankae / LibreCAL

4 port eCal module
GNU General Public License v3.0
60 stars 19 forks source link

LibreCAL EmbeddedFirmware USB issue with pico-sdk 1.5 (LibreCAL-GUI impossible to connect) #11

Open bvernoux opened 1 year ago

bvernoux commented 1 year ago

With recent build of the firmware even on old code the LibreCAL GUI freeze during connection and USB connection is lost after few seconds. Issue description on recent Firmware built:

Investigation comparison with working/reference LibreCAL Firmware:

jankae commented 1 year ago

So you are suspecting that something in the toolchain has changed and it breaks? Not sure if I understood everything correctly... I'll try to replicate that.

jankae commented 1 year ago

Ok, looks like there has been a new release of the pico-sdk recently (1.5.0). The github action used the latest version of the SDK from the master branch. I am not sure what exactly the issue is with that new version (there are quite a few changes). My fix for now is to use the old version 1.4.0 in the toolchain, that one seems to produce the correct code. It is probably not a good idea to reference a potentially changing version of the SDK in the toolchain anyway, so using a specific version should result in more stable build outputs. And I don't think we need any of the new features of 1.5.0, so this could become the permanent solution.

bvernoux commented 1 year ago

Could you just try to force rebuild to check the binary/uf2 output (on same actual code) ? Do you reproduce the issue described (with latest pico-sdk) on your side too ?

jankae commented 1 year ago

I didn't compare the binaries but with the 1.5.0 SDK I could reproduce the same problem

bvernoux commented 1 year ago

I confirm that using pico-sdk 1.4.0 (sudo git -C /opt/pico-sdk checkout 1.4.0) fix the issue For information on my side I have tried several intermediate pico-sdk version without success (with same USB issue) and I have not identified the commit which break the USB... pico-sdk commit tested with USB broken:

So it will be interesting to understand what happen (and which commit break the USB) between working USB on pico-sdk 1.4.0 up to pico-sdk 1.5.0 with non working USB. There is clearly no hurry about that as we can live with pico-sdk 1.4.0 as like you say the pico-sdk 1.5.0 does not bring us anything new/better for LibreCAL

bvernoux commented 4 months ago

A new warning about that issue as I have discovered that if building LibreCAL with pico-sdk 1.4.0 on Ubuntu 22.04 LTS (instead of Ubuntu 20.04 LTS) produce broken Firmware (Creating File does not work ...) which seems to be related to the GCC ARM of Ubuntu 22.04 LTS...

Ubuntu 20.04.6 LTS GCC ARM (working fine): arm-none-eabi-gcc --version arm-none-eabi-gcc (15:9-2019-q4-0ubuntu1) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]

Ubuntu 22.04.3 LTS GCC ARM (note working produce broken Firmware): arm-none-eabi-gcc --version arm-none-eabi-gcc (15:10.3-2021.07-4) 10.3.1 20210621 (release)