-
Notifications
You must be signed in to change notification settings - Fork 7.8k
stm32 ospi driver : run application in external flash memory XIP #93032
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
Draft
FRASTM
wants to merge
3
commits into
zephyrproject-rtos:main
Choose a base branch
from
FRASTM:stm32u5_xip
base: main
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.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
110 changes: 110 additions & 0 deletions
110
boards/st/b_u585i_iot02a/b_u585i_iot02a_stm32u585xx_ext_flash_app.dts
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,110 @@ | ||
/* | ||
* Copyright (c) 2025 STMicroelectronics | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
#include "b_u585i_iot02a-common.dtsi" | ||
#include <zephyr/dt-bindings/memory-attr/memory-attr.h> | ||
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h> | ||
|
||
/ { | ||
model = "STMicroelectronics B-U585I-IOT02A discovery kit"; | ||
compatible = "st,b-u585i-iot02a"; | ||
|
||
chosen { | ||
zephyr,console = &usart1; | ||
zephyr,shell-uart = &usart1; | ||
zephyr,sram = &sram0; | ||
zephyr,flash = &flash0; | ||
zephyr,code-partition = &slot0_partition; | ||
zephyr,bt-hci = &bt_hci_uart; | ||
}; | ||
|
||
aliases { | ||
led0 = &green_led_1; | ||
led1 = &red_led_1; | ||
sw0 = &user_button; | ||
die-temp0 = &die_temp; | ||
}; | ||
|
||
octo_nor: memory@70000000 { | ||
compatible = "zephyr,memory-region"; | ||
reg = <0x70000000 DT_SIZE_M(64)>; | ||
zephyr,memory-region = "EXTMEM"; | ||
/* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */ | ||
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO) )>; | ||
}; | ||
}; | ||
|
||
&flash0 { | ||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
/* | ||
* Following flash partition is dedicated to the use of b_u585i_iot02a | ||
* with TZEN=0 (so w/o TFM). | ||
* Set the partitions with first MB to make use of the whole Bank1 | ||
*/ | ||
boot_partition: partition@0 { | ||
label = "mcuboot"; | ||
reg = <0x00000000 DT_SIZE_K(64)>; | ||
}; | ||
|
||
storage_partition: partition@f0000 { | ||
label = "storage"; | ||
reg = <0x000f0000 DT_SIZE_K(64)>; | ||
}; | ||
}; | ||
}; | ||
|
||
&gpdma1 { | ||
status = "okay"; | ||
}; | ||
|
||
&uart4 { | ||
pinctrl-0 = <&uart4_tx_pc10 &uart4_rx_pc11>; | ||
pinctrl-names = "default"; | ||
current-speed = <100000>; | ||
status = "okay"; | ||
|
||
bt_hci_uart: bt_hci_uart { | ||
compatible = "zephyr,bt-hci-uart"; | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
&die_temp { | ||
status = "okay"; | ||
}; | ||
|
||
&adc1 { | ||
st,adc-prescaler = <4>; | ||
status = "okay"; | ||
}; | ||
|
||
&mx25lm51245 { | ||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
slot0_partition: partition@0 { | ||
label = "image-0"; | ||
reg = <0x00000000 DT_SIZE_K(416)>; | ||
}; | ||
|
||
slot1_partition: partition@68000 { | ||
label = "image-1"; | ||
reg = <0x00068000 DT_SIZE_K(416)>; | ||
}; | ||
|
||
scratch_partition: partition@d0000 { | ||
label = "image-scratch"; | ||
reg = <0x000d0000 DT_SIZE_K(192)>; | ||
}; | ||
}; | ||
}; |
10 changes: 10 additions & 0 deletions
10
boards/st/b_u585i_iot02a/b_u585i_iot02a_stm32u585xx_ext_flash_app.yaml
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,10 @@ | ||
identifier: b_u585i_iot02a/stm32u585xx/xip | ||
name: ST B_U585I_IOT02A Discovery kit xip target | ||
type: mcu | ||
arch: arm | ||
toolchain: | ||
- zephyr | ||
- gnuarmemb | ||
ram: 786 | ||
flash: 512 | ||
vendor: st |
11 changes: 11 additions & 0 deletions
11
boards/st/b_u585i_iot02a/b_u585i_iot02a_stm32u585xx_ext_flash_app_defconfig
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,11 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# enable uart driver | ||
CONFIG_SERIAL=y | ||
|
||
# enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# console | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_CONSOLE=y |
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ board: | |
- name: stm32u585xx | ||
variants: | ||
- name: ns | ||
- name: ext_flash_app |
1 change: 1 addition & 0 deletions
1
samples/sysbuild/with_mcuboot/boards/b_u585i_iot02a_stm32u585xx_ext_flash_app.conf
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 @@ | ||
CONFIG_FLASH=y |
17 changes: 17 additions & 0 deletions
17
samples/sysbuild/with_mcuboot/boards/b_u585i_iot02a_stm32u585xx_ext_flash_app.overlay
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,17 @@ | ||
/* | ||
* Copyright (c) 2025 STMicroelectronics | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* | ||
* Define the device, controller and partition to be the external memory | ||
* for running the application in external NOR from MCUboot | ||
*/ | ||
|
||
/ { | ||
chosen { | ||
zephyr,flash = &mx25lm51245; | ||
zephyr,flash-controller = &mx25lm51245; | ||
}; | ||
}; |
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
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.