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

samples: code relocation for the stm32f746 disco kit #86136

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions boards/st/stm32f746g_disco/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# keep first
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
board_runner_args(stm32cubeprogrammer "--extload=N25Q128A_STM32F746G-DISCO.stldr")

board_runner_args(jlink "--device=STM32F746NG" "--speed=4000")

# keep first
Expand Down
9 changes: 9 additions & 0 deletions boards/st/stm32f746g_disco/stm32f746g_disco.dts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM) )>;
};

/* Declare attributes for the External flash Mem to allow code execution there */
ext_memory: memory@90000000 {
compatible = "zephyr,memory-region";
reg = <0x90000000 DT_SIZE_M(16)>; /* max addressable area */
zephyr,memory-region = "EXTMEM";
/* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this comment? ATTR_MPU_EXTMEM is expected to cause MPU faults:

#define REGION_EXTMEM_ATTR(size) {(STRONGLY_ORDERED_SHAREABLE | size | NO_ACCESS_Msk)}

(Emphasis mine: | NO_ACCESS_Msk)

zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO) )>;
};

aliases {
led0 = &green_led_1;
sw0 = &user_button;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_FLASH=y
CONFIG_STM32_MEMMAP=y
Loading