Skip to content

Commit d24f3b9

Browse files
FRASTMfabiobaltieri
authored andcommitted
samples: drivers: jesd216 jedec ID and SFDP from octo-flash
This adds the support jedec configuration to run the jedec sample application. So target boards can display the content of the octo-NOR flash of the stm32u585 and stm32l562 or stm32h735 disco boards. The sfdp-bfp table is provided as example (overlay file), to run this sample on the stm32l562e_dk platform. It has to be defined in the deviceTree "in cases were runtime retrieval of SFDP data is not desired." Signed-off-by: Francois Ramu <[email protected]>
1 parent b619342 commit d24f3b9

File tree

5 files changed

+64
-0
lines changed

5 files changed

+64
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2022 STMicroelectronics
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
CONFIG_FLASH_STM32_OSPI=y
7+
CONFIG_SPI_NOR_SFDP_RUNTIME=y
8+
CONFIG_SPI_NOR=n
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2022 STMicroelectronics
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
CONFIG_FLASH_STM32_OSPI=y
7+
CONFIG_SPI_NOR_SFDP_RUNTIME=y
8+
CONFIG_SPI_NOR=n
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2022 STMicroelectronics
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
CONFIG_FLASH_STM32_OSPI=y
7+
CONFIG_SPI_NOR_SFDP_RUNTIME=y
8+
CONFIG_SPI_NOR=n
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2022, STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&mx25lm51245 {
8+
/* example of sfdp-bfp table Version 1.6 */
9+
sfdp-bfp = [
10+
53 46 44 50 06 01 02 ff
11+
00 06 01 10 30 00 00 ff
12+
c2 00 01 04 10 01 00 ff
13+
84 00 01 02 c0 00 00 ff
14+
00 00 00 00 00 00 00 00
15+
00 00 00 00 00 00 00 00
16+
e5 20 fb ff ff ff ff 1f
17+
44 eb 08 6b 08 3b 04 bb
18+
fe ff ff ff ff ff 00 ff
19+
ff ff 44 eb 0c 20 0f 52
20+
10 d8 00 ff d6 49 c5 00
21+
81 df 04 e3 44 03 67 38
22+
30 b0 30 b0 f7 bd d5 5c
23+
4a 9e 29 ff f0 50 f9 85
24+
00 00 00 00 00 00 00 00
25+
00 00 00 00 00 00 00 00
26+
00 00 00 00 00 00 00 00
27+
00 00 00 00 00 00 00 00
28+
00 00 00 00 00 00 00 00
29+
00 00 00 00 00 00 00 00
30+
00 00 00 00 00 00 00 00
31+
00 00 00 00 00 00 00 00
32+
00 00 00 00 00 00 00 00
33+
00 00 00 00 00 00 00 00
34+
7f ef ff ff 21 5c dc ff
35+
];
36+
};

samples/drivers/jesd216/src/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
#define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(jedec_spi_nor)
1717
#elif DT_HAS_COMPAT_STATUS_OKAY(nordic_qspi_nor)
1818
#define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(nordic_qspi_nor)
19+
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_qspi_nor)
20+
#define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(st_stm32_qspi_nor)
21+
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_ospi_nor)
22+
#define FLASH_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(st_stm32_ospi_nor)
1923
#else
2024
#error Unsupported flash driver
2125
#define FLASH_NODE DT_INVALID_NODE

0 commit comments

Comments
 (0)