Skip to content

Conversation

soburi
Copy link
Owner

@soburi soburi commented Oct 5, 2025

Summary

  • include the FSP exception and device headers in soc.h so CMSIS types/macros exist before Zephyr's CMSIS validation runs, priming the RA4M1 core constants for the first include pass
  • override the FSP critical section macros to call Zephyr irq_lock/irq_unlock so vendor drivers share the kernel's locking semantics

Testing

  • cmake -Bbuild -S samples/hello_world -DBOARD=ek_ra4m1
  • cmake --build build

https://chatgpt.com/codex/tasks/task_e_68e1e24257ac8322ac3acd8eb5ec8291

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +52 to +55
#undef FSP_CRITICAL_SECTION_ENTER
#undef FSP_CRITICAL_SECTION_EXIT
#define FSP_CRITICAL_SECTION_DEFINE unsigned int fsp_irq_lock_key __maybe_unused
#define FSP_CRITICAL_SECTION_ENTER do { fsp_irq_lock_key = irq_lock(); } while (false)

Choose a reason for hiding this comment

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

P1 Badge Override FSP critical macros before including vendor headers

The Zephyr wrappers for FSP_CRITICAL_SECTION_* are defined only after bsp_api.h has been included. Inline helpers in the FSP headers (for example R_BSP_PinAccessEnable in bsp_io.h) expand these macros while the vendor defaults are still in force, so those helpers continue to manipulate PRIMASK/Basepri directly and never use irq_lock. This leaves most FSP code with its original interrupt semantics despite the change. Move the override ahead of the bsp_api.h inclusion so all inline functions pick up the Zephyr-aware macros.

Useful? React with 👍 / 👎.

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.

1 participant