Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psp Integration candidate: 2021-04-06 #289

Merged
merged 10 commits into from
Apr 8, 2021
Merged

Conversation

astrogeco
Copy link
Contributor

@astrogeco astrogeco commented Apr 6, 2021

Describe the contribution

PR #286

Fix #171, use OSAL timebase for CFE timers

Cleans up stale code from the previous methods of generating 1Hz. Adds a new PSP module that instantiates an OSAL abstract timebase for use with cFE services. This single module is used across all psp implementations (mcp750, pc-linux, pc-rtems). Results in 1Hz timing tick on MCP750 will be more accurate. No changes to Linux or RTEMS

PR #282

Fix #10, modularize the ram, port, and eeprom access

Fixes segfaults when CFE_PSP_Port routines are invoked on Linux.

Converts cfe_psp_ram.c and cfe_psp_port.c into modular components and removes from the "shared" directory. The existing implementations become the corresponding "direct" module, and are enabled based on the psp module selection. Adds a "notimpl" variant where all the functions return CFE_PSP_ERR_NOT_IMPLEMENTED. This is used on Linux
or any other system where direct access is not possible. Renames the existing eeprom_stub module to be eeprom_notimpl for consistency and to avoid
confusion with the unit test stubs.

PR #285

Fix #266, psp module to implement timebase

No impact to behavior. Implements two PSP modules to provide CFE_PSP_GetTime and CFE_PSP_GetTimeBase, one for POSIX-compliant RTOS using clock_gettime() and the other specifically for PowerPC processors on VxWorks that have the vxTimeBaseGet() routine. Clarifies and documents the difference and use cases for CFE_PSP_GetTime and CFE_PSP_GetTimeBase.

Adds a coverage test for the VxWorks PSP timebase module and provides an example of how this can be implemented for other modules.

Additional context

Part of nasa/cFS#238

Tests

psp Checks https://github.com/nasa/PSP/pull/289/checks
cFS Bundle https://github.com/nasa/cFS/pull/238/checks

Third party code

None

Authors

jphickey and others added 4 commits March 29, 2021 13:46
Convert the current "cfe_psp_ram.c" and "cfe_psp_port.c" routines
into modular components, and remove from "shared" dir.

The existing implementations become the corresponding "direct"
module, and are enabled based on the psp module selection.

Also added is a "notimpl" variant, where all the functions
return CFE_PSP_ERR_NOT_IMPLEMENTED.  This is used on Linux
or any other system where direct access is not possible.

Note this also renames the existing "eeprom_stub" module
to be "eeprom_notimpl" for consistency and to avoid any
confusion with the unit test stubs.
Add a new PSP module that instantiates an OSAL abstract timebase
for use with cFE services.  This single module is then used
across all 3 implementations (mcp750, pc-linux, pc-rtems) and
does not need to be duplicated.
Clarifies the use case for CFE_PSP_GetTime and CFE_PSP_GetTimeBase.

Moves the implementation of these to separate PSP modules, so MCP750
on VxWorks can use the optimized vxTimeBaseGet() routine while
Linux and RTEMS can use the generic posix CLOCK_MONOTONIC.
Fix #171, use OSAL timebase for CFE timers
@astrogeco
Copy link
Contributor Author

@jphickey there's something strange happenning with the cmake generated platform_module_list.c:

/* This file is generated via CMake - do not edit in place */
#include "cfe_psp_module.h"

extern CFE_PSP_ModuleApi_t CFE_PSP_soft_timebase_API;
;extern CFE_PSP_ModuleApi_t CFE_PSP_eeprom_mmap_file_API;


CFE_StaticModuleLoadEntry_t CFE_PSP_BASE_MODULE_LIST[] =
{
{ .Name = "soft_timebase", .Api = &CFE_PSP_soft_timebase_API },
;{ .Name = "eeprom_mmap_file", .Api = &CFE_PSP_eeprom_mmap_file_API },

{ NULL }
};

/* END OF FILE */

See the extra semicolon after both soft_timebase entries

Re-add timebase name definition `CFE_PSP_SOFT_TIMEBASE_NAME` to `cfe_psp.h`
Fix #10, modularize the ram, port, and eeprom access
@astrogeco astrogeco force-pushed the integration-candidate branch 2 times, most recently from 5b57249 to 3664f88 Compare April 7, 2021 03:10
@astrogeco
Copy link
Contributor Author

Semicolon thingy fixed when I merged #282, I think there's similar logic in one of the CMakeLists files in cFE that may need to be updated to the string concatenate logic.

Clarifies the use case for CFE_PSP_GetTime and CFE_PSP_GetTimeBase.

Moves the implementation of these to separate PSP modules, so MCP750
on VxWorks can use the optimized vxTimeBaseGet() routine while
Linux and RTEMS can use the generic posix CLOCK_MONOTONIC.
@jphickey
Copy link
Contributor

jphickey commented Apr 7, 2021

Yes, the semicolon issue was a missing escape char (\) that I found as part of the #10 stuff - only showed up when using more than 1 module.

I think CFE is OK at this point.

Fix #266, psp module to implement timebase
@jphickey jphickey force-pushed the integration-candidate branch from d8b5907 to 5b57249 Compare April 7, 2021 16:54
@astrogeco astrogeco marked this pull request as ready for review April 8, 2021 18:59
@astrogeco astrogeco merged commit efef921 into main Apr 8, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Apr 8, 2021
Combines:

nasa/cFE#1284
nasa/osal#951
nasa/PSP#289

Including:

nasa/cFE#1251 - ES Info API Functional test

nasa/osal#931 - Scrub include guards
nasa/osal#937 - Switch to use CLOCK_REALTIME
nasa/osal#938 - specify shell name in ShellOutputToFile

nasa/PSP#286 - use OSAL timebase for CFE timers
nasa/PSP#282 - modularize the ram, port, and eenasa/psp#om access
nasa/PSP#285 - add psp module to implement timebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants