Home > User Support > CoverageMaster winAMS FAQ

CoverageMaster winAMS FAQ

Stub Functions

002_02: Function symbol error when trying to use a stub function.

Question:

I created stub functions using CoverageMaster, and then compiled and linked the source file. However, when I start the MPU simulator a function symbol error message appears and the stub function cannot be executed. How can I solve it?

Answer:

The stub function code may not be included in the executable object. The possible causes are:

1. "WINAMS_STUB" is not defined in the compiler's pre-processor settings.

The stub functions are enclosed with "#ifdef WINAMS_STUB" in the stub source file. Therefore, you need to define "WINAMS_STUB" in the cross compiler's pre-processor settings to build the stub functions.

2. The linker's optimization removed the stub object code.

The stub functions are isolated and not called by the application. In this case, the stub function code may not be linked. To avoid this problem, we will add dummy code to the stub function source file so that the stub functions will be linked.

For example, if stub functions named AMSTB_func1, AMSTB_func2 and AMSTB_func3 exist, add the following code to the end of the stub function source file.

volatile int (*dummyfunc[])() = { AMSTB_func1, AMSTB_func2, AMSTB_func3 };


Related Technical Tips Search

Other technical tips in GAIO's web site can be searched for using the links below.

Search key word link: Stub Execution
Technical Tips Google Search


Information Links