Skip to content

regz: stride is not applied in cluster arrays #962

@kotokrad

Description

@kotokrad

In the code generated for nrf52840 structs in array have wrong size. For example, USBD.EPIN[n]:

    /// Unspecified
    /// offset: 0x600
    EPIN: [8]extern struct {
        /// Description cluster: Data pointer
        /// offset: 0x00
        PTR: mmio.Mmio(packed struct(u32) {
            /// Data pointer
            PTR: u32 = 0x0,
        }),
        /// Description cluster: Maximum number of bytes to transfer
        /// offset: 0x04
        MAXCNT: mmio.Mmio(packed struct(u32) {
            /// Maximum number of bytes to transfer
            MAXCNT: u7 = 0x0,
            padding: u25 = 0,
        }),
        /// Description cluster: Number of bytes transferred in the last transaction
        /// offset: 0x08
        AMOUNT: mmio.Mmio(packed struct(u32) {
            /// Number of bytes transferred in the last transaction
            AMOUNT: u7 = 0x0,
            padding: u25 = 0,
        }),
    },

Size of the struct is 12 bytes and no padding, when it should have 20 bytes stride:

<cluster>
    <dim>8</dim>
    <dimIncrement>0x014</dimIncrement>
    <name>EPIN[%s]</name>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions