This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS: sys bios main() stack



Tool/software: TI-RTOS

Hi

I have a very big object that configures almost everything once created. When I create it in the following way ;

BigCls BigObj; // this creates task, initializes ndk, stacks, etc..

main(){

Bios_start();

}

it works fine.

However, following gives instruction fetch exception;

main() {

BigCls BigObj; // this creates task, initializes ndk, stacks, etc..

Bios_start();

}

I suspect stack overflow for the main() function. Which stack does it use?  Program.stack? I need to increase its size.

What about the first case(global creation)? Which stack does it use?

regards, Mustafa

  • Hi Mustafa,


    napyonsen said:

    However, following gives instruction fetch exception;

    main() {

    BigCls BigObj; // this creates task, initializes ndk, stacks, etc..

    Bios_start();

    }

    Did you mean to post the exception output you are seeing?

    napyonsen said:

    have a very big object that configures almost everything once created. When I create it in the following way ;

    BigCls BigObj; // this creates task, initializes ndk, stacks, etc..

    main(){

    Bios_start();

    }

    it works fine.

    Can you please provide some more detail on this?  How is this object performing all of this set up?

    Steve

  • Exception is cpu exception and prints out cpu registers (all 64 registers in 6678).
    Setup is done etiher in big object constructor or via other objects (in their constructor) it aggregates.

    By the way, I wonder which stack this constructors use in both cases?

    regards, Mustafa
  • Please see the following FAQ for how to debug the exception you're hitting:

    processors.wiki.ti.com/.../BIOS_FAQs

    Steve
  • Ok. Steve.
    I am actually more interested in my questions. If you know the answer, can you please suggest an answer, if not, please redirect the question to other guys.
    Regards, mustafa
  • napyonsen said:
    I suspect stack overflow for the main() function. Which stack does it use?  Program.stack? I need to increase its size.

    Yes, the main() function uses the system stack.  This is governed by Program.stack.  However, be careful because any local variables you have on the stack in main() will be overwritten once BIOS_start() is called.  See here for more info.

    napyonsen said:
    What about the first case(global creation)? Which stack does it use?

    It depends on whether or not such a global variable is initialized or not.  Uninitialized variables would be placed into the .bss section.  Initialized variables like this would go into the .data section.

    In your case, it's uninitialized so it should go into .bss.

    You can confirm this by looking at your project's *.map file (under the "Debug/" or "Release" folder of your project).

    Steve

  • Hi Steve,

    Second case is clear. For the first case , I did not mean variable initialization but the class constructor function and its stack . Anyway, I will check it from .map file.
    thanks
    mustafa