Skip to content

stm32: Merge chip flash memory bank regions#282

Merged
mattnite merged 2 commits intoZigEmbeddedGroup:mainfrom
tact1m4n3:stm32-chip-memory-bug
Nov 22, 2024
Merged

stm32: Merge chip flash memory bank regions#282
mattnite merged 2 commits intoZigEmbeddedGroup:mainfrom
tact1m4n3:stm32-chip-memory-bug

Conversation

@tact1m4n3
Copy link
Collaborator

@tact1m4n3 tact1m4n3 commented Nov 9, 2024

Merge chip flash memory bank regions

The script used for generating all the chip definitions for the stm32 port doesn't merge some regions of flash memory belonging to the same bank. Take this example from a chip definition file in embassy-rs/stm32-data-generated. These regions have to be merged into a single MemoryRegion. This patch fixes this issue.

"memory": [
    {
      "name": "BANK_1_REGION_1",         <<<<<<<<<HERE
      "kind": "flash",
      "address": 134217728,
      "size": 65536,
      "settings": {
        "erase_size": 16384,
        "write_size": 4,
        "erase_value": 255
      }
    },
    {
      "name": "BANK_1_REGION_2",        <<<<<<<<<HERE
      "kind": "flash",
      "address": 134283264,
      "size": 65536,
      "settings": {
        "erase_size": 65536,
        "write_size": 4,
        "erase_value": 255
      }
    },
    {
      "name": "BANK_1_REGION_3",        <<<<<<<<<HERE
      "kind": "flash",
      "address": 134348800,
      "size": 393216,
      "settings": {
        "erase_size": 131072,
        "write_size": 4,
        "erase_value": 255
      }
    },
    {
      "name": "CCMRAM",
      "kind": "ram",
      "address": 268435456,
      "size": 65536
    },
    {
      "name": "SRAM",
      "kind": "ram",
      "address": 536870912,
      "size": 114688
    },
    {
      "name": "SRAM2",
      "kind": "ram",
      "address": 536985600,
      "size": 16384
    }
  ],

Copy link
Contributor

@mattnite mattnite left a comment

Choose a reason for hiding this comment

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

I'm not sure if the information on where the different regions are located is useful, but I'll allow this patch for now. We can break out that information to users some other way in the future.

@tact1m4n3 tact1m4n3 mentioned this pull request Nov 16, 2024
26 tasks
tact1m4n3 added a commit to tact1m4n3/microzig that referenced this pull request Nov 16, 2024
@tact1m4n3
Copy link
Collaborator Author

I would rather have this merged after #259 because they conflict and merging this afterwards would make it clearer what changes belonged to this patch.

@mattnite
Copy link
Contributor

@tact1m4n3 please fix the merge conflicts

@mattnite mattnite merged commit cef5757 into ZigEmbeddedGroup:main Nov 22, 2024
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