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

Component support for 32-bit systems #3003

Open
ethancheez opened this issue Nov 1, 2024 · 1 comment
Open

Component support for 32-bit systems #3003

ethancheez opened this issue Nov 1, 2024 · 1 comment
Labels

Comments

@ethancheez
Copy link
Contributor

ethancheez commented Nov 1, 2024

F´ Version v3.5.0
Affected Component Svc.SystemResources, Svc.DpCatalog, Svc.DpWriter, Svc.DpManager, Svc.FileManager

Problem Description

On 32-bit systems, the components listed above implement 64-bit types (U64)

Context / Environment

Operating System: Linux
CPU Architecture: x86_64
Platform: Linux-4.4.0-22621-Microsoft-x86_64-with-glibc2.39
Python version: 3.12.3
CMake version: 3.30.5
Pip version: 24.0
Pip packages:
    fprime-tools==3.5.0
    fprime-gds==3.5.0
    fprime-fpp-*==2.2.0

How to Reproduce

When these macros are set:

#define FW_HAS_64_BIT    0 //!< Architecture supports 64 bit integers
#define FW_HAS_32_BIT    1 //!< Architecture supports 32 bit integers
#define FW_HAS_16_BIT    1 //!< Architecture supports 16 bit integers
#define FW_HAS_F64       0 //!< Architecture supports 64 bit floating point numbers

Expected Behavior

Check if architecture supports FW_HAS_64_BIT, use U64. Otherwise, use U32.

Is it possible to configure your project so that you only include the Svc components only if they are included in your instances.fpp file? i.e. My project instances.fpp does not use Svc.SystemResources, but the project still continues to build Svc.SystemResources which results in the U64 undefined error.

I can use:

set_target_properties(Svc_SystemResources PROPERTIES EXCLUDE_FROM_ALL TRUE)

But was wondering if there was a way to not build those components without inputting this line.

@ethancheez ethancheez added the bug label Nov 1, 2024
@ReggieMarr
Copy link

I think this is a good use case to push the development of displayable abstract types.
I was playing with this and I think rather than hardcoding a whole bunch of core types using a pattern like this might be more flexible for a wider range of platforms:

    # type SYSTEM_MAX_INT
    struct MEMORY_USAGE_S {
      TOTAL: FwSizeType
      USED: FwSizeType
      NV_TOTAL: FwSizeType
      NV_FREE: FwSizeType
    }

    @ Total system memory usage in KB
    telemetry MEMORY_USAGE: MEMORY_USAGE_S id 0

    @ System's CPU Percentage
    constant NUM_CORES = 15
    struct CPU_USAGE_S {
      AVG: F32,
      CORE: [NUM_CORES] F32
    }
    telemetry CPU_USAGE: CPU_USAGE_S id 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants