ESP-ADF and ESP-DSP
Posted: Thu Sep 26, 2019 10:53 pm
I've written some custom DSP code into a pipeline and I've run out of CPU time (even splitting across cores) so it would appear I need some optimized instructions to proceed further in my development.
In trying to load up ESP-DSP to see about integrating those optimized functions into my application, I've hit a snag. ESP-DSP doesn't compile as-is in my current setup.
I have tried with the downloaded toolchain (1.22.0-80-g6c4433a) as well as building the toolchain from source. My host system is ubuntu 18.04 and I'm working with a LyraT 4.3 board.
esp-idf version is at v3.3, adf (although unrelated since I'm just trying to build a dsp example outside of ADF for now) is currently v2.0-beta1-47-gdf76962
What version of esp-idf, esp-adf, esp-dsp, and xtensa-esp32-elf should I be using?
In trying to load up ESP-DSP to see about integrating those optimized functions into my application, I've hit a snag. ESP-DSP doesn't compile as-is in my current setup.
I have tried with the downloaded toolchain (1.22.0-80-g6c4433a) as well as building the toolchain from source. My host system is ubuntu 18.04 and I'm working with a LyraT 4.3 board.
esp-idf version is at v3.3, adf (although unrelated since I'm just trying to build a dsp example outside of ADF for now) is currently v2.0-beta1-47-gdf76962
What version of esp-idf, esp-adf, esp-dsp, and xtensa-esp32-elf should I be using?
- build@build:~/esp$ git clone https://github.com/espressif/esp-dsp.git
- Cloning into 'esp-dsp'...
- remote: Enumerating objects: 83, done.
- remote: Counting objects: 100% (83/83), done.
- remote: Compressing objects: 100% (49/49), done.
- remote: Total 1644 (delta 30), reused 65 (delta 29), pack-reused 1561
- Receiving objects: 100% (1644/1644), 340.85 KiB | 1.60 MiB/s, done.
- Resolving deltas: 100% (842/842), done.
- build@build:~/esp$ cd esp-
- esp-adf/ esp-dsp/ esp-idf/
- build@build:~/esp$ cd esp-dsp/examples/
- basic_math/ dotprod/ fft/ fft_window/ iir/ matrix/
- build@build:~/esp$ cd esp-dsp/examples/dotprod/
- build@build:~/esp/esp-dsp/examples/dotprod$ ls -al
- total 24
- drwxr-xr-x 3 build build 4096 Sep 26 18:37 .
- drwxr-xr-x 8 build build 4096 Sep 26 18:37 ..
- -rw-r--r-- 1 build build 308 Sep 26 18:37 CMakeLists.txt
- drwxr-xr-x 2 build build 4096 Sep 26 18:37 main
- -rw-r--r-- 1 build build 387 Sep 26 18:37 Makefile
- -rw-r--r-- 1 build build 1511 Sep 26 18:37 README.md
- build@build:~/esp/esp-dsp/examples/dotprod$ make -j4
- DEFCONFIG
- #
- # configuration written to /home/build/esp/esp-dsp/examples/dotprod/sdkconfig
- #
- MENUCONFIG
- *** End of the configuration.
- *** Execute 'make' to start the build or try 'make help'.
- GENCONFIG
- App "dotprod" version: v1.0
- CC build/app_trace/app_trace_util.o
- App "dotprod" version: v1.0
- CC build/app_update/esp_ota_ops.o
- CC build/app_trace/host_file_io.o
- CC build/app_trace/app_trace.o
- WARNING: Toolchain version is not supported: crosstool-ng-1.22.0-95-ge082013a
- Expected to see version: crosstool-ng-1.22.0-80-g6c4433a
- Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.
- Python requirements from /home/build/esp/esp-idf/requirements.txt are satisfied.
- CC build/app_update/esp_app_desc.o
- CXX build/asio/asio/asio/src/asio.o
- CC build/app_trace/gcov/gcov_rtio.o
- AR build/app_update/libapp_update.a
- AR build/aws_iot/libaws_iot.a
- CC build/bootloader_support/src/bootloader_flash.o
- AR build/app_trace/libapp_trace.a
- CC build/bt/bt.o
- CC build/bootloader_support/src/flash_qio_mode.o
- AR build/bt/libbt.a
- CC build/bootloader_support/src/secure_boot_signatures.o
- CC build/coap/libcoap/src/address.o
- CC build/bootloader_support/src/bootloader_utility.o
- CC build/bootloader/bootloader_support/src/bootloader_flash.o
- CC build/coap/libcoap/src/async.o
- CC build/bootloader/bootloader_support/src/flash_qio_mode.o
- CC build/bootloader_support/src/bootloader_common.o
- CC build/bootloader/bootloader_support/src/secure_boot_signatures.o
- CC build/coap/libcoap/src/block.o
- CC build/bootloader/bootloader_support/src/bootloader_init.o
- CC build/bootloader_support/src/secure_boot.o
- CC build/coap/libcoap/src/coap_time.o
- CC build/bootloader_support/src/bootloader_clock.o
- CC build/bootloader/bootloader_support/src/bootloader_utility.o
- CC build/bootloader_support/src/flash_partitions.o
- CC build/coap/libcoap/src/debug.o
- CC build/bootloader_support/src/esp_image_format.o
- CC build/bootloader/bootloader_support/src/bootloader_common.o
- CC build/coap/libcoap/src/encode.o
- CC build/bootloader_support/src/bootloader_sha.o
- CC build/bootloader/bootloader_support/src/secure_boot.o
- CC build/bootloader_support/src/flash_encrypt.o
- CC build/bootloader/bootloader_support/src/bootloader_clock.o
- CC build/coap/libcoap/src/hashkey.o
- CC build/coap/libcoap/src/mem.o
- CC build/bootloader/bootloader_support/src/flash_partitions.o
- CC build/bootloader/bootloader_support/src/esp_image_format.o
- CC build/bootloader_support/src/bootloader_random.o
- CC build/coap/libcoap/src/net.o
- AR build/bootloader_support/libbootloader_support.a
- CC build/coap/libcoap/src/option.o
- CC build/bootloader/bootloader_support/src/bootloader_sha.o
- CC build/bootloader/bootloader_support/src/flash_encrypt.o
- CC build/bootloader/bootloader_support/src/bootloader_random.o
- CC build/console/linenoise/linenoise.o
- CC build/coap/libcoap/src/pdu.o
- AR build/bootloader/bootloader_support/libbootloader_support.a
- CC build/bootloader/log/log.o
- AR build/bootloader/log/liblog.a
- CC build/coap/libcoap/src/resource.o
- CC build/bootloader/spi_flash/spi_flash_rom_patch.o
- CC build/console/argtable3/argtable3.o
- AR build/bootloader/spi_flash/libspi_flash.a
- CC build/bootloader/micro-ecc/micro-ecc/uECC.o
- CC build/coap/libcoap/src/str.o
- CC build/coap/libcoap/src/subscribe.o
- CC build/coap/libcoap/src/uri.o
- AR build/bootloader/micro-ecc/libmicro-ecc.a
- CC build/bootloader/soc/esp32/soc_memory_layout.o
- CC build/bootloader/soc/esp32/rtc_pm.o
- CC build/console/split_argv.o
- CC build/bootloader/soc/esp32/rtc_periph.o
- CC build/coap/port/coap_io_socket.o
- CC build/bootloader/soc/esp32/cpu_util.o
- CC build/console/commands.o
- CC build/bootloader/soc/esp32/sdmmc_periph.o
- CC build/bootloader/soc/esp32/rtc_wdt.o
- AR build/console/libconsole.a
- CXX build/cxx/cxx_guards.o
- AR build/coap/libcoap.a
- CXX build/cxx/cxx_exception_stubs.o
- CC build/bootloader/soc/esp32/sdio_slave_periph.o
- CC build/bootloader/soc/esp32/rtc_time.o
- CC build/bootloader/soc/esp32/spi_periph.o
- CC build/bootloader/main/bootloader_start.o
- CC build/bootloader/soc/esp32/rtc_init.o
- AR build/bootloader/main/libmain.a
- CC build/bootloader/soc/esp32/rtc_clk_init.o
- CC build/bootloader/efuse/esp32/esp_efuse_table.o
- CC build/bootloader/soc/esp32/gpio_periph.o
- CC build/bootloader/efuse/src/esp_efuse_api.o
- CC build/bootloader/soc/esp32/rtc_sleep.o
- CC build/bootloader/efuse/src/esp_efuse_utility.o
- CC build/bootloader/soc/esp32/rtc_clk.o
- AR build/cxx/libcxx.a
- CC build/bootloader/soc/src//memory_layout_utils.o
- CC build/bootloader/efuse/src/esp_efuse_fields.o
- CC build/driver/spi_master.o
- AR build/bootloader/soc/libsoc.a
- CC build/driver/sigmadelta.o
- AR build/bootloader/efuse/libefuse.a
- LD build/bootloader/bootloader.elf
- CC build/efuse/esp32/esp_efuse_table.o
- AR build/asio/libasio.a
- CC build/efuse/src/esp_efuse_api.o
- CC build/driver/uart.o
- esptool.py v2.8-dev
- CC build/driver/sdspi_transaction.o
- CC build/efuse/src/esp_efuse_utility.o
- CC build/efuse/src/esp_efuse_fields.o
- CC build/driver/sdio_slave.o
- AR build/efuse/libefuse.a
- CC build/esp-tls/esp_tls.o
- CC build/esp-dsp/modules/dotprod/float/dsps_dotprod_f32_ansi.o
- CC build/esp-dsp/modules/dotprod/float/dsps_dotprode_f32_ansi.o
- CC build/esp-dsp/modules/dotprod/fixed/dsps_dotprod_s16_ansi.o
- CC build/esp-dsp/modules/matrix/float/dspm_mult_f32_ansi.o
- AR build/esp-tls/libesp-tls.a
- CC build/driver/i2s.o
- CC build/esp-dsp/modules/matrix/fixed/dspm_mult_s16_ansi.o
- CC build/driver/periph_ctrl.o
- CC build/esp-dsp/modules/math/mulc/float/dsps_mulc_f32_ansi.o
- CC build/esp32/panic.o
- CC build/esp-dsp/modules/math/addc/float/dsps_addc_f32_ansi.o
- CC build/esp-dsp/modules/math/add/float/dsps_add_f32_ansi.o
- CC build/esp-dsp/modules/math/mul/float/dsps_mul_f32_ansi.o
- CC build/esp_adc_cal/esp_adc_cal.o
- CC build/esp-dsp/modules/math/sub/float/dsps_sub_f32_ansi.o
- CC build/esp32/esp_adapter.o
- CC build/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ansi.o
- AR build/esp_adc_cal/libesp_adc_cal.a
- CC build/esp32/event_default_handlers.o
- CC build/esp-dsp/modules/fft/fixed/dsps_fft2r_sc16_ansi.o
- CC build/esp-dsp/modules/support/misc/dsps_tone_gen.o
- CC build/driver/ledc.o
- CC build/esp32/task_wdt.o
- CC build/esp_event/default_event_loop.o
- CC build/esp-dsp/modules/support/misc/dsps_h_gen.o
- CC build/esp-dsp/modules/support/misc/dsps_d_gen.o
- CC build/esp_event/esp_event.o
- CC build/esp-dsp/modules/windows/hann/float/dsps_wind_hann_f32.o
- CC build/esp32/sleep_modes.o
- CC build/esp-dsp/modules/windows/blackman/float/dsps_wind_blackman_f32.o
- CC build/esp-dsp/modules/windows/blackman_harris/float/dsps_wind_blackman_harris_f32.o
- CC build/esp-dsp/modules/windows/blackman_nuttall/float/dsps_wind_blackman_nuttall_f32.o
- CC build/esp-dsp/modules/windows/nuttall/float/dsps_wind_nuttall_f32.o
- CC build/driver/spi_common.o
- CC build/esp_event/esp_event_private.o
- CC build/esp-dsp/modules/windows/flat_top/float/dsps_wind_flat_top_f32.o
- CC build/esp-dsp/modules/iir/biquad/dsps_biquad_gen_f32.o
- CC build/esp32/dbg_stubs.o
- AR build/esp_event/libesp_event.a
- CC build/esp-dsp/modules/iir/biquad/dsps_biquad_f32_ansi.o
- CC build/esp32/hw_random.o
- CC build/esp32/system_api.o
- CC build/esp-dsp/modules/fir/float/dsps_fird_f32_ansi.o
- CC build/driver/sdspi_host.o
- CC build/esp32/cache_sram_mmu.o
- CC build/esp-dsp/modules/fir/float/dsps_fird_init_f32.o
- CC build/esp-dsp/modules/fir/float/dsps_fir_f32_ansi.o
- CC build/esp-dsp/modules/fir/float/dsps_fir_init_f32.o
- CXX build/esp-dsp/modules/common/misc/dsps_pwroftwo.o
- CC build/esp_http_client/esp_http_client.o
- CC build/esp32/gdbstub.o
- CXX build/esp-dsp/modules/matrix/mat/mat.o
- CC build/driver/gpio.o
- CC build/esp32/int_wdt.o
- CC build/esp32/dport_access.o
- CC build/esp_http_client/lib/http_header.o
- /home/build/esp/esp-dsp/modules/matrix/mat/mat.cpp: In static member function 'static dspm::Mat dspm::Mat::bandSolve(dspm::Mat, dspm::Mat, int)':
- /home/build/esp/esp-dsp/modules/matrix/mat/mat.cpp:287:37: error: 'abs' is not a member of 'std'
- while ((k < A.cols) && (std::abs(A(j,k)) > abs_tol)) {
- ^
- /home/build/esp/esp-dsp/modules/matrix/mat/mat.cpp:287:37: note: suggested alternative:
- In file included from /home/build/esp/esp-idf/components/newlib/include/wchar.h:4:0,
- from /home/build/esp/crosstool-NG/builds/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/cwchar:44,
- from /home/build/esp/crosstool-NG/builds/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/postypes.h:40,
- from /home/build/esp/crosstool-NG/builds/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/char_traits.h:40,
- from /home/build/esp/crosstool-NG/builds/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/string:40,
- from /home/build/esp/crosstool-NG/builds/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/stdexcept:39,
- from /home/build/esp/esp-dsp/modules/matrix/mat/mat.cpp:15:
- /home/build/esp/esp-idf/components/newlib/include/stdlib.h:72:12: note: 'abs'
- int _EXFUN(abs,(int));
- ^
- CC build/driver/pcnt.o
- CC build/esp32/phy_init.o
- /home/build/esp/esp-idf/make/component_wrapper.mk:289: recipe for target 'modules/matrix/mat/mat.o' failed
- make[1]: *** [modules/matrix/mat/mat.o] Error 1
- /home/build/esp/esp-idf/make/project.mk:552: recipe for target 'component-esp-dsp-build' failed
- make: *** [component-esp-dsp-build] Error 2
- make: *** Waiting for unfinished jobs....
- CC build/driver/sdspi_crc.o
- CC build/esp_http_client/lib/http_auth.o
- CC build/esp_http_client/lib/http_utils.o
- CC build/driver/timer.o
- AR build/esp_http_client/libesp_http_client.a
- CC build/driver/rmt.o
- CC build/esp32/pm_trace.o
- CC build/esp32/cache_err_int.o
- CC build/driver/mcpwm.o
- CC build/esp32/esp_timer_esp32.o
- CC build/esp32/spiram_psram.o
- CC build/driver/sdmmc_transaction.o
- CC build/esp32/cpu_start.o
- CC build/esp32/clk.o
- CC build/esp32/freertos_hooks.o
- CC build/driver/can.o
- CC build/esp32/spiram.o
- CC build/driver/spi_slave.o
- CC build/driver/sdmmc_host.o
- CC build/esp32/crosscore_int.o
- CC build/esp32/fast_crypto_ops.o
- CC build/esp32/lib_printf.o
- CC build/esp32/ets_timer_legacy.o
- CC build/driver/i2c.o
- CC build/driver/rtc_module.o
- CC build/esp32/ipc.o
- CC build/esp32/intr_alloc.o
- CC build/esp32/restore.o
- CC build/esp32/reset_reason.o
- CC build/esp32/coexist.o
- CC build/esp32/pm_locks.o
- CC build/esp32/event_loop.o
- CC build/esp32/pm_esp32.o
- CC build/esp32/esp_err_to_name.o
- CC build/esp32/stack_check.o
- CC build/esp32/esp_timer.o
- CC build/esp32/wifi_init.o
- CC build/esp32/esp_himem.o
- AR build/driver/libdriver.a
- CC build/esp32/brownout.o
- CC build/esp32/hwcrypto/sha.o
- CC build/esp32/hwcrypto/aes.o
- AS build/esp32/dport_panic_highint_hdl.o
- AR build/esp32/libesp32.a