2013-12-11 03:11 AM
i made a board with stm32f107re
and use example in st.com for usb host . but not work when connect usb flash disk in my board. i want make a board for read a file from usb flash disk and copy to sd card. please help me !! #think! #too-vague #debugging #think! #think! #stm32f107-usb-host2013-12-11 09:07 AM
Assume we know nothing about your board design and choices, or what specific software you have built and it's version, configuration, or settings.
2013-12-11 10:20 PM
i use STM32_USB-Host-Device_Lib_V2.1.0 example and select STM3210C-EVAL in project.
in my board use pin D+ and D- to connect usb flash disk. i see in my debuger in usb MSC init function . stop in 2-3 step in detect flash disk .2013-12-11 11:00 PM
''i see in my debuger in usb MSC init function . stop in 2-3 step in detect flash disk''
Again, we don't have any access to any of your source code, schematics, or anything else - so that gives us virtually nothing to go on.You, however, do have all that stuff - so you need to be digging into it and thinking what might cause this: Only you can see at what point, exactly, it's getting stuck - so you need to think about how it could get there, and what could be preventing it from moving on...Remember - the most important tool for debugging is the one between your ears!Here are some Debugging tips:
http://www.8052.com/faqs/120313
http://www.eetimes.com/discussion/break-point/4027526/Developing-a-good-bedside-manner?pageNumber=0
2013-12-12 07:27 AM
while (1)
{ /* Host Task handler */ USBH_Process(&USB_OTG_Core, &USB_Host); if(USB_Host.EnumState == ENUM_DEV_CONFIGURED) { if(first == 0) { f_mount(0,&myfat); // .. run it f_open(&dd,'''',FA_OPEN_ALWAYS); // first =1; ///// <<<<<< don't reach here } } if (i++ == 0x10000) { STM_EVAL_LEDToggle(LED1); STM_EVAL_LEDToggle(LED2); STM_EVAL_LEDToggle(LED3); STM_EVAL_LEDToggle(LED4); i = 0; } }2013-12-12 08:03 AM
So where does it stop?
What have you done to think about what may be stopping it? Don'tf_mount()
orf_open()
return error codes?2013-12-13 02:54 AM
f_open don't return value . because hang in this function . don't reach next line.
and led on my flash drive don't turn on in this example.2013-12-13 07:03 AM
You're still not thinking, are you?
''f_open don't return value . because hang in this function.''So what have you done to find where, exactly, it hangs?''led on my flash drive don't turn on in this example.''So think about that - what might it tell you?Is it likely that
f_mount()
will work properly if
f_open()
encountered a problem...?
2013-12-13 09:09 AM
Think about the size of the stack, and the routines in diskio.c that are performing the reads, and if those are completing.
If you break with the debugger, where is it stuck? Output some diagnostic messages via a serial port, or SWV channel.