Hi, i used cdc class for virtual com port, i configured some parameter, but the USBD_Initalize return usbThreadError, how can i solve it? version keil 5.10
www.keil.com/.../group__status__error__codes__usb.html usbThreadError - CMSIS-RTOS Thread creation/termination failed.
I don't yet look in Keil v5.10 closely, but it sounds like your firmware hits the limit of max number of tasks. This limit is given by OS_TASKCNT macro (RTX_Conf_CM.c) at Keil ver4 RL-RTX. Refer to this discussion on this topic http://www.keil.com/forum/23511/
Tsuneo
hi, Tsuneo, i found some code, but i don't know why memory pool is smaller than size? the last line, return NULL
void *rt_alloc_mem (void *pool, U32 size) { MEMP *p, *p_search, *p_new; U32 hole_size; if ((pool == NULL) || (size == 0)) return NULL; /* Add header offset to 'size' */ size += sizeof(MEMP); /* Make sure that block is 4-byte aligned */ size = (size + 3) & ~3; p_search = (MEMP *)pool; while (1) { hole_size = (U32)p_search->next - (U32)p_search; hole_size -= p_search->len; /* Check if hole size is big enough */ if (hole_size >= size) break; p_search = p_search->next; if (p_search->next == NULL) { /* Failed, we are at the end of the list */ return NULL; } }
i copied the usb HID (MCBSTM32E) example and test, but the result is same.
Hi: can you describe your system a bit more: - what microcontroller are you using? - are you using Keil board (and if so which one)?
In RTX_Conf_CM.c, i turned main thread and default thread stack size to 400, the problem solved. i am using stm32f103ze chip, not keil board.