Fujitsu MB91460 SERIES Application Note - Page 7

Browse online or download pdf Application Note for Motherboard Fujitsu MB91460 SERIES. Fujitsu MB91460 SERIES 29 pages. 32-bit microcontroller
Also for Fujitsu MB91460 SERIES: User Manual (45 pages), Getting Started (41 pages), Application Note (23 pages), Application Note (26 pages), Application Note (29 pages)

Fujitsu MB91460 SERIES Application Note
Note: For all other devices, including "others" the section SECURITY_VECTORS is located
from 0x14:8000 – 0x14:800F.
Example:
The security feature of target controller should be disabled.
#set
BOOT_FLASH_SEC

2.3 Stack Type and Stack Size (STACKUSE, ...)

2.3.1 STACKUSE

The setting STACKUSE specifies the stack type that is configured, when the application
main()-function is called. The devices of MB91460 Series provide two different types of
stack: system stack and user stack. The application can use either system stack only or it
can use both system stack and user stack.
System stack is always used for interrupt function. It is automatically selected, if hardware
interrupts are executed or if software interrupts are called. All stack operation of interrupt
handlers will work with the system stack.
Outside of interrupt handlers the pre-selected stack type is used. This is either user stack
(option USRSTACK) or system stack (option SYSSTACK). If SYSSTACK is set, only the
system stack area has to be prepared. All operation will work on the same stack. The
necessary safety margin has to be reserved for one stack only. SYSSTACK should be used,
if the necessary RAM consumption for stack has to be low. If USRSTACK is set, both
system stack and user stack have to be prepared. The necessary safety margin has to be
provided twice. USRSTACK should be used, if separated stack areas are necessary for
management reasons. This might be the case with schedulers, operating systems or other
applications.
Available settings for STACKUSE:
- USRSTACK
- SYSSTACK
Example:
The user stack should be used outside of interrupt handlers. This requires the setting.
#set
STACKUSE

2.3.2 STACK_RESERVE, STACK_SYS_SIZE, STACK_USR_SIZE

These settings specify the amount of bytes to be reserved for stacks. This value has to cover
all:
- parameters passed over stack
- return addresses for function calls
- local variables (except static)
- temporary data due to compiler optimization
- interrupt context on stacks
- safety margin
For estimating necessary stack size the compiler offers the "-INF stack" option. With it the
compiler generates stack information files (extension "stk"), which list the number of bytes
necessary to execute each function. These stack information files are already available for
© Fujitsu Microelectronics Europe GmbH
Start91460.asm
Chapter 2 Settings of the Start91460.asm
OFF
; <<< BOOT and Flash Security Vector
USRSTACK
- 7 -
; <<< set active stack
MCU-AN-300021-E-V10