hi to all i am new in mdk5 and i want create a project with mdk5 and using cmsis::rtx rtos, i wrote a simple blinky program with cmsis::rtx and work well in simulator, but when i deploy it in my board it dose't work in my micro. my micro is lpc1788. can any one tell me how to fix that??, i must done another things or settings to fix that,pls help me. thanks for attention.
my code is as below
/*---------------------------------------------------------------------------- * CMSIS-RTOS 'main' function template *---------------------------------------------------------------------------*/ #define osObjectsPublic // define objects in main module #include <cmsis_os.h> #include "osObjects.h" // RTOS object definitions #include "GLCD.h" //graphic lcd lib #include "Driver_USART.h" //ARM::cmsis::drivers::usart interface #include "uart_setting.h" //setting of uart //defining functions void Usart_Callback(uint32_t event); void Uart_Thread(void const *argunment); extern int Init_Therads(void); void Initial_Uart(void); void init_system(void); //defining interface for usar2 extern ARM_DRIVER_USART Driver_USART2; //defining thereads osThreadId uart_Thread_Id; osThreadDef(Uart_Thread, osPriorityNormal, 1, 0); void Usart_Callback(uint32_t event) { switch(event) { case ARM_USART_EVENT_TX_COMPLETE: osSignalSet(uart_Thread_Id, 0x01); break; case ARM_USART_EVENT_RECEIVE_COMPLETE: break; } } void Uart_Thread(void const *argunment) { /*static ARM_DRIVER_USART * usart_drv = &Driver_USART2; usart_drv->Send("\nUsart Thread startted successfully", 35); osSignalWait(0x01,osWaitForever); usart_drv->Send("\nSending completed", 35);*/ int a = 0; int b = 0; for(;a < 10;a++) { b += 1; } while(1); } extern int Init_Therads(void) { //intilizing thread for controlling uart thread uart_Thread_Id = osThreadCreate(osThread(Uart_Thread), NULL); return 1; } void Initial_Uart(void) { static ARM_DRIVER_USART * usart_drv = &Driver_USART2; usart_drv->Initialize(Usart_Callback); usart_drv->PowerControl(ARM_POWER_FULL); usart_drv->Control(data_Bits | uart_Mode | parity_Bits | stop_Bits | hand_Shaking, uart_Baudrate); usart_drv->Control(ARM_USART_CONTROL_RX, 1); usart_drv->Control(ARM_USART_CONTROL_TX, 1); } void init_system(void) { //initilizing pherphelars SDRAM_32M_16BIT_Init(); GLCD_Init(); lcd_SetBacklight(50); GLCD_Clear(Black); Initial_Uart(); //intialzing therads Init_Therads(); } int main (void) { osKernelInitialize (); // initialize CMSIS-RTOS //initilizing system init_system(); //starting kernel osKernelStart (); // start thread execution }
when i using debuer, after calling init_system function my new thread added successfully to threads in system and thread viwer of mdk5, but after calling osKernelStart, debuger get in to rt_CMSIS file in below line and then it dose not done any thing else
// Thread Service Calls declarations SVC_2_1(svcThreadCreate, osThreadId, const osThreadDef_t *, void *, RET_pointer) SVC_0_1(svcThreadGetId, osThreadId, RET_pointer) SVC_1_1(svcThreadTerminate, osStatus, osThreadId, RET_osStatus) SVC_0_1(svcThreadYield, osStatus, RET_osStatus) SVC_2_1(svcThreadSetPriority, osStatus, osThreadId, osPriority, RET_osStatus) SVC_1_1(svcThreadGetPriority, osPriority, osThreadId, RET_osPriority)
Hi probsaeed sadeghpour,
Is the issue resolved. I too am facing same issue but on GCC ARM compiler. If you have solved the issue, can you post the solution.
Thanks, Satish.