Writing a multi-stack application that runs on a single stack

From ErikaWiki

Revision as of 18:40, 9 December 2009 by Erikadds (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Reference test

examples/s12xs/porting_examples/multistack/EEtest0

Description

  • The goal of this test is to activate two tasks that share the same stack to test the internal function ready2stacked in MULTISTACK case. To configure the task set we change the files eecfg.h and eecfg.c located inside the Debug folder (the basic structure is inspired to the Microchip PIC30 port). At the end of the porting the task set configuration will be deducted from the .oil file.
  • Finally, we created inside the EEtest0 a C file with a main() function. That function explicitly calls ActivateTask finishing with a for(;;). Please note that this small application can be executed to test the behavior of the kernel internal function ready2stacked and also the compilation chain. The function must be linked and used without problems resulting in an executable fully linked.
  • Note1: At this point we have to write two functions: EE_s12xs_hal_ready2stacked and EE_s12xs_hal_stkchange located in the source file "ee_hal.S" at the path ee\pkg\cpu\cosmic_hs12xs\src.
    • the function EE_s12xs_hal_ready2stacked is used to:
      • call a thread and change the stack
    • the function EE_s12xs_hal_stkchange is used to:
      • change the stack to resume a stacked thread.

Expected output

When everything is done in the right way, with the following commands we can have the executable file:

  • open a Cygwin shell
  • cd into the Debug directory
  • the commands make clean and make all should work correctly producing an executable inside the Debug directory.

To simulate the application we can use directly the hardware or a "good" software debugger.

Personal tools