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
drivers: flash controller for the stm32u5 soc serie #42538
Conversation
$ west build -p auto -b b_u585i_iot02a tests/drivers/flash
|
adding the DTS for the b_u585i_iot02a_ns target with a |
rebase |
drivers/flash/flash_stm32u5x.c
Outdated
} | ||
|
||
/* Check if this double word is erased */ | ||
if ((flash[0] != 0xFFFFFFFFUL) || (flash[1] != 0xFFFFFFFFUL)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note: a write will still fail if the ECC is already written.
ECC can be set if a programmer/ previous write was done with 0xFF...FF as data.
Maybe good to add this in the check?
d7459dc
to
1328800
Compare
merging Note that stm32U5 has 128-bit pages and on or two (consecutive) banks "of 1 Mbyte each containing 128 pages of |
rebase on ae71444 |
add a commit 4a94eedbc1a428f1013a662a318022a6d5499eb9 to change FLASH_STM32_xx bitfield |
f3e9b08
to
7cc144b
Compare
rebase on 574e166 |
with optimized Kconfig writing and dts |
This adds the stm32U5 soc family to the flash driver The flash controller has particular register names in the Non-Secure area to be adapted for the driver. Signed-off-by: Francois Ramu <francois.ramu@st.com>
Adds the stm32u5 flash controller driver for this serie to the existing stm32l5 flash driver part Only 1 or 2 MB devices exist today (4MB is possible in the future). This flash controller driver is adapted from the flash_stm32l5.c Signed-off-by: Francois Ramu <francois.ramu@st.com>
redefine all the stm32 flash register bit Name from FLASH_NSCR_xxx to FLASH_STM32_FLASH_NSCR_xxx in all the zephyr drivers. Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit adds a flash_controller node for the stm32u5 soc family blocks of 8K and erase time given by the Datasheet (with margin). Signed-off-by: Francois Ramu <francois.ramu@st.com>
Enables the flash controller node for the stm32u585 disco kit with an arbitrary definition of the board partitions to fill the 1MB bank1 of the flash memory, for the secure and non-secure targets. Signed-off-by: Francois Ramu <francois.ramu@st.com>
#define FLASH_NSCR_NSLOCK FLASH_NSCR_LOCK | ||
#define FLASH_OPTR_DBANK FLASH_OPTR_DUALBANK | ||
#define FLASH_NSCR_NSPG FLASH_NSCR_PG | ||
#define FLASH_NSCR_NSBKER_Msk FLASH_NSCR_BKER_Msk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole part should ideally be moved into initial commit "drivers: flash stm32 flash driver includes stm32u5 serie".
But I agree this require a full rework of the PR, so ok to keep it that way.
Merging since @nvlsianpu is on leave |
This PR adds the flash controller driver for the stm32U5xx soc
It defines the flash controller node in the DTS
It defines a partition for the flash memory.
The drivers/flash/flash_stm32u5x.c is adapted from the drivers/flash/flash_stm32l5x.c
Applicable on the stm32U575/585 devices where the Flash memory is organized as two banks of 1 Mbyte each containing 128 pages of 8 Kbytes ( 137 bits wide data read and write = 128 effective bits plus 9 ECC bits)
Fixes #42478
Signed-off-by: Francois Ramu francois.ramu@st.com