Skip to content

Commit 9af7b73

Browse files
Bug Fix
1 parent d6b173b commit 9af7b73

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

bsp/stm32/stm32l475-atk-pandora/board/ports/drv_qspi_flash.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2021, RT-Thread Development Team
2+
* Copyright (c) 2006-2025, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -60,9 +60,20 @@ void w25qxx_enter_qspi_mode(struct rt_qspi_device *device)
6060
}
6161
}
6262

63+
void w25qxx_enter_qspi_mode_adapter(void)
64+
{
65+
struct rt_qspi_device *device = (struct rt_qspi_device *)rt_device_find("qspi10");
66+
if (device == RT_NULL)
67+
{
68+
rt_kprintf("QSPI device not found!\n");
69+
return;
70+
}
71+
w25qxx_enter_qspi_mode(device);
72+
}
73+
6374
static int rt_hw_qspi_flash_with_sfud_init(void)
6475
{
65-
rt_hw_qspi_device_attach("qspi1", "qspi10", RT_NULL, 4, w25qxx_enter_qspi_mode, RT_NULL);
76+
rt_hw_qspi_device_attach("qspi1", "qspi10", RT_NULL, 4, w25qxx_enter_qspi_mode_adapter, RT_NULL);
6677

6778
/* init w25q128 */
6879
if (RT_NULL == rt_sfud_flash_probe("W25Q128", "qspi10"))
@@ -72,6 +83,7 @@ static int rt_hw_qspi_flash_with_sfud_init(void)
7283

7384
return RT_EOK;
7485
}
86+
7587
INIT_COMPONENT_EXPORT(rt_hw_qspi_flash_with_sfud_init);
7688

7789
#if defined(RT_USING_DFS_ELMFAT) && !defined(BSP_USING_SDCARD_FATFS)
@@ -108,3 +120,4 @@ INIT_ENV_EXPORT(mnt_init);
108120

109121
#endif /* defined(RT_USING_DFS_ELMFAT) && !defined(BSP_USING_SDCARD_FATFS) */
110122
#endif /* BSP_USING_QSPI_FLASH */
123+

0 commit comments

Comments
 (0)