This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTX Kernel Port M3

Hello,

I am porting the RTX Kernel to a Cortex-M3 device and ran into a difficulty.

I have set up 2 tasks to toggle 2 LEDs to see if my tasks are running as expected.
As below.

/*---------------------------------------------------------------------------- * Task 4 'blink_P2': Blink LED P2 *---------------------------------------------------------------------------*/
__task void blink_P2 (void)
{ os_itv_set (40); for (;;) { os_itv_wait (); Toggle_P2(); }
} /*---------------------------------------------------------------------------- * Task 5 'blink_P3': Blink LED P3 *---------------------------------------------------------------------------*/
__task void blink_P3 (void)
{ os_itv_set (40); for (;;) { os_itv_wait (); Toggle_P3(); }
}

If the time delay is set the same for both tasks then there is no problem.
Both tasks toggle each LED at 40mS. This works.

However if I change the time delay on one task,(for example the second task to 50mS) then both tasks now take several seconds to toggle the LEDs.

I have ported the RTX kernel previously to an ARM7 core without difficulty but cannot see the problem on the Cortex-M3 ?

Can someone advise please ?

thanks!

Parents
  • Thanks for the reply Marc,

    Yes only 2 tasks are setup.
    The init task sets up the 2 tasks as below and exits.

    /*----------------------------------------------------------------------------
     *        Task 4 'init': Initialize
     *---------------------------------------------------------------------------*/
    __task void init (void) {
      GPIO_INIT();
      t_blink_P2 = os_tsk_create (blink_P2, 0);    /* start task 'blink'               */
      t_blink_P3 = os_tsk_create (blink_P3, 1);    /* start task 'blink'               */
      os_tsk_delete_self ();
    }
    

    In the RTX_Conf_CM.c file it is as default except for :

    // </h>
    // <h>SysTick Timer Configuration
    // =============================
    //   <o>Timer clock value [Hz] <1-1000000000>
    //    Set the timer clock value for selected timer.
    //    Default: 6000000  (6MHz)
    #ifndef OS_CLOCK
     #define OS_CLOCK       16000000
    #endif
    
    //   <o>Timer tick value [us] <1-1000000>
    //    Set the timer tick value for selected timer.
    //    Default: 10000  (10ms)
    #ifndef OS_TICK
     #define OS_TICK        1000
    #endif
    

    thanks
    Mike

Reply
  • Thanks for the reply Marc,

    Yes only 2 tasks are setup.
    The init task sets up the 2 tasks as below and exits.

    /*----------------------------------------------------------------------------
     *        Task 4 'init': Initialize
     *---------------------------------------------------------------------------*/
    __task void init (void) {
      GPIO_INIT();
      t_blink_P2 = os_tsk_create (blink_P2, 0);    /* start task 'blink'               */
      t_blink_P3 = os_tsk_create (blink_P3, 1);    /* start task 'blink'               */
      os_tsk_delete_self ();
    }
    

    In the RTX_Conf_CM.c file it is as default except for :

    // </h>
    // <h>SysTick Timer Configuration
    // =============================
    //   <o>Timer clock value [Hz] <1-1000000000>
    //    Set the timer clock value for selected timer.
    //    Default: 6000000  (6MHz)
    #ifndef OS_CLOCK
     #define OS_CLOCK       16000000
    #endif
    
    //   <o>Timer tick value [us] <1-1000000>
    //    Set the timer tick value for selected timer.
    //    Default: 10000  (10ms)
    #ifndef OS_TICK
     #define OS_TICK        1000
    #endif
    

    thanks
    Mike

Children