Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 1 month ago.
FRDM K64- USB host No interrupts
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?
Regds Yk
Has anyone got the USB host working with FRDM K64 board specifically(either a MSD or keyboard or any other class) using any particular host library in mbed ? nice to know on this.
Regards yk
posted by yogesh kulkarni 04 Mar 2016