Skip to content
Merged
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ documentation/html
*.a
*.i
*.d
#source insight 4 project files
*.si4project
tools/kconfig-frontends/kconfig-mconf
packages
dist
Expand Down
9 changes: 3 additions & 6 deletions bsp/stm32/stm32l496-ali-developer/board/mnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ int mnt_init(void)
{
#ifdef BSP_USING_ON_CHIP_FLASH
fal_init();

#define FS_PARTITION_NAME "flash"
struct rt_device *mtd_dev;
mtd_dev = fal_blk_device_create(FS_PARTITION_NAME);
Expand All @@ -46,11 +45,9 @@ int mnt_init(void)
LOG_I("Failed to initialize filesystem!");
}
}
#endif

#endif
#endif /* BSP_USING_ON_CHIP_FLASH_FATFS */
#endif /* BSP_USING_ON_CHIP_FLASH */
return 0;
}
INIT_ENV_EXPORT(mnt_init);
#endif

#endif /* RT_USING_DFS */
3 changes: 1 addition & 2 deletions bsp/stm32/stm32l496-st-nucleo/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ CubeMX_Config/Src/stm32l4xx_hal_msp.c
''')

if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
src += Glob('mnt_onchip.c')

src += Glob('mnt.c')

path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
#include <rtdevice.h>

#include "fal.h"
#include <dfs_fs.h>

#define DBG_TAG "mnt"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>

#ifdef RT_USING_DFS
#include <dfs_fs.h>
Expand All @@ -26,25 +29,24 @@ int mnt_init(void)
mtd_dev = fal_blk_device_create(FS_PARTITION_NAME);
if (!mtd_dev)
{
rt_kprintf("Failed to create device.\n");
LOG_E("Failed to create device.\n");
}
#ifdef BSP_USING_ON_CHIP_FLASH_FATFS
if (dfs_mount(FS_PARTITION_NAME, "/", "elm", 0, 0) == 0)
{
rt_kprintf("Filesystem initialized!");
LOG_I("Filesystem initialized!");
}
else
{
dfs_mkfs("elm", FS_PARTITION_NAME);
if (dfs_mount(FS_PARTITION_NAME, "/", "elm", 0, 0) != 0)
{
rt_kprintf("Failed to initialize filesystem!");
LOG_E("Failed to initialize filesystem!");
}
}
#endif
#endif
#endif /* BSP_USING_ON_CHIP_FLASH_FATFS */
#endif /* BSP_USING_ON_CHIP_FLASH */
return 0;
}
INIT_ENV_EXPORT(mnt_init);
#endif

#endif /* RT_USING_DFS */