Upgrade to F Prime 4.3.0 - #508
Closed
nateinaction wants to merge 3 commits into
Closed
Conversation
- Bump lib/fprime to v4.3.0 and pull the matching tooling in via lib/fprime/requirements.txt. - fprime-zephyr: merge upstream (std::atomic shim for the lockless priority queue, RawTime rework, ADC driver) and reapply the install DESTINATION / FPRIME_INSTALL_DEST / counting-semaphore-stub changes that 4.3.0 needs. - fprime-extras: config modules can no longer depend on Fw_Types, since Fw/FPrimeBasicTypes.h now includes config-generated type aliases. - Refresh the project config overrides with the constants 4.3.0 added: CpuAffinities modules, FrameContext secondary-header/sequence-flag/PVN fields, SaIndexUnset, SequenceArgumentsMaxSize, FW_COUNTING_SEMAPHORE_HANDLE_MAX_SIZE, FW_STRICT_ASSERTIONS, FW_DIRECT_PORT_CALLS, FW_ASSERTIONS_ALWAYS_ABORT, FW_SERIALIZE_FORCE_INLINE_LBB and Svc::CmdDispatcherCfg. - Command handlers now take non-primitive arguments by const reference. - CmdSeqIn carries Svc::SeqArgs, so sequence start ports and callers pass it through. - Deployments model as FPP systems: add Top/system.fpp and mark the topology as a deployment topology. - Omit the telemetry channels 4.3.0 added (CS_CurrentSequence, FilesReceivedFailed, EventsDropped) from the packet set. - Zephyr builds C++14, which 4.3.0 requires.
Two runtime faults found on the bench with the upgraded firmware: - Keep indirect port calls. Enabling 4.3.0's FW_DIRECT_PORT_CALLS default reorders component initialization so LoadSwitch reads its GPIO before ZephyrGpioDriver has configured the pin spec, tripping a Zephyr __ASSERT in gpio_pin_get_dt and panicking the kernel during topology setup. The board enumerated USB but never downlinked a frame. - Use Fw::Buffer::advance() in TcSecurityDeframer. In 4.3.0 setData() implies advance(), which also shrinks the size, so the old setData(ptr + header) followed by setSize(size - header - trailer) subtracted the header twice. Uplinked commands then reached SpacePacketDeframer short by the header length and were rejected as malformed.
ModeManager::init() called loadState(), which drives the load switches via gpioGet_out/gpioSet_out. init() runs inside initComponents(), the first step of setupTopology -- before connectComponents() wires the ports and before configureTopology() opens the GPIO drivers. Reading an unconfigured gpio_dt_spec trips a Zephyr __ASSERT inside gpio_pin_get_dt and panics the kernel during startup, so the board enumerated USB but never downlinked a frame. Doing port I/O from init() was never valid; taking 4.3.0's FW_DIRECT_PORT_CALLS default of 1 just made it deterministic. Replace the init() override with restorePersistentState(), called from setupTopology() after configureTopology(), and turn direct port calls back on. Bench: 19 passed, 6 skipped, 4 failed -- identical to the indirect build, so no regression. Flash 64.64%, RAM 56.70%.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades the project to F´ 4.3.0, tracking nasa/fprime v4.3.0 and the matching fprime-zephyr#27.
What's here
lib/fprimeto v4.3.0 and pull the matching tooling vialib/fprime/requirements.txt.fprime-zephyr: merge upstream (std::atomicshim for the lockless priority queue,RawTimerework, ADC driver) and reapply the installDESTINATION/FPRIME_INSTALL_DEST/ counting-semaphore-stub changes 4.3.0 needs (see fprime-zephyr#27).fprime-extras: config modules can no longer depend onFw_Types, sinceFw/FPrimeBasicTypes.hnow includes config-generated type aliases.CpuAffinitiesmodules,FrameContextsecondary-header/sequence-flag/PVN fields,SaIndexUnset,SequenceArgumentsMaxSize,FW_COUNTING_SEMAPHORE_HANDLE_MAX_SIZE,FW_STRICT_ASSERTIONS,FW_DIRECT_PORT_CALLS,FW_ASSERTIONS_ALWAYS_ABORT,FW_SERIALIZE_FORCE_INLINE_LBBandSvc::CmdDispatcherCfg.constreference.CmdSeqIncarriesSvc::SeqArgs, so sequence start ports and callers pass it through.Top/system.fppand mark the topology as a deployment topology.CS_CurrentSequence,FilesReceivedFailed,EventsDropped) from the packet set.Two runtime faults found bringing the upgrade up on hardware, and their fixes:
FW_DIRECT_PORT_CALLSdefault reorders component initialization soLoadSwitchread its GPIO beforeZephyrGpioDriverhad configured the pin spec, tripping a Zephyr__ASSERTingpio_pin_get_dtand panicking the kernel during topology setup. The board enumerated USB but never downlinked a frame. Root cause wasModeManager::init()doing port I/O frominit()(which runs beforeconnectComponents()/configureTopology()) — that was never valid, direct port calls just made it deterministic. Fixed by moving the load-switch state restore intorestorePersistentState(), called fromsetupTopology()afterconfigureTopology(), so direct port calls could be turned back on.Fw::Buffer::setData()impliesadvance(), which also shrinks the size.TcSecurityDeframer's oldsetData(ptr + header)followed bysetSize(size - header - trailer)subtracted the header twice, so uplinked commands reachedSpacePacketDeframershort by the header length and were rejected. Fixed by usingFw::Buffer::advance()instead.Testing
Bench: 19 passed, 6 skipped, 4 failed — identical to the pre-upgrade indirect-port-call build, so no regression. Flash 64.64%, RAM 56.70%.