Skip to content

Conversation

jphickey
Copy link
Contributor

Describe the contribution
Fix #23

Adds a call to the SAMPLE_Function() provided by sample_lib as part of the example command processing.

This is to demonstrate two things:

  • For FSW, it shows that runtime linking is working as expected, not just for functions provided in the core/base (e.g. CFE,OSAL,PSP) but also for dynamically loaded libraries
  • For unit test, it provides a use-case for linking with stubs provided by an external library

Testing performed
Build with ENABLE_UNIT_TESTS=TRUE, both with SIMULATION=native and for a 32-bit raspberry pi target.
Execute CFE code, and confirm that everything starts normally. SAMPLE_LIB is loaded first, and SAMPLE_APP is loaded next and no runtime linking issues are reported.

Log snippet:

1980-012-14:03:20.25133 ES Startup: Loading shared library: /cf/sample_lib.so
SAMPLE Lib Initialized.  Version 1.1.0.0
1980-012-14:03:20.25164 ES Startup: Loading file: /cf/sample_app.so, APP: SAMPLE_APP
1980-012-14:03:20.25176 ES Startup: SAMPLE_APP loaded and created
EVS Port1 42/1/SAMPLE_APP 1: SAMPLE App Initialized. Version 1.1.1.0

Send the "PROCESS_CC` command and confirm that the function is invoked from SAMPLE_LIB:

1980-012-14:03:22.10319 Sample App: Table Value 1: 1  Value 2: 2
1980-012-14:03:22.10321 Sample App: CRC: 0xFFFF9C00
SAMPLE_Function called, buffer='SAMPLE DATA'

Expected behavior changes
The PROCESS_CC command now makes a call into the sample library.

System(s) tested on:
Ubuntu 18.04 LTS 64-bit

Contributor Info
Joseph Hickey, Vantage Systems, Inc.

Community contributors
You must attach a signed CLA (required for acceptance) or reference one already submitted

The CFE framework sample/lab applications did not have any
example use-cases where a _library_ function was invoked.

For the FSW verification aspect, it is important to do
this at least in one place as it verifies that the
run-time linking is working properly, not just for
functions in the core image but also for dynamically
loaded libraries.

The unit test framework also needs to support this use
case, to demonstrate that it can link against the stub
provided by the library for the local UT.

This just simply adds a call to the "SAMPLE_Function"
provided by sample_lib to demonstrate this.
@skliper skliper added this to the 1.2.0 milestone Dec 18, 2019
@skliper skliper added the CCB:Approved Indicates code approval by CCB label Dec 18, 2019
@skliper
Copy link
Contributor

skliper commented Dec 18, 2019

CCB 20191218 - Reviewed and approved for IC

@skliper skliper changed the base branch from master to merge-20191230 December 30, 2019 16:45
@skliper skliper merged commit 7c10e1a into merge-20191230 Dec 30, 2019
skliper pushed a commit that referenced this pull request Dec 30, 2019
Fix #23, #25, #28, #30
Reviewed and approved at 2019-12-18 CCB
@skliper skliper deleted the fix-23-call-sample-lib branch December 30, 2019 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code approval by CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants