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

RL-RTX can not work with RL-FlashFs

I try to use RL-FlashFs read file from a SDcard

in a RL-rtx task.

It dosnot work.

Debug , Cannot go to main() .

RL-FlashFs Can work with RL-rtx?

Parents
  • I don't know much about this. But maybe:

    1. In RTX_Conf_LPCxxxx.c, please enable the "Check for the stack overflow". Make sure you provide enough space for all the stacks.

    2. os_sys_init() ->

    http://www.keil.com/support/man/docs/rlarm/rlarm_os_sys_init.htm

    [start]
    The os_sys_init function initializes and starts the Real-Time eXecutive (RTX) kernel.

    The os_sys_init function does not return. Program execution continues with the task identified by the task argument.
    [end]

    Since you choose to use an OS on your platform, it is better to initialize and start the (RTX) kernel first, before you do anything else.

Reply
  • I don't know much about this. But maybe:

    1. In RTX_Conf_LPCxxxx.c, please enable the "Check for the stack overflow". Make sure you provide enough space for all the stacks.

    2. os_sys_init() ->

    http://www.keil.com/support/man/docs/rlarm/rlarm_os_sys_init.htm

    [start]
    The os_sys_init function initializes and starts the Real-Time eXecutive (RTX) kernel.

    The os_sys_init function does not return. Program execution continues with the task identified by the task argument.
    [end]

    Since you choose to use an OS on your platform, it is better to initialize and start the (RTX) kernel first, before you do anything else.

Children
  • First thanks to try to answer to my question
    To Per Westermark : I'am not sure to understand what do you really mean. That's not I never get out of the main function, it's I never go in the main function. So I never go to the rest of my program which for the moment is very "light" because I have just an init task which launch a task that switch the led of my demo board.

    __task void led (void) {
    
      LED_Init (); /* Initialize LED display module    */
      for (;;) {
        LED_Out (leds);/* Update LED Driver  */
            leds=leds<<1;
            if(leds==0x10)
                    leds=0x01;
        os_dly_wait (20);
      }
    }
    
    __task void init (void) {
    
            static FILE *f = NULL;
    
            if (finit() == 0) {
            f = fopen ("M:\\toto.txt","w");
    
            if(f!=NULL)
                    fclose(f);
            }
      /* start task led */
      t_led    = os_tsk_create (led, 1);
      os_tsk_delete_self ();
    }
    
    
    int main (void) {
    
    os_sys_init (init);
    /* Initialize RTX and start init    */
    }
    

    To John Linq :
    I have

    #ifndef OS_STKCHECK
     #define OS_STKCHECK    1
    #endif
    


    but I check I never get into

    os_stk_overflow (OS_TID task_id)
    


    So I think there is no stack overflow (and moreover it is a really small program).

    next you are right I should do

    os_sys_init (init);
    


    before doing everything else so I put the "FlashFS" call in the init task (like I post). but that don't change anything.

    When I launch the program in debug mode I found that I go to

    void _sys_exit (int return_code) {
       /* Endless loop. */
       while (1);
    }
    

    and of course I stay in it because it's a "while(1)" that why I never go to main, I go to _sys_exit before the main function is call

  • Does the flash file system requires dynamic memory? In that case - have you supplied a large-enough heap?

  • yes it does. Keil report that you must define at least 0x400 bytes of heap.

  • Thanks a lot!!
    I forgot to set the heap size (it was 0x00) and now it seams to work well!!

    Thank you all.