boscodog wrote on Friday, August 24, 2012:
I create the project using the built in wizard in LPCExpresso 4.2.3
the example has tow threads and was working fine, so the LPC1769 is working fine with FreeRTOS.
I did find some problems in the USB stack. One is the port.pin for the revB board is 2.9 and that fixed the pull up issue.
I also found that the HID endpoint descriptor must be FIXED_CONTROL_ENDPOINT_SIZE which is 64. I ported the descriptors from another project it the device only had a 32 byte endpoint 0.
I also found a hardcoded #define __REDLIB so I changed the build to include these
__REDLIB__
__USE_CMSIS=CMSISv2p00_LPC17xx
__LPC17XX__
USB_DEVICE_ONLY
DEBUG
__CODE_RED
The nxpUSBLib has a very weird build structure.
so now, the stack is now partially enumerating a HID device with my descriptors.
sometimes it will fully enumerate.
the thread is simple
xTaskCreate( vUserTask1, ( signed portCHAR * ) âTask1â, USERTASK_STACK_SIZE, NULL, 3, NULL );
stack size is 512
void vUserTask1(void *pvParameters)
{
USB_Connect();
while (1) {
HID_Device_USBTask(&My_HID_Interface);
USB_USBTask();
vTaskDelay(10);
}
}
since neither of these functions call any RTOS API I should not have to worry about ISR/RTOS issues, correct?
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 119000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 512 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 9 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 12 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0
#define configUSE_CO_ROUTINES 0
#define configUSE_MUTEXES 1
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
#define configUSE_COUNTING_SEMAPHORES 0
#define configUSE_ALTERNATIVE_API 0
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 10
#define configGENERATE_RUN_TIME_STATS 0
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1