Skip to content

Commit 15b10bd

Browse files
committed
[components][sfud] update sfud options.
1 parent 0dc7da6 commit 15b10bd

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

components/drivers/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ config RT_USING_SPI
224224
select RT_USING_QSPI
225225
default n
226226

227+
config RT_SFUD_SPI_MAX_HZ
228+
int "Default spi maximum speed(HZ)"
229+
range 0 50000000
230+
default 50000000
231+
help
232+
Read the JEDEC SFDP command must run at 50 MHz or less,and you also can use rt_spi_configure(); to config spi speed.
233+
227234
config RT_DEBUG_SFUD
228235
bool "Show more SFUD debug information"
229236
default n

components/drivers/spi/spi_flash_sfud.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,17 @@
2222
#endif /* RT_DEBUG_SFUD */
2323

2424
#ifndef RT_SFUD_DEFAULT_SPI_CFG
25+
26+
#ifndef RT_SFUD_SPI_MAX_HZ
27+
#define RT_SFUD_SPI_MAX_HZ 50000000
28+
#endif
29+
2530
/* read the JEDEC SFDP command must run at 50 MHz or less */
2631
#define RT_SFUD_DEFAULT_SPI_CFG \
2732
{ \
2833
.mode = RT_SPI_MODE_0 | RT_SPI_MSB, \
2934
.data_width = 8, \
30-
.max_hz = 50 * 1000 * 1000, \
35+
.max_hz = RT_SFUD_SPI_MAX_HZ, \
3136
}
3237
#endif
3338

0 commit comments

Comments
 (0)