TurtlPass / turtlpass-firmware-arduino

TurtlPass Firmware for Raspberry Pi Pico (RP2040)
GNU General Public License v3.0
9 stars 0 forks source link

Issue with FastLed #1

Closed hengbun closed 5 days ago

hengbun commented 2 weeks ago

Hello, When trying to compile the firmware i keep getting this error related to FastLed Library:

In file included from i:\Documents\Arduino\libraries\FastLED\src/led_sysdefs.h:38, from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:51, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\LedManager.h:6, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\BootselButton.h:5, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\BootselButton.cpp:1: i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/led_sysdefs_arm_rp2040.h:87: warning: "cli" redefined 87 #define cli() (saved_interrupt_status = save_and_disable_interrupts())
In file included from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\BootselButton.h:4: C:\Users****\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.0.1\cores\rp2040/Arduino.h:79: note: this is the location of the previous definition 79 #define cli() noInterrupts()
i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/led_sysdefs_arm_rp2040.h:88: warning: "sei" redefined 88 #define sei() (restore_interrupts(saved_interrupt_status))
C:\Users****\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.0.1\cores\rp2040/Arduino.h:78: note: this is the location of the previous definition 78 #define sei() interrupts()
In file included from i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/clockless_arm_rp2040.h:5, from i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/fastled_arm_rp2040.h:6, from i:\Documents\Arduino\libraries\FastLED\src/platforms.h:38, from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:62: i:\documents\arduino\libraries\fastled\src\platforms\arm\common\m0clockless.h: In function 'int showLedData(volatile uint32_t, uint32_t, const uint8_t, uint32_t, M0ClocklessData*)': i:\documents\arduino\libraries\fastled\src\platforms\arm\common\m0clockless.h:316:40: error: 'SysTick' was not declared in this scope 316 uint32_t ticksBeforeInterrupts = SysTick->VAL; ^~~ In file included from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:75: i:\Documents\Arduino\libraries\FastLED\src/fastspi.h: At global scope: i:\Documents\Arduino\libraries\FastLED\src/fastspi.h:172:23: note: '#pragma message: Forcing software SPI - no hardware SPI for you!' 172 # pragma message "Forcing software SPI - no hardware SPI for you!" ^~~~~~~~~~~~~ In file included from i:\Documents\Arduino\libraries\FastLED\src/led_sysdefs.h:38, from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:51, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\LedManager.h:6, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\LedManager.cpp:1: i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/led_sysdefs_arm_rp2040.h:87: warning: "cli" redefined 87 #define cli() (saved_interrupt_status = save_and_disable_interrupts())
In file included from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\LedManager.h:4: C:\Users****\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.0.1\cores\rp2040/Arduino.h:79: note: this is the location of the previous definition 79 #define cli() noInterrupts()
i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/led_sysdefs_arm_rp2040.h:88: warning: "sei" redefined 88 #define sei() (restore_interrupts(saved_interrupt_status))
C:\Users*****\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.0.1\cores\rp2040/Arduino.h:78: note: this is the location of the previous definition 78 #define sei() interrupts()
In file included from i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/clockless_arm_rp2040.h:5, from i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/fastled_arm_rp2040.h:6, from i:\Documents\Arduino\libraries\FastLED\src/platforms.h:38, from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:62: i:\documents\arduino\libraries\fastled\src\platforms\arm\common\m0clockless.h: In function 'int showLedData(volatile uint32_t, uint32_t, const uint8_t, uint32_t, M0ClocklessData*)': i:\documents\arduino\libraries\fastled\src\platforms\arm\common\m0clockless.h:316:40: error: 'SysTick' was not declared in this scope 316 uint32_t ticksBeforeInterrupts = SysTick->VAL; ^~~ In file included from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:75: i:\Documents\Arduino\libraries\FastLED\src/fastspi.h: At global scope: i:\Documents\Arduino\libraries\FastLED\src/fastspi.h:172:23: note: '#pragma message: Forcing software SPI - no hardware SPI for you!' 172 # pragma message "Forcing software SPI - no hardware SPI for you!" ^~~~~~~~~~~~~ In file included from i:\Documents\Arduino\libraries\FastLED\src/led_sysdefs.h:38, from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:51, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\LedManager.h:6, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\TTP223.h:13, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\TTP223.cpp:10: i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/led_sysdefs_arm_rp2040.h:87: warning: "cli" redefined 87 #define cli() (saved_interrupt_status = save_and_disable_interrupts())
In file included from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\LedManager.h:4: C:\Users*****\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.0.1\cores\rp2040/Arduino.h:79: note: this is the location of the previous definition 79 #define cli() noInterrupts()
i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/led_sysdefs_arm_rp2040.h:88: warning: "sei" redefined 88 #define sei() (restore_interrupts(saved_interrupt_status))
C:\Users*****\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.0.1\cores\rp2040/Arduino.h:78: note: this is the location of the previous definition 78 #define sei() interrupts()
In file included from i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/clockless_arm_rp2040.h:5, from i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/fastled_arm_rp2040.h:6, from i:\Documents\Arduino\libraries\FastLED\src/platforms.h:38, from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:62: i:\documents\arduino\libraries\fastled\src\platforms\arm\common\m0clockless.h: In function 'int showLedData(volatile uint32_t, uint32_t, const uint8_t, uint32_t, M0ClocklessData*)': i:\documents\arduino\libraries\fastled\src\platforms\arm\common\m0clockless.h:316:40: error: 'SysTick' was not declared in this scope 316 uint32_t ticksBeforeInterrupts = SysTick->VAL; ^~~ In file included from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:75: i:\Documents\Arduino\libraries\FastLED\src/fastspi.h: At global scope: i:\Documents\Arduino\libraries\FastLED\src/fastspi.h:172:23: note: '#pragma message: Forcing software SPI - no hardware SPI for you!' 172 # pragma message "Forcing software SPI - no hardware SPI for you!" ^~~~~~~~~~~~~ In file included from i:\Documents\Arduino\libraries\FastLED\src/led_sysdefs.h:38, from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:51, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\LedManager.h:6, from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\turtlpass-firmware.ino:46: i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/led_sysdefs_arm_rp2040.h:87: warning: "cli" redefined 87 #define cli() (saved_interrupt_status = save_and_disable_interrupts())
In file included from I:\Documents\GitHub\turtlpass-firmware-arduino\turtlpass-firmware\turtlpass-firmware.ino:41: C:\Users*****\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.0.1\cores\rp2040/Arduino.h:79: note: this is the location of the previous definition 79 #define cli() noInterrupts()
i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/led_sysdefs_arm_rp2040.h:88: warning: "sei" redefined 88 #define sei() (restore_interrupts(saved_interrupt_status))
C:\Users*****\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.0.1\cores\rp2040/Arduino.h:78: note: this is the location of the previous definition 78 #define sei() interrupts()

In file included from i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/clockless_arm_rp2040.h:5, from i:\Documents\Arduino\libraries\FastLED\src/platforms/arm/rp2040/fastled_arm_rp2040.h:6, from i:\Documents\Arduino\libraries\FastLED\src/platforms.h:38, from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:62: i:\documents\arduino\libraries\fastled\src\platforms\arm\common\m0clockless.h: In function 'int showLedData(volatile uint32_t, uint32_t, const uint8_t, uint32_t, M0ClocklessData*)': i:\documents\arduino\libraries\fastled\src\platforms\arm\common\m0clockless.h:316:40: error: 'SysTick' was not declared in this scope 316 | uint32_t ticksBeforeInterrupts = SysTick->VAL; | ^~~ In file included from i:\Documents\Arduino\libraries\FastLED\src/FastLED.h:75: i:\Documents\Arduino\libraries\FastLED\src/fastspi.h: At global scope: i:\Documents\Arduino\libraries\FastLED\src/fastspi.h:172:23: note: '#pragma message: Forcing software SPI - no hardware SPI for you!' 172 | # pragma message "Forcing software SPI - no hardware SPI for you!" | ^~~~~~~~~~~~~ Multiple libraries were found for "Keyboard.h" Used: C:\Users*\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.0.1\libraries\Keyboard Not used: C:\Users*\AppData\Local\Arduino15\libraries\Keyboard Not used: I:\Documents\Arduino\libraries\Keyboard exit status 1

Compilation error: exit status 1

Is there a spesific FastLED library version needed?

zackees commented 2 weeks ago

Post your code, and what board you are using and I'll try to repro.

The problem functions are used to control interrupts and are omitted when compiling for arduino, but somehow are finding their way into the project anyway.

hengbun commented 2 weeks ago

For the code, I just cloned the repo and following the Flashing RP2040 section on the readme, so the code is the same as is as this repo, the only thing that i do different is just the library installation for crypto(rweather/arduinolibs), because it can't be installed using git-url, so i just download it and install it manually.

zackees commented 1 week ago

I just did a fix for SysTick. Try it again and see if it's fixed now with the new release.

ryanamaral commented 5 days ago

Hey @hengbun, thanks for your question. Please update the FastLED library to the latest version - the version 3.7.6 should solve the compilation issue you're experiencing. Thank you @zackees 🙇‍♂️ for providing a fix for SysTick 🚀

To update from a command line, run: $ arduino-cli lib upgrade FastLED

I've also added the flag #define FASTLED_INTERNAL to remove the remaining annoying pragma messages during compilation.

ryanamaral commented 5 days ago

...the only thing that i do different is just the library installation for crypto(rweather/arduinolibs), because it can't be installed using git-url, so i just download it and install it manually.

Thanks for reporting this issue as well @hengbun. I've updated the 1-click-setup.sh script to handle the installation of the Crypto library (rweather/arduinolibs) via zip file instead.