Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fgetc does not work on esp32s3 on ttyACM0 (IDFGH-12503) #13513

Closed
3 tasks done
nopnop2002 opened this issue Mar 31, 2024 · 3 comments
Closed
3 tasks done

fgetc does not work on esp32s3 on ttyACM0 (IDFGH-12503) #13513

nopnop2002 opened this issue Mar 31, 2024 · 3 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@nopnop2002
Copy link

nopnop2002 commented Mar 31, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.2.1-210-gcf7b9bed4c

Espressif SoC revision.

ESP32S3 Development board

Operating System used.

Linux

How did you build your project?

Command line with CMake

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32S3 Development board

Power Supply used.

USB

What is the expected behavior?

fgetc does work on esp32s3 on ttyACM0.
fgetc does work on esp32c3 on ttyACM0.

What is the actual behavior?

fgetc does not work on esp32s3 on ttyACM0.
fgetc does not work on esp32c3 on ttyACM0.
fgetc does work on esp32s3 on ttyUSB0.
fgetc does work on esp32c3 on ttyUSB0.

Steps to reproduce.

Build this using ttyACM0.

#include <stdio.h>
#include <inttypes.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"

static const char *TAG = "MAIN";

void app_main()
{
    uint16_t c;
    while (1) {
        c = fgetc(stdin);
        if (c == 0xffff) {
            vTaskDelay(1);
            continue;
        }
        ESP_LOGI(TAG, "c=%x", c);
        vTaskDelay(1);
    }
}

Debug Logs.

Writing to serial is timing out. 
Please make sure that your application supports an interactive console and that you have picked the correct console for serial communication.

More Information.

This may be related.
#9974

@nopnop2002 nopnop2002 added the Type: Bug bugs in IDF label Mar 31, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Mar 31, 2024
@github-actions github-actions bot changed the title fgetc does not work on esp32s3 on ttyACM0 fgetc does not work on esp32s3 on ttyACM0 (IDFGH-12503) Mar 31, 2024
@ESP-Marius
Copy link
Collaborator

@nopnop2002 did you use CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG? As mentioned in ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG (the default setup) the seconday console cannot be used for input.

@nopnop2002
Copy link
Author

nopnop2002 commented Apr 1, 2024

thank you for your reply.

I can now use fgetc() by adding the following definition to sdkconfig.

CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y

However, no matter where I look in the menu, I cannot find the above item.
Is this a value that cannot be changed using menuconfig?

@ESP-Marius
Copy link
Collaborator

ESP-Marius commented Apr 2, 2024

It is located at Component config → ESP System Settings → Channel for console output.

If you have any issues finding kconfig options you can press / inside menuconfig to search for items.

Marking this issue as resolved then as the original problem seems to be answered. Feel free to reopen if there is anything else.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants