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

Enable pure YAML based workflow #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maximilian-maisel-bl
Copy link

Currently, chiptool generated PAC are missing top level peripherals and interrupt
definitions when used from a pure YAML workflow, i.e. without an SVD file, as in
the following command:

chiptool gen-block --input xmc4800.yml --output src/lib.rs

Such an approach is useful if no well-written SVD file is available for
the target MCU. For example, the XMC4800 SVD file calls all enumerated values
value1, value2 and so on resulting in a de-facto unusable PAC.

Since all IR already implements Serialize and Deserialize traits,
this workflow is enabled by reading/writing the IR Device block
from/to YAML as well as done in the PR.

A minimum working YAML looks like:

---
device/:
  nvic_priority_bits: 4
  peripherals:
  - name: SCU
    description: System Control Unit
    base_address: 0x50004000
    block: scu::Scu
  # [...]
  interrupts:
  - name: SCU_0
    description: System Control
    value: 0
  # [...]

# Below is chiptool YAML as usual
block/scu::Scu:
  description: System Control Unit
  items:
  - name: id
    description: ID register
    byte_offset: 0
    fieldset: scu::regs::Id
  - name: mirrsts
    description: Mirror Write Status Register
    byte_offset: 0xC4

fieldset/scu::regs::Id:
  description: ID register
  fields:
  - name: MOD_NUMBER
    description: Module Number
    bit_offset: 16
    bit_size: 16
#[...]

Without this PR, this YAML fails to load with
Unknown kind "device" at line 2 column 1.

Is this a suitable approach or did I miss a reason
why Device was intentionally not read/written from/to YAML?

This change enables pure YAML based PAC generation without SVD files.
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.

1 participant