Forums » Req. WJ2(ESP32) support »
error: implicit declaration of function 'rt_InitInfAndNaN'
Added by Costantino Piva 16 days ago
Hello everyone, I'm encountering this error while building a project on ESP32. It's strange since the project is correctly built from my tutor's computer.
The problem apperas when I insert in my symulink model the following matlab function:
function p = movcorrFCN(x,y,k)
kb=k-1;
sumX=movsum(x,[kb 0]);
sumY=movsum(y,[kb 0]);
r=(k.*movsum(x.*y,[kb 0])-sumX.*sumY)./(sqrt(abs(k.*movsum(x.^2,[kb 0])-sumX.^2)).*sqrt(abs(k.*movsum(y.^2,[kb 0])-sumY.^2)));
rout=r(end,1);
isExceeding=abs(rout)>1;
rout(isExceeding)=rout(isExceeding)./abs(rout(isExceeding));
rout=abs(rout);
dof=k-2;
t=rout.*sqrt(dof./(1-rout.^2));
t=-abs(t);
p=tcdf(t,dof);
p=1-2*p;
p(isnan(p))=0;
p = movmedian(p,[99 0]);
end
The error that is thrown is the following:
Error:The call to esp32_make_rtw_hook, during the exit hook generated the following error:
An error occurred in Auto compile process. Please refer the log data above.
The build process will terminate as a result.
Caused by:
An error occurred in Auto compile process. Please refer the log data above.
It happens not only in this situation but also when I try to build the following subsystem
C:\waijung2\targets\esp32\setup\.espressif\tools\xtensa-esp32-elf\esp-2021r2-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -IC:/AAtest/Plant/CodeGen/ESACOubm_CodeGen3_esp32_build_system/build/config -IC:/AAtest/Plant/CodeGen/ESACOubm_CodeGen3_esp32_build_system/main/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/newlib/platform_include -IC:/waijung2/targets/esp32/setup/esp_idf/components/freertos/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/freertos/include/esp_additions/freertos -IC:/waijung2/targets/esp32/setup/esp_idf/components/freertos/port/xtensa/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/freertos/include/esp_additions -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_hw_support/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_hw_support/include/soc -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_hw_support/include/soc/esp32 -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_hw_support/port/esp32/. -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_hw_support/port/esp32/private_include -IC:/waijung2/targets/esp32/setup/esp_idf/components/heap/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/log/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/lwip/include/apps -IC:/waijung2/targets/esp32/setup/esp_idf/components/lwip/include/apps/sntp -IC:/waijung2/targets/esp32/setup/esp_idf/components/lwip/lwip/src/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/lwip/port/esp32/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/lwip/port/esp32/include/arch -IC:/waijung2/targets/esp32/setup/esp_idf/components/soc/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/soc/esp32/. -IC:/waijung2/targets/esp32/setup/esp_idf/components/soc/esp32/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/hal/esp32/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/hal/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/hal/platform_port/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_rom/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_rom/include/esp32 -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_rom/esp32 -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_common/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_system/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_system/port/soc -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_system/port/public_compat -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp32/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/xtensa/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/xtensa/esp32/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/driver/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/driver/esp32/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_pm/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_ringbuf/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/efuse/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/efuse/esp32/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/vfs/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_wifi/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_event/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_netif/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_eth/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/tcpip_adapter/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_phy/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_phy/esp32/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_ipc/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/app_trace/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_timer/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/mbedtls/port/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/mbedtls/mbedtls/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/mbedtls/esp_crt_bundle/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/app_update/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/spi_flash/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/bootloader_support/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/nvs_flash/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/pthread/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_gdbstub/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_gdbstub/xtensa -IC:/waijung2/targets/esp32/setup/esp_idf/components/esp_gdbstub/esp32 -IC:/waijung2/targets/esp32/setup/esp_idf/components/espcoredump/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/espcoredump/include/port/xtensa -IC:/waijung2/targets/esp32/setup/esp_idf/components/wpa_supplicant/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/wpa_supplicant/port/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/wpa_supplicant/esp_supplicant/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/ieee802154/include -IC:/waijung2/targets/esp32/setup/esp_idf/components/console -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -fmacro-prefix-map=C:/AAtest/Plant/CodeGen/ESACOubm_CodeGen3_esp32_build_system=. -fmacro-prefix-map=C:/waijung2/targets/esp32/setup/esp_idf=IDF -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.4.3-dirty\" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/ESACOubm_CodeGen3.c.obj -MF esp-idf\main\CMakeFiles\__idf_main.dir\ESACOubm_CodeGen3.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/ESACOubm_CodeGen3.c.obj -c C:/AAtest/Plant/CodeGen/ESACOubm_CodeGen3_esp32_build_system/main/ESACOubm_CodeGen3.c
C:/AAtest/Plant/CodeGen/ESACOubm_CodeGen3_esp32_build_system/main/ESACOubm_CodeGen3.c: In function 'ESACOubm_CodeGen3_step':
C:/AAtest/Plant/CodeGen/ESACOubm_CodeGen3_esp32_build_system/main/ESACOubm_CodeGen3.c:1036:10: warning: variable 'tmp_data_0' set but not used [-Wunused-but-set-variable]
int8_T tmp_data_0;
^~~~~~~~
C:/AAtest/Plant/CodeGen/ESACOubm_CodeGen3_esp32_build_system/main/ESACOubm_CodeGen3.c: In function 'ESACOubm_CodeGen3_initialize':
C:/AAtest/Plant/CodeGen/ESACOubm_CodeGen3_esp32_build_system/main/ESACOubm_CodeGen3.c:1491:3: error: implicit declaration of function 'rt_InitInfAndNaN' [-Werror=implicit-function-declaration]
rt_InitInfAndNaN(sizeof(real_T));
^~~~~~~~~~~~~~
cc1.exe: some warnings being treated as errors
[666/674] Linking C static library esp-idf\esp_timer\libesp_timer.a
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Executing action: all (aliases: build)
Running cmake in directory c:\aatest\plant\codegen\esacoubm_codegen3_esp32_build_system\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32 -DCCACHE_ENABLE=0 c:\aatest\plant\codegen\esacoubm_codegen3_esp32_build_system"...
Running ninja in directory c:\aatest\plant\codegen\esacoubm_codegen3_esp32_build_system\build
Executing "ninja all"...
- Build procedure for ESACOubm_CodeGen3 aborted due to an error.
Thank you in advance for your kind response
Replies (6)
RE: error: implicit declaration of function 'rt_InitInfAndNaN' - Added by Chandima Jayaneththi (จันทิมา) 15 days ago
Hello Costantino,
Is it possible to attach the Simulink model which you are using? It will be easier for us to test it from our end. In addition to that can you mention the MATLAB version you are using?
Best regards,
Chandima.
RE: error: implicit declaration of function 'rt_InitInfAndNaN' - Added by Costantino Piva 15 days ago
Hello Chandima,
yes of course I'll attach a simplified model that throws the same error. I'm using Matlab 2024a and I've installed waijung2 24.1a with the system patch (https://waijung2-doc.aimagin.com/patch-files.html).
Thank you.
RE: error: implicit declaration of function 'rt_InitInfAndNaN' - Added by Costantino Piva 10 days ago
Hello everyone,
do you have any update about my issue?
Thank you in advance
RE: error: implicit declaration of function 'rt_InitInfAndNaN' - Added by Chandima Jayaneththi (จันทิมา) 9 days ago
Hello Costantino,
Sorry for the late response. As a quick solution, could you please change the Language standard to C89/C90 (ANSI) in the model configuration parameters and build the model again? Let me know the results.
Best regards,
Chandima.
RE: error: implicit declaration of function 'rt_InitInfAndNaN' - Added by Costantino Piva 9 days ago
Hello Chandima,
Thank you for your answer, the quick fix is working and my project is built correctly. Could you explain me why with this setup works and with the other not? Thank you again.
Best reguards
RE: error: implicit declaration of function 'rt_InitInfAndNaN' - Added by Chandima Jayaneththi (จันทิมา) 9 days ago
Hello Costantino,
That's great to hear that it's working. I tested your Simulink model in MATLAB 2024a and 2022a. In 2024a, it fails due to some missing function in the generated C code. But those missing C functions are generated in 2022a as it is without changing that Language standard.There could be some internal updates in MATLAB/Simulink from 2022a to 2024a. By changing that Language standard (as a quick fix), it should work with 2024a.
Best regards,
Chandima