ccrause / fpc-esp-freertos

Mozilla Public License 2.0
20 stars 8 forks source link

undefined reference to `uxTaskGetSystemState' #10

Closed knakkie closed 1 week ago

knakkie commented 1 month ago

I am very happy with the possibility of programming ESP32 with Pascal! While compiling the example: “realtimestats´ I get the error message: (45,0) Error: linker: undefined reference to uxTaskGetSystemState' realtimestats.pp(63,0) Error: linker: undefined reference touxTaskGetSystemState' How can I solve this error?

I am using snapshot: esp-idf-4.3.3-win64-20220828

ccrause commented 1 month ago

I do most of my development and testing on Linux, so it is possible that the Windows snapshot was built with the wrong config. To use the uxTaskGetSystemState function requires enabling the CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS option in the esp-idf config.

This option is not enabled in the Windows build, which is unfortunate! As a work-around, you can replace the files in lib/xtensa-freertos/lx6/ with the contents of the libs/ folder in the Linux snapshot.

If this works, I can update the Windows snapshot with the Linux libs, else I have to rebuild the Windows snapshot which will take some time.

knakkie commented 1 month ago

Thank you, that was the solution! I have replaced the files in the lib/xtensa-freertos/lx6/ with the files from the Linux folder. There are more files in the lib/xtensa-freertos/lx6/ then in the Linux folder so I keep the files that are not in the Linux folder.

ccrause commented 3 weeks ago

Please test the new Windows snapshot. If it works this issue can be closed.

knakkie commented 1 week ago

Sorry for the late reply. I have installed the esp-idf-4.3. 7-win64 Snapshot. When I compile/build the Blink example I get the following error messages: Debug: C:\fpcupdeluxe_Esp32_522\cross\bin\xtensa-freertos\bin\xtensa-esp32-elf-ld.exe: C:\fpcupdeluxe_Esp32\fpc-esp-freertos-master\examples\blink\bin\blink.elf section .data' will not fit in regiondummy' Debug: C:\fpcupdeluxe_Esp32_522\cross\bin\xtensa-freertos\bin\xtensa-esp32-elf-ld.exe: region `dummy' overflowed by 20 bytes

ccrause commented 1 week ago

Debug: C:\fpcupdeluxe_Esp32_522\cross\bin\xtensa-freertos\bin\xtensa-esp32-elf-ld.exe: C:\fpcupdeluxe_Esp32\fpc-esp-freertos-master\examples\blink\bin\blink.elf section .data' will not fit in regiondummy' Debug: C:\fpcupdeluxe_Esp32_522\cross\bin\xtensa-freertos\bin\xtensa-esp32-elf-ld.exe: region `dummy' overflowed by 20 bytes

This should be fixed by commit d53a81e2 in FPC, but I haven't yet tested this on Windows.

knakkie commented 1 week ago

In the file "readme.txt" of the snapshot 4.3.7 you have to use "-WP4.3.3" in the "fpc.cfg" file, I changed this to "-WP4.3.7" and now the error message is gone. The "realtimestats" program I can now compile/build without problems

ccrause commented 1 week ago

Thank you for reporting the mistake in the readme, fixed in commit fb5ddca.

You are welcome to discuss your experience using FPC and ESP32 (or ask more questions) in the embedded board on the Lazarus forum.