Writing a multi-stack application that runs on multiple stacks

From ErikaWiki

Revision as of 09:46, 10 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/EEtest1

Description

  • The goal of this test is to activate two tasks that runs on different stacks to test the stack change mechanism implemented in 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) and the makefile. At the end of the porting the task set configuration will be deducted from the .oil file.
  • Finally, we created inside the EEtest1 a C file with a main() function very similar to the previous one. That function explicitly calls ActivateTask inside an infinite cycle. The main differences are in the eecfg.c file. The kernel functions must be linked and used without problems resulting in an fully linked executable file.
  • Note1: With this test we can evaluate the behaviour of the internal function: EE_s12xs_hal_ready2stacked 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 the threads and change the stacks properly.
  • In the reference test examples/s12xs/porting_examples/multistack/EEtest6 we'll test the internal function EE_s12xs_hal_stkchange.
    • This function can be found in the same file "ee_hal.S" and 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