diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.c b/arch/arm/src/lpc17xx/lpc17_usbhost.c index 351e78d42d..491be114f0 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -429,7 +429,7 @@ static struct lpc17_list_s *g_iofree; /* List of unused I/O buffers */ /* Pool and freelist of asynchronous transfer structures */ static struct lpc17_list_s *g_asynchfree; -static struct lpc17_list_s g_asynchbuffers[CONFIG_LPC17_USBHOST_NASYNCH]; +static struct lpc17_asynch_s g_asynchbuffers[CONFIG_LPC17_USBHOST_NASYNCH]; #endif /******************************************************************************* @@ -3499,7 +3499,7 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller) #ifdef CONFIG_USBHOST_ASYNCH /* Initialize asynchronous transfer structures */ - for (i = 0, asynch = (struct lpc17_asynch_s *)g_asynchbuffers; + for (i = 0, asynch = g_asynchbuffers; i < CONFIG_LPC17_USBHOST_NASYNCH; i++, asynch++) { diff --git a/configs/olimex-lpc1766stk/Kconfig b/configs/olimex-lpc1766stk/Kconfig index b86dd2342a..a5f1fd294f 100644 --- a/configs/olimex-lpc1766stk/Kconfig +++ b/configs/olimex-lpc1766stk/Kconfig @@ -4,4 +4,16 @@ # if ARCH_BOARD_LPC1766STK + +config LPC1766STK_USBHOST_STACKSIZE + int "USB host waiter stack size" + default 1536 if USBHOST_HUB + default 1024 if !USBHOST_HUB + depends on USBHOST + +config LPC1766STK_USBHOST_PRIO + int "USB host waiter task priority" + default 100 + depends on USBHOST + endif diff --git a/configs/olimex-lpc1766stk/README.txt b/configs/olimex-lpc1766stk/README.txt index 9f013df892..5a3a47fd2b 100644 --- a/configs/olimex-lpc1766stk/README.txt +++ b/configs/olimex-lpc1766stk/README.txt @@ -982,9 +982,10 @@ Configuration Sub-Directories When I ran into stack size issues, I just increased the size of all threads that had smaller stacks. - CONFIG_EXAMPLES_HIDKBD_STACKSIZE=2048 : Was 1024 - CONFIG_HIDKBD_STACKSIZE=2048 : Was 1024 - CONFIG_SCHED_HPWORKSTACKSIZE=2048 : Was 1024 (1024 is probably ok) + CONFIG_EXAMPLES_HIDKBD_STACKSIZE=2048 : Was 1024 + CONFIG_HIDKBD_STACKSIZE=2048 : Was 1024 + CONFIG_SCHED_HPWORKSTACKSIZE=2048 : Was 1024 (1024 is probably ok) + CONFIG_LPC1766STK_USBHOST_STACKSIZE=1536 | Was 1024 STATUS: 2015-04-26: The hub basically works. I do get crashes in the LPC16 USB host driver diff --git a/configs/olimex-lpc1766stk/src/lpc17_nsh.c b/configs/olimex-lpc1766stk/src/lpc17_nsh.c index 721d3382b5..0fa1413c17 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_nsh.c +++ b/configs/olimex-lpc1766stk/src/lpc17_nsh.c @@ -110,11 +110,11 @@ #endif #ifdef NSH_HAVEUSBHOST -# ifndef CONFIG_USBHOST_DEFPRIO -# define CONFIG_USBHOST_DEFPRIO 50 +# ifndef CONFIG_LPC1766STK_USBHOST_PRIO +# define CONFIG_LPC1766STK_USBHOST_PRIO 50 # endif -# ifndef CONFIG_USBHOST_STACKSIZE -# define CONFIG_USBHOST_STACKSIZE 1024 +# ifndef CONFIG_LPC1766STK_USBHOST_STACKSIZE +# define CONFIG_LPC1766STK_USBHOST_STACKSIZE 1024 # endif #endif @@ -275,8 +275,8 @@ static int nsh_usbhostinitialize(void) syslog(LOG_ERR, "ERROR: Start nsh_waiter\n"); - pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, - CONFIG_USBHOST_STACKSIZE, + pid = task_create("usbhost", CONFIG_LPC1766STK_USBHOST_PRIO, + CONFIG_LPC1766STK_USBHOST_STACKSIZE, (main_t)nsh_waiter, (FAR char * const *)NULL); return pid < 0 ? -ENOEXEC : OK; }