cancel
Showing results for 
Search instead for 
Did you mean: 

using Keil RL-RTX with STemWin

sen2
Associate II
Posted on September 27, 2013 at 09:17

Dear Sir,

I'm using STM32F4-DISCOVERY. I've to run the STemWin on this board with keil RL-RTX. I've made all the necessary GUI and LCD configurations and have added GUI_X_RTX.c from the Segger folder in Keil uVision. I've packed the whole of the GUI part in a single task 'GRAPHICS' as follows in main function.

But my GRAPHICS task never runs.I'm not having any compiling or linking errors though.

How can I use KEIL RL-RTX to do this job?I found examples of implementing emWin with embos ang freertos kernel, but haven't found any hint or anything to do it with Keil RL-RTX. I've done all my project with this. so can't just swich to some other RTOS. My main.c looks like this.

''''

#include <RTL.h>

#include ''stm32f4xx.h''

#include ''stm32f4_discovery.h''

#include ''GUI.h''

#include ''bsp.h''

#include ''DIALOG.h''

OS_TID t_GRAPHICS;

OS_TID t_STEPPER;

extern void MainTask(void);

extern void LED_Init (void);

U16 COUNTER1;

/*********************************************************************

* Externals

*********************************************************************/

WM_HWIN CreateIntro(void);

uint8_t GUI_Initialized = 0;

* Main

*/

__task void GRAPHICS (void) {

os_evt_wait_and(0x0002,0xffff); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);

//STM32f4_Discovery_LCD_Init();

/* Initilize the BSP layer */ BSP_Init();

/* Activate the use of memory device feature */ WM_SetCreateFlags(WM_CF_MEMDEV);

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);

/* Init the STemWin GUI Library */ GUI_Init();

/*WM_SelectWindow(WM_HBKWIN); WM_SetDesktopColor(GUI_BLACK);*/

GUI_Initialized = 1;

MainTask(); for (;;);

}

__task void STEPPER (void) {

for(;;) {

os_evt_wait_and(0x0001,0xffff);

/* my code*/

}

}

void BSP_Background (void)

{ static uint32_t LED_ticks = 0; static uint32_t POINTER_ticks = 0;

if ( LED_ticks++ > 100 ) { LED_ticks = 0;

/* toggle LED1..4 each 100ms */ /* STM_EVAL_LEDToggle(LED4); STM_EVAL_LEDToggle(LED3); STM_EVAL_LEDToggle(LED5); STM_EVAL_LEDToggle(LED6);*/ }

if ( POINTER_ticks++ > 50 ) { POINTER_ticks = 0; /* Capture input event and updade cursor */ if(GUI_Initialized == 1) { BSP_Pointer_Update(); } }

}

#ifdef USE_FULL_ASSERT

/** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */

void assert_failed(uint8_t* file, uint32_t line)

{ /* User can add his own implementation to report the file name and line number, ex: printf(''Wrong parameters value: file %s on line %d\r\n'', file, line) */

/* Infinite loop */ while (1) {}

} #endif

void delay(__IO uint32_t nCount)

{ __IO uint32_t index = 0; for (index = (100000 * nCount); index != 0; index--);

}

__task void init (void) {

 

t_GRAPHICS= os_tsk_create(GRAPHICS,0);

t_STEPPER= os_tsk_create(STEPPER,1);

os_evt_set (0x0001, t_STEPPER);

os_tsk_delete_self (); }

int main (void) {

LED_Init();

os_sys_init (init); /* Initialize RTX and start init */} ''''

kindly someone help me to do this this....Just can't find what else I've to modify....

3 REPLIES 3
frankmeyer9
Associate II
Posted on September 27, 2013 at 10:14

I've packed the whole of the GUI part in a single task 'GRAPHICS' as follows in main function. But my GRAPHICS task never runs.I'm not having any compiling or linking errors though. How can I use KEIL RL-RTX to do this job?

 

If you are confident that the problem lies within the Keil RTOS, the Keil forum would be a much more appropriate place to ask.

Perhaps you can 'guard' your Gfx-task with GPIO toggling instructions before, to check with a scope what actually runs, and when.

sen2
Associate II
Posted on September 27, 2013 at 17:37

I'm confident because I've run the demo without rtos. I've seen 2 rtos examples of emwin, one with freertos and the other with embos. And they are quite different from each other. So can't take them as reference to modify for keil RTX. It looks like I'm running out of help this time. Still if there is anyone in this forum who can give some suggestion, it would be very helpful. Thanking in advance.

Posted on September 27, 2013 at 17:55

I've done all my project with this. so can't just swich to some other RTOS.

Then you probably have more experience than most here.

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STemWin%20on%20stm32f4%20discovery%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx&currentviews=90]Related?

http://www.keil.com/forum/23904/

Is there an adequate stack? Can you learn anything from the other implementations/tasks?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..