I am using keil 5.25, CMSIS RTX (not the RTX5), Stm32f103c8 BluePill board.
With keil project wizard, i am craating usb project.
I can compile without any warning or error.
When i load the project to the my board, i am getting unrecognetioned device error.
But if compile with rtx5 (nothing else changed) every thing works perfectly well.
What am i missing?
Here is my all source code;
/*---------------------------------------------------------------------------- * CMSIS-RTOS 'main' function template *---------------------------------------------------------------------------*/ #include "cmsis_os.h" // ARM::CMSIS:RTOS:Keil RTX #include "stm32f10x.h" // Device header #include "RTE_Device.h" // Keil::Device:Startup #include "RTE_Components.h" // Component selection #include "GPIO_STM32F10x.h" // Keil::Device:GPIO #include "rl_usb.h" // Keil.MDK-Plus::USB:CORE #include "Driver_USBD.h" // ::CMSIS Driver:USB Device #include "EventRecorder.h" // Keil.ARM Compiler::Compiler:Event Recorder #include "EventRecorderConf.h" // Keil.ARM Compiler::Compiler:Event Recorder #define osObjectsPublic // define objects in main module #include "osObjects.h" // RTOS object definitions /* * main: initialize and start the system */ int main (void) { // System Initialization SystemCoreClockUpdate(); #ifdef RTE_Compiler_EventRecorder // Initialize and start Event Recorder EventRecorderInitialize(EventRecordAll, 1U); #endif // ... osKernelInitialize (); // initialize CMSIS-RTOS // initialize peripherals here USBD_Initialize(0); USBD_Connect(0); Init_Thread(); osKernelStart (); // start thread execution }
This code just for test.
With this i might found the problem:
usbStatus usbstatus; ... ... usbstatus = USBD_Initialize(0); usbstatus = USBD_Connect(0); ... ...
I am getting usbThreadError error. What this mean?
Take a look here: www.keil.com/.../usb_resource_requirements.html
The USB error codes are listed on this page:
www.keil.com/.../group__status__error__codes__usb.html
"CMSIS-RTOS Thread creation/termination failed. "
You can use the component viewer for the RTOS to see to see what resources have allocated for your threads, and how much of those you are using:
www.keil.com/.../uv4_db_dbg_scvd_viewer.htm