I used the USB host library from Norimasa Okamoto ( https://developer.mbed.org/users/va009039/code/F401RE-USBHost/) for my FRDM K64 board and then a simple app to test the MSD.
When I insert the USB stick into the OTG port, I do not get any interrupts and no interrupt function is called. I tried with USB keyboard,but the same result.
I keep getting "Please attach USB device". Never the interrupt function got called USBHALHost::UsbIrqhandler();
used the same code as in the example(main.cpp of F401RE-USBHostMSD_HelloWorld) as below
main.cpp snippet
#include "USBHostMSD.h"
DigitalOut led1(LED_GREEN);
int main() {
USBHostMSD msd("usb");
if (!msd.connect()) {
error("USB Flash drive not found.\n");
}
FILE* fp = fopen("/usb/test1.txt", "a");
if (fp) {
fprintf(fp, "Hello from mbed.\n");
for(int i = 0; i < 21; i++) {
fprintf(fp, " %d", i);
led1 = !led1;
}
fprintf(fp, "\n");
fclose(fp);
}
fp = fopen("/usb/test1.txt", "r");
if (fp) {
int n = 0;
while(1) {
int c = fgetc(fp);
if (c == EOF) {
break;
}
printf("%c", c);
n++;
led1 = !led1;
}
fclose(fp);
printf("%d bytes\n", n);
}
while(1) {
led1 = !led1;
wait_ms(200);
}
}
Also for FRDM K64 the initialisation code also contains
MPU->CESR=0;
Why did not this work. Any clues or suggestions?
-yk
I used the USB host library from Norimasa Okamoto ( https://developer.mbed.org/users/va009039/code/F401RE-USBHost/) for my FRDM K64 board and then a simple app to test the MSD.
When I insert the USB stick into the OTG port, I do not get any interrupts and no interrupt function is called. I tried with USB keyboard,but the same result.
I keep getting "Please attach USB device". Never the interrupt function got called USBHALHost::UsbIrqhandler();
used the same code as in the example(main.cpp of F401RE-USBHostMSD_HelloWorld) as below
main.cpp snippet
Also for FRDM K64 the initialisation code also contains MPU->CESR=0;
Why did not this work. Any clues or suggestions?
-yk