Skip to content

chore: fix docs, adopt EMIL cortex_m runtime - #102

Merged
gabrielfrasantos merged 2 commits into
mainfrom
chore/emil-321a369-adopt-cortex-runtime
Aug 28, 2026
Merged

chore: fix docs, adopt EMIL cortex_m runtime#102
gabrielfrasantos merged 2 commits into
mainfrom
chore/emil-321a369-adopt-cortex-runtime

Conversation

@gabrielfrasantos

Copy link
Copy Markdown
Contributor

CLAUDE.md/AGENTS.md had been overwritten with content from the sibling hal-st (STM32) repo; restored hal-ti-specific docs and fixed the same stale hal_tiva/cortex/ references in the Copilot/orchestrator docs.

Bump the EMIL (embedded-infra-lib) pin to 8614b493 (one commit past the requested 321a369d, which predates EMIL adding DataWatchpointAndTrace).

Delete hal_tiva/cortex/{DataWatchpointAndTrace,EventDispatcherCortex, InterruptCortex} and reuse the equivalents now provided by EMIL's hal::cortex_m; trim hal_tiva/default_init (renamed hal_tiva/bringup) to just the Tiva-specific HardwareInitialization() glue, since EMIL's hal.cortex_m.runtime now covers the generic atomics shim, abort/assert, and libc syscall stubs. Reset/SystemTick/SystemTickTimerService/ TimeKeeper are relocated flat under hal_tiva/ (no EMIL replacement exists yet upstream) so hal_tiva/cortex/ can disappear entirely.

Known follow-up: EMIL's InterruptPriority::normal maps to a different hardware NVIC priority level (2) than the previous default (4) - verify against the TM4C datasheet before relying on it in ISR-heavy configurations.

…bringup

CLAUDE.md/AGENTS.md had been overwritten with content from the sibling
hal-st (STM32) repo; restored hal-ti-specific docs and fixed the same
stale hal_tiva/cortex/ references in the Copilot/orchestrator docs.

Bump the EMIL (embedded-infra-lib) pin to 8614b493 (one commit past the
requested 321a369d, which predates EMIL adding DataWatchpointAndTrace).

Delete hal_tiva/cortex/{DataWatchpointAndTrace,EventDispatcherCortex,
InterruptCortex} and reuse the equivalents now provided by EMIL's
hal::cortex_m; trim hal_tiva/default_init (renamed hal_tiva/bringup) to
just the Tiva-specific HardwareInitialization() glue, since EMIL's
hal.cortex_m.runtime now covers the generic atomics shim, abort/assert,
and libc syscall stubs. Reset/SystemTick/SystemTickTimerService/
TimeKeeper are relocated flat under hal_tiva/ (no EMIL replacement
exists yet upstream) so hal_tiva/cortex/ can disappear entirely.

Known follow-up: EMIL's InterruptPriority::normal maps to a different
hardware NVIC priority level (2) than the previous default (4) -
verify against the TM4C datasheet before relying on it in ISR-heavy
configurations.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 25, 2026 18:14
@gabrielfrasantos

gabrielfrasantos commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 5 0 0 0.11s
✅ CPP clang-format 6 0 0 0 0.23s
✅ CPP cppcheck 6 0 0 0.11s
✅ DOCKERFILE hadolint 1 0 0 0.05s
✅ JSON jsonlint 10 0 0 0.12s
✅ JSON prettier 10 7 0 0 0.69s
⚠️ MARKDOWN markdownlint 17 0 12 0 2.0s
✅ MARKDOWN markdown-table-formatter 17 0 0 0 0.36s
✅ REPOSITORY betterleaks yes no no 1.55s
✅ REPOSITORY checkov yes no no 20.7s
✅ REPOSITORY git_diff yes no no 0.1s
✅ REPOSITORY grype yes no no 66.35s
✅ REPOSITORY ls-lint yes no no 0.02s
✅ REPOSITORY secretlint yes no no 1.68s
✅ REPOSITORY syft yes no no 3.03s
✅ REPOSITORY trivy yes no no 11.25s
✅ REPOSITORY trivy-sbom yes no no 0.16s
✅ REPOSITORY trufflehog yes no no 3.41s
⚠️ SPELL lychee 43 2 0 1.08s
✅ YAML prettier 8 2 0 0 0.8s
✅ YAML v8r 8 0 0 6.33s
✅ YAML yamllint 8 0 0 0.81s

Detailed Issues

⚠️ SPELL / lychee - 2 errors
📝 Summary
---------------------
🔍 Total...........51
🔗 Unique..........34
✅ Successful......44
⏳ Timeouts.........0
🔀 Redirected.......8
👻 Excluded.........5
❓ Unknown..........0
🚫 Errors...........2
⛔ Unsupported......2

Errors in CONTRIBUTING.md
[ERROR] file://.github/CODEOWNERS (at 38:78) | File not found. Check if file exists and path is correct

Errors in README.md
[ERROR] file://.github/CODEOWNERS (at 57:212) | File not found. Check if file exists and path is correct

Hint: Followed 8 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
⚠️ MARKDOWN / markdownlint - 12 errors
.claude/agents/executor.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the executor agent for..."]
.claude/agents/orchestrator.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the orchestrator agent..."]
.claude/agents/planner.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the planner agent for ..."]
.claude/agents/reviewer.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the reviewer agent for..."]
.github/agents/executor.agent.md:11 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the executor agent for..."]
.github/agents/orchestrator.agent.md:18 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the orchestrator agent..."]
.github/agents/planner.agent.md:11 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the planner agent for ..."]
.github/agents/reviewer.agent.md:14 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the reviewer agent for..."]
.github/prompts/orchestrate.prompt.md:8:401 error MD013/line-length Line length [Expected: 400; Actual: 600]
.github/prompts/orchestrate.prompt.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Analyze the following task for..."]
AGENTS.md:74:401 error MD013/line-length Line length [Expected: 400; Actual: 712]
AGENTS.md:76:401 error MD013/line-length Line length [Expected: 400; Actual: 557]

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: REPOSITORY_GITLEAKS, REPOSITORY_KICS. See Removed linters to find their replacements.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.0.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CPPCHECK,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_LS_LINT,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adopts EMIL’s hal/cortex_m interrupt/runtime infrastructure across hal-ti, removing the repo’s local Cortex-M implementations and renaming/reducing the TI-specific startup glue to bringup/, while restoring/aligning project documentation.

Changes:

  • Switch TI drivers/core services from hal_tiva/cortex/* to EMIL hal/cortex_m/* (types, namespaces, IRQ storage).
  • Remove local Cortex-M components (InterruptCortex, EventDispatcherCortex, DataWatchpointAndTrace) and legacy default_init; add bringup/ with Tiva-specific HardwareInitialization() glue.
  • Update CMake, examples, and docs to reflect new targets/APIs and bump the EMIL pin.

Reviewed changes

Copilot reviewed 57 out of 58 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
README.md Update usage snippet to hal_ti_target_bringup()
hal_tiva/tiva/UartBase.hpp Use EMIL interrupt header/types; IRQ array type updated
hal_tiva/tiva/UartBase.cpp Use hal::cortex::InterruptTable; IRQ array element type updated
hal_tiva/tiva/SpiMaster.hpp Switch to EMIL interrupt types; IRQ array type updated
hal_tiva/tiva/SpiMaster.cpp IRQ array element type updated
hal_tiva/tiva/Pwm.hpp Switch interrupt types/priorities to EMIL equivalents
hal_tiva/tiva/Pwm.cpp Use hal::cortex::InterruptTable; IRQ storage type updated
hal_tiva/tiva/Gpio.hpp Use EMIL dispatched interrupt handler type
hal_tiva/tiva/Ethernet.hpp Use EMIL dispatched interrupt handler type
hal_tiva/tiva/Eeprom.hpp Switch base class to EMIL immediate interrupt handler
hal_tiva/tiva/Eeprom.cpp Use hal::cortex::InterruptTable; drop local interrupt include
hal_tiva/tiva/Dma.hpp Switch to EMIL interrupt handler base
hal_tiva/tiva/Dma.cpp Use hal::cortex::InterruptTable
hal_tiva/tiva/Can.hpp Switch base class/priority enum to EMIL equivalents
hal_tiva/tiva/Can.cpp Use hal::cortex::InterruptTable; IRQ array element type updated
hal_tiva/tiva/AnalogComparator.hpp Switch priority/handler types to EMIL equivalents
hal_tiva/tiva/AnalogComparator.cpp Use hal::cortex::InterruptTable; IRQ array element type updated
hal_tiva/tiva/Adc.hpp Switch base class/priority enum to EMIL equivalents
hal_tiva/tiva/Adc.cpp Use hal::cortex::InterruptTable; IRQ array element type updated
hal_tiva/TimeKeeper.hpp Relocate include to flattened hal_tiva/ path
hal_tiva/TimeKeeper.cpp Update include path after relocation
hal_tiva/SystemTickTimerService.hpp Switch to EMIL interrupt header
hal_tiva/SystemTickTimerService.cpp Use EMIL SysTick IRQ constant; update include path
hal_tiva/SystemTick.hpp Switch to EMIL interrupt header
hal_tiva/SystemTick.cpp Use EMIL SysTick IRQ constant; update include path
hal_tiva/synchronous_tiva/SynchronousUart.hpp Switch to EMIL interrupt handler base
hal_tiva/synchronous_tiva/SynchronousQuadratureEncoder.hpp Switch to EMIL interrupt handler types; IRQ array type updated
hal_tiva/synchronous_tiva/SynchronousQuadratureEncoder.cpp IRQ array element type updated
hal_tiva/Reset.hpp Relocate header to flattened hal_tiva/ path
hal_tiva/Reset.cpp Update include path after relocation
hal_tiva/instantiations/TracingReset.hpp Update include to relocated Reset header
hal_tiva/instantiations/EventInfrastructure.hpp Update include to relocated SystemTickTimerService header
hal_tiva/default_init/DefaultInit.cpp Deleted (runtime stubs + init moved to EMIL / bringup)
hal_tiva/default_init/CMakeLists.txt Deleted (target replaced by bringup)
hal_tiva/default_init/Atomic.cpp Deleted (atomics shim moved to EMIL runtime)
hal_tiva/cortex/InterruptCortex.hpp Deleted (replaced by EMIL hal/cortex_m)
hal_tiva/cortex/InterruptCortex.cpp Deleted (replaced by EMIL hal/cortex_m)
hal_tiva/cortex/EventDispatcherCortex.hpp Deleted (replaced by EMIL equivalents)
hal_tiva/cortex/EventDispatcherCortex.cpp Deleted (replaced by EMIL equivalents)
hal_tiva/cortex/DataWatchpointAndTrace.hpp Deleted (replaced by EMIL equivalents)
hal_tiva/cortex/DataWatchpointAndTrace.cpp Deleted (replaced by EMIL equivalents)
hal_tiva/cortex/CMakeLists.txt Deleted (folder/target removed)
hal_tiva/CMakeLists.txt Restructure: new hal_tiva.cortex composition + add bringup subdir
hal_tiva/bringup/CMakeLists.txt New bringup target + hal_ti_target_bringup() helper
hal_tiva/bringup/Bringup.cpp New TI-specific bringup glue (interrupt table + default pinout)
examples/terminal_uart_with_dma/CMakeLists.txt Switch to hal_ti_target_bringup()
examples/terminal_and_peripherals/CMakeLists.txt Switch to hal_ti_target_bringup()
examples/freertos/CMakeLists.txt Switch to hal_ti_target_bringup()
examples/blink/CMakeLists.txt Switch to hal_ti_target_bringup()
CMakeLists.txt Rename bringup option; bump EMIL pin
CLAUDE.md Restore hal-ti-specific instructions; point to AGENTS.md
AGENTS.md Add canonical agent rules for this repo
.github/prompts/orchestrate.prompt.md Update layer pointers after cortex/bringup restructuring
.github/copilot-instructions.md Update repo structure + target names to match new layout
.github/agents/reviewer.agent.md Update checklist item from default_init -> bringup
.github/agents/orchestrator.agent.md Update layer pointers after restructuring
.claude/agents/reviewer.md Update checklist item from default_init -> bringup
.claude/agents/orchestrator.md Update layer pointers after restructuring

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread hal_tiva/bringup/CMakeLists.txt Outdated
Comment thread hal_tiva/tiva/UartBase.hpp
Comment thread hal_tiva/CMakeLists.txt Outdated
Comment thread hal_tiva/CMakeLists.txt Outdated
… address PR review

EMIL's bump to b2ac7ed now provides hal::cortex::Reset, SystemTick, and
SystemTickTimerService under hal/cortex_m/ (previously only qemu-gated),
so the local hal_tiva/{Reset,SystemTick,SystemTickTimerService} copies
are deleted and their two real consumers (TracingReset, EventInfrastructure)
rewired to EMIL directly. EMIL's SystemTickTimerService requires an explicit
coreClockHz and a separate Start() call (no more auto-start-in-ctor), so
EventInfrastructure gained a coreClockHz parameter (defaulted to the extern
SystemCoreClock global, preserving existing call sites) and now calls
Start() itself.

hal_tiva/TimeKeeper had zero consumers in this repo (SynchronousUart only
depends on the abstract hal::TimeKeeper interface) and EMIL has no
explicit-injection equivalent (only the ambient-infra::Now()-based
TimeKeeperGeneric) - deleted outright rather than force-fit a mismatched
replacement.

The now-empty hal_tiva.cortex CMake target is removed; its four consumers
link hal.cortex_m directly.

Verified for real this time: previous "host build passes" checks never
actually compiled hal_tiva/ at all, since hal.cortex_m depends on ARM
Cortex-M inline assembly the host's x86 assembler rejects, and
target_link_libraries(hal_tiva.bringup ...) is EXCLUDE_FROM_ALL on host.
Built both tm4c1294ncpdt and tm4c123gh6pm embedded presets instead (real
ARM toolchain), which surfaced and fixed three real bugs left over from
the prior EMIL-adoption commit: UartBase.hpp's Config ctor still took an
unqualified InterruptPriority; Can.cpp's destructor passed the now-int32_t
irq straight to raw NVIC_DisableIRQ/ClearPendingIRQ (needs IRQn_Type);
Eeprom.hpp never included DEVICE_HEADER so EEPROM was undeclared. Also
fixed a real link failure: hal.cortex_m.runtime's OBJECT library objects
were never reaching the final executable through the hal.cortex_m STATIC
library boundary - added explicit $<TARGET_OBJECTS:hal.cortex_m.runtime>
to hal_ti_target_bringup().

Also addresses PR #102's Copilot review comments: hal_tiva.bringup is now
an OBJECT library (matches how it's actually consumed, instead of an
unused STATIC archive) and add_subdirectory(bringup) is now guarded by
HAL_TI_INCLUDE_BRINGUP so consumers can actually opt out as the option's
description already claimed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread .claude/settings.json
@gabrielfrasantos
gabrielfrasantos merged commit de8f153 into main Aug 28, 2026
5 checks passed
@gabrielfrasantos
gabrielfrasantos deleted the chore/emil-321a369-adopt-cortex-runtime branch August 28, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants