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

Mbed CLI 2 USB no such file or directory #15476

Closed
iccentt opened this issue Dec 15, 2023 · 2 comments
Closed

Mbed CLI 2 USB no such file or directory #15476

iccentt opened this issue Dec 15, 2023 · 2 comments

Comments

@iccentt
Copy link

iccentt commented Dec 15, 2023

Description of defect

I tried to compile USB application on KL25Z and K64F without success.
The error output is:
main.cpp:2:10: fatal error: USBKeyboard.h: No such file or directory 2 | #include "USBKeyboard.h" | ^~~~~~~~~~~~~~~ compilation terminated. ninja: build stopped: subcommand failed. ERROR: CMake invocation failed!

Target(s) affected by this defect ?

KL25Z, K64F

Toolchain(s) (name and version) displaying this defect ?

GCC_ARM

What version of Mbed-os are you using (tag or sha) ?

6.17

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed-cli 2

How is this defect reproduced ?

`
#include "mbed.h"
#include "USBKeyboard.h"

USBKeyboard key;

#define WAIT_TIME_MS 500
DigitalOut led1(LED1);

int main()
{
while (true)
{
led1 = !led1;
thread_sleep_for(WAIT_TIME_MS);
}
}
`

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 15, 2023

Hi,

how did you create the example ? I wonder if there is usb component being added. In CMake, I would link to mbed-usb component.

This answer might help you : https://forums.mbed.com/t/mbed-os-6-14-include-usbserial/14623

@cyliangtw
Copy link
Contributor

For CLI 2, the attached CMakeList.txt could build USBSerial or USBKeyboard successfully.

CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Untriaged
Status: Done
Development

No branches or pull requests

4 participants