Despite REQUIRES console vfs, I still get "undefined reference to esp_vfs_dev_cdcacm_set_rx_line_endings"

godzilla2
Posts: 19
Joined: Wed Apr 28, 2021 5:15 am

Despite REQUIRES console vfs, I still get "undefined reference to esp_vfs_dev_cdcacm_set_rx_line_endings"

Postby godzilla2 » Fri Sep 10, 2021 4:19 am

Hi,

I am trying to integrate the 'console' example into my project.

I can compile the example, just fine. But when I copy paste the code into my project, I get this error:

Code: Select all

undefined reference to esp_vfs_dev_cdcacm_set_rx_line_endings
I've hit these isssues before, and usually they are resolved by finding the right component and adding it to idf_component_register( .... REQUIRES "console" "vfs" ....) section of my CMakeLists.txt (See below).

But in this case, it does not work. I've tried moving things around a bunch, I cannot figure out why.

I'm using esp-idf 4.4 (Master) from June 25th 2021. I've also tried esp-idf 4.4 (Master) from Septempber 9th 2021. Same issue.

What could be causing this?

I've tired:
1. adding a REQUIRES "console" "vfs" to jcord-app (as opposed to jcord-common)
2. copying the vfs & console component directories into /jcord-firmware/jcord-app/components
3. updating esp-idf

My project is laid out like this:

Code: Select all

/esp-idf
/jcord-firmware
    /jcord-app
        CMakeLists.txt
        /main
            CMakeLists.txt
    /jcord-common
         CMakeLists.txt
/jcord-app/CMakeLists.txt

Code: Select all

# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

set(EXTRA_COMPONENT_DIRS "../jcord_common")
set(PROJECT_VER "0.5")

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(jcord_app)
/jcord-app/main/CMakeLists.txt

Code: Select all

idf_component_register(SRCS 
"pd_main.c" 
INCLUDE_DIRS 
".")
/jcord-common/CMakeLists.txt

Code: Select all

# Although unity is a submodule of cmock, we still depend on the unity component in IDF.
# This is because CI currently doesn't checkout submodules recursively.
idf_component_register(
SRCS 
"jcommon/jc_main.c"
 REQUIRES 
 "esp_http_server" 
 "fatfs" 
 "esp_wifi" 
 "esp_timer" 
 "json"
 "spi_flash" 
 "bootloader_support" 
 "app_update"
 "nvs_flash"
 "vfs"
 "console"
INCLUDE_DIRS "."
EMBED_FILES 
"jcommon/logs.html")

godzilla2
Posts: 19
Joined: Wed Apr 28, 2021 5:15 am

Re: Despite REQUIRES console vfs, I still get "undefined reference to esp_vfs_dev_cdcacm_set_rx_line_endings"

Postby godzilla2 » Fri Sep 10, 2021 4:44 am

I made a small test app that reproduces the issue with a single project. Maybe its some weird sdkconfig.
jtest.zip
(27 KiB) Downloaded 396 times

godzilla2
Posts: 19
Joined: Wed Apr 28, 2021 5:15 am

Re: Despite REQUIRES console vfs, I still get "undefined reference to esp_vfs_dev_cdcacm_set_rx_line_endings"

Postby godzilla2 » Fri Sep 10, 2021 5:16 am

Still debugging, but looks like I might want to use:

Code: Select all

esp_vfs_dev_uart_port_set_rx_line_endings
Looks like I accidentally copied my code from 'console_usb' instead of 'console'.

maldus
Posts: 84
Joined: Wed Jun 06, 2018 1:41 pm

Re: Despite REQUIRES console vfs, I still get "undefined reference to esp_vfs_dev_cdcacm_set_rx_line_endings"

Postby maldus » Mon Dec 02, 2024 1:47 pm

The solution is to set the serial output to `ESP_CONSOLE_USB_CDC`.

Who is online

Users browsing this forum: No registered users and 81 guests