Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 30, 2025

Fix: Use standard CMSIS constant for SCB SLEEPDEEP register access

Description

Addresses review feedback from #148: M33_SCR_SLEEPDEEP_BITS was used without proper definition. Replaced with standard CMSIS constant SCB_SCR_SLEEPDEEP_Msk and SCB->SCR register access.

Changes:

  • Added #include <cmsis_core.h> for Cortex-M targets
  • Replaced scb_hw->scr with SCB->SCR
  • Replaced M33_SCR_SLEEPDEEP_BITS with SCB_SCR_SLEEPDEEP_Msk
// Before
scb_hw->scr |= M33_SCR_SLEEPDEEP_BITS;

// After
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;

This follows the standard pattern used throughout Zephyr for ARM Cortex-M SCB register access.

Related Issues/Tickets

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Z Tests
  • Manual testing (describe steps)
    • Code compiles against CMSIS headers
    • Follows established Zephyr patterns (e.g., arch/arm/core/cortex_m/cpu_idle.c)

Screenshots / Recordings (if applicable)

N/A

Checklist

  • Written detailed sdd with requirements, channels, ports, commands, telemetry defined and correctly formatted and spelled
  • Have written relevant integration tests and have documented them in the sdd
  • Have done a code review with
  • Have tested this PR on every supported board with correct board definitions

Further Notes / Considerations

This is a stacked PR targeting #148. The CMSIS SCB_SCR_SLEEPDEEP_Msk constant is defined in core_cm33.h and included via cmsis_core.hcmsis_core_m_defaults.h for RP2350 (Cortex-M33) targets.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Contributor Author

Copilot AI commented Nov 30, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on Hibernation Mode implementation Fix: Use standard CMSIS constant for SCB SLEEPDEEP register access Nov 30, 2025
Copilot AI requested a review from yudataguy November 30, 2025 05:01
Copilot finished work on behalf of yudataguy November 30, 2025 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants