MQX IAR Linker File does not have cstack

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX IAR Linker File does not have cstack

Jump to solution
919 Views
Roguetroop
Contributor I

I am using the IAR Workbench linker configuration files (.icf) provided with MQX and everything is working fine. I am able to run all of the examples and our custom firmware runs great. I am just curious as to how the examples run when the linker files do not have CSTACK. For example, the intflash_ddrdata.icf file provided by MQX has the following in it:

/*-Sizes-*/

define symbol __ICFEDIT_size_cstack__   = 0;

define symbol __ICFEDIT_size_heap__     = 0;

/**** End of ICF editor section. ###ICF###*/

...

define exported symbol __BOOT_STACK_ADDRESS = 0x2000FFF0 - 0x100;

Don't we need a stack before the RTOS is called? Is this created by the BSP somewhere? Is that what __BOOT_STACK_ADDRESS is for?

0 Kudos
1 Solution
642 Views
soledad
NXP Employee
NXP Employee

Hello John,

MQX stack usage and works with them looks like this: MQX run on supervisor mode. Supervisor mode stack and irq stack are set to BOOT_STACK area (size is 0x100) – this value depend on MQX startup sequence complexity – for example code which init MQX (scheduler, memory) and install/init device driver run with this stack – depend on real implementation and developer must know what he does when he changes something in BSP (like in init_hardware, bsp_enable_card functions).

Each task has own stack which are set in MQX task template list. IRQ stack is set by MQX, too – default value is set in BSP_DEFAULT_INTERRUPT_STACK_SIZE. When MQX runs, uses self defined stacks. Stacks size defines in linker file for supervisor and irq mode are important for startup only (BOOT_STACK)

we do not use CSTACK and HEAP – (IAR specific) MQX has own startup code which set stacks sizes.

User mode is not used and stack is not set.

Other stacks for modes like FIQ, Undefined, Abort, System  are set to minimal values, because they are not used – there is minimal implementation like infinity loop.

When someone want use these modes, they must set correct value for stacks size which depend on implemented functionality (developer has to know, what he implemented).


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
643 Views
soledad
NXP Employee
NXP Employee

Hello John,

MQX stack usage and works with them looks like this: MQX run on supervisor mode. Supervisor mode stack and irq stack are set to BOOT_STACK area (size is 0x100) – this value depend on MQX startup sequence complexity – for example code which init MQX (scheduler, memory) and install/init device driver run with this stack – depend on real implementation and developer must know what he does when he changes something in BSP (like in init_hardware, bsp_enable_card functions).

Each task has own stack which are set in MQX task template list. IRQ stack is set by MQX, too – default value is set in BSP_DEFAULT_INTERRUPT_STACK_SIZE. When MQX runs, uses self defined stacks. Stacks size defines in linker file for supervisor and irq mode are important for startup only (BOOT_STACK)

we do not use CSTACK and HEAP – (IAR specific) MQX has own startup code which set stacks sizes.

User mode is not used and stack is not set.

Other stacks for modes like FIQ, Undefined, Abort, System  are set to minimal values, because they are not used – there is minimal implementation like infinity loop.

When someone want use these modes, they must set correct value for stacks size which depend on implemented functionality (developer has to know, what he implemented).


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos