-
Notifications
You must be signed in to change notification settings - Fork 147
Add wolfBoot port for STM32N6 (NUCLEO-N657X0-Q) #720
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
Open
aidangarske
wants to merge
1
commit into
master
Choose a base branch
from
stm32n6-port-wolfboot
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| ARCH?=ARM | ||
| TARGET?=stm32n6 | ||
| SIGN?=ECC256 | ||
| HASH?=SHA256 | ||
| DEBUG?=0 | ||
| VTOR?=1 | ||
| NO_ASM?=0 | ||
| NO_MPU=1 | ||
| SPI_FLASH?=0 | ||
| ALLOW_DOWNGRADE?=0 | ||
| NVM_FLASH_WRITEONCE?=0 | ||
| WOLFBOOT_VERSION?=1 | ||
| V?=0 | ||
| SPMATH?=1 | ||
| RAM_CODE?=0 | ||
| WOLFBOOT_SECTOR_SIZE?=0x1000 | ||
| WOLFBOOT_PARTITION_SIZE?=0x100000 | ||
| WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x70020000 | ||
| WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x00120000 | ||
| WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x00010000 | ||
| IMAGE_HEADER_SIZE?=1024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| # OpenOCD config for NUCLEO-N657X0-Q with MX25UM51245G NOR on XSPI2 | ||
|
|
||
| source [find interface/stlink.cfg] | ||
| transport select swd | ||
|
|
||
| set CHIPNAME stm32n6x | ||
| set WORKAREASIZE 0x10000 | ||
|
|
||
| source [find target/stm32n6x.cfg] | ||
|
|
||
| # Work-area above wolfBoot SRAM region | ||
| $_TARGETNAME configure -work-area-phys 0x34020000 -work-area-size $WORKAREASIZE -work-area-backup 0 | ||
|
|
||
| # XSPI2 NOR flash bank (memory-mapped at 0x70000000, regs at 0x5802A000) | ||
| set XSPI2_BANK_ID [llength [flash list]] | ||
| flash bank $CHIPNAME.xspi2 stmqspi 0x70000000 0 0 0 $CHIPNAME.cpu 0x5802A000 | ||
|
|
||
| # Mark VDDIO supplies valid (required for XSPI2 GPIO) | ||
| proc pwr_enable_io_supply {} { | ||
| mmw 0x5602825C 0x00040000 0 ;# RCC_AHB4ENR: PWR clock | ||
| mmw 0x56024834 0x00000100 0 ;# SVMCR1: VDDIO4SV | ||
| mmw 0x56024838 0x00000100 0 ;# SVMCR2: VDDIO5SV | ||
| mmw 0x5602483C 0x00000300 0 ;# SVMCR3: VDDIO2SV + VDDIO3SV | ||
| } | ||
|
|
||
| # Port N GPIO for XSPI2 (PN0-PN11, AF9, very high speed) | ||
| proc xspi2_gpio_init {} { | ||
| mmw 0x5602825C 0x00002000 0 ;# RCC_AHB4ENR: GPION clock | ||
| sleep 1 | ||
| mmw 0x56023400 0x00AAAAAA 0x00555555 ;# MODER: AF mode | ||
| mmw 0x56023408 0x00FFFFFF 0 ;# OSPEEDR: very high | ||
| mmw 0x5602340C 0 0x00FFFFFF ;# PUPDR: no pull | ||
| mww 0x56023420 0x99999999 ;# AFRL: AF9 | ||
| mww 0x56023424 0x00009999 ;# AFRH: AF9 | ||
| } | ||
|
|
||
| # XSPI2 init: single-SPI, /16 prescaler, NOR reset, enter mmap mode | ||
| proc xspi2_init {} { | ||
| mmw 0x56028260 0x00003000 0 ;# RCC_AHB5ENR: XSPI2 + XSPIM clocks | ||
| mmw 0x56028248 0x00000008 0 ;# RCC_MISCENR: XSPI PHY comp clock | ||
| sleep 1 | ||
|
|
||
| mww 0x5802A000 0x00000000 ;# CR: disable | ||
| sleep 1 | ||
| mww 0x5802A008 0x001A0308 ;# DCR1: DLYBYP, DEVSIZE=26, CSHT=3 | ||
| mww 0x5802A00C 0x0000000F ;# DCR2: prescaler /16 | ||
| sleep 1 | ||
| mww 0x5802A000 0x00000001 ;# CR: enable | ||
|
|
||
| # NOR flash software reset (0x66 + 0x99) | ||
| mmw 0x5802A000 0x00000002 0 ;# abort | ||
| sleep 1 | ||
| mww 0x5802A024 0x0000000B ;# FCR: clear flags | ||
| mww 0x5802A100 0x00000001 ;# CCR: IMODE=single | ||
| mww 0x5802A108 0x00000000 ;# TCR: no dummy | ||
| mww 0x5802A110 0x00000066 ;# IR: Reset Enable | ||
| sleep 1 | ||
|
|
||
| mmw 0x5802A000 0x00000002 0 ;# abort | ||
| sleep 1 | ||
| mww 0x5802A024 0x0000000B | ||
| mww 0x5802A100 0x00000001 | ||
| mww 0x5802A108 0x00000000 | ||
| mww 0x5802A110 0x00000099 ;# IR: Reset Memory | ||
| sleep 10 | ||
|
|
||
| xspi2_mem_mapped | ||
| } | ||
|
|
||
| # Memory-mapped fast-read mode (single-SPI, 4-byte addr, 8 dummy cycles) | ||
| proc xspi2_mem_mapped {} { | ||
| mmw 0x5802A000 0x00000002 0 ;# abort | ||
| sleep 1 | ||
| mww 0x5802A000 0x30000001 ;# CR: mmap + enable | ||
| mww 0x5802A100 0x01003101 ;# CCR: IMODE=1, ADMODE=1, ADSIZE=3, DMODE=1 | ||
| mww 0x5802A108 0x40000008 ;# TCR: DCYC=8, SSHIFT | ||
| mww 0x5802A110 0x0000000C ;# IR: Fast Read 4B | ||
| } | ||
|
|
||
| # Set NOR flash params manually (SFDP not readable in single-SPI mode) | ||
| proc xspi2_flash_set {} { | ||
| global XSPI2_BANK_ID | ||
| stmqspi set $XSPI2_BANK_ID MX25UM51245G 0x4000000 0x100 0x13 0 0x12 0x60 0x1000 0x21 | ||
| } | ||
|
|
||
| # Full reinit for use when XSPI2 may already be configured | ||
| proc xspi2_reinit {} { | ||
| global XSPI2_BANK_ID | ||
| pwr_enable_io_supply | ||
| xspi2_gpio_init | ||
| xspi2_init | ||
| xspi2_flash_set | ||
| flash probe $XSPI2_BANK_ID | ||
| xspi2_flash_set | ||
| } | ||
|
|
||
| $_TARGETNAME configure -event reset-init { | ||
| global XSPI2_BANK_ID | ||
| pwr_enable_io_supply | ||
| xspi2_gpio_init | ||
| xspi2_init | ||
| xspi2_flash_set | ||
| flash probe $XSPI2_BANK_ID | ||
| # Re-set after probe (stmqspi driver quirk) | ||
| xspi2_flash_set | ||
| } | ||
|
|
||
| init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.