-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[bsp/stm32l496_ali] add the on-chip flash #6061
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
79ce3cf
[bsp/stm32l496_ali] add the on-chip flash
supperthomas 54706c8
[bsp/stm32l496_ali]add Kconfig
supperthomas aaba2c0
remove the DFS
supperthomas e8c6e9f
fix Kconfig
supperthomas e6830f3
fix the config
supperthomas b30363c
fix the config
supperthomas 0017b74
fix the define
supperthomas 263ef92
fix log
supperthomas d27c285
update
mysterywolf 1d20c69
Merge branch 'RT-Thread:master' into stm32_ali
mysterywolf 64690ce
Merge pull request #4 from mysterywolf/stm32_ali
supperthomas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,30 +14,40 @@ | |||||||||
| #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> | ||||||||||
|
|
||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| 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); | ||||||||||
| if (!mtd_dev) | ||||||||||
| { | ||||||||||
| LOG_E("Failed to create device.\n"); | ||||||||||
| } | ||||||||||
| #ifdef BSP_USING_ON_CHIP_FLASH_FATFS | ||||||||||
| if (dfs_mount(FS_PARTITION_NAME, "/", "elm", 0, 0) == 0) | ||||||||||
supperthomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| { | ||||||||||
| 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_I("Failed to initialize filesystem!"); | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| #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 */ | ||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Copyright (c) 2006-2022, RT-Thread Development Team | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Change Logs: | ||
| * Date Author Notes | ||
| * 2022-06-08 supperthomas first version | ||
| */ | ||
|
|
||
| #include <rtthread.h> | ||
| #include <rtdevice.h> | ||
|
|
||
| #include "fal.h" | ||
|
|
||
| #define DBG_TAG "mnt" | ||
| #define DBG_LVL DBG_INFO | ||
| #include <rtdbg.h> | ||
|
|
||
| #ifdef RT_USING_DFS | ||
| #include <dfs_fs.h> | ||
|
|
||
| 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); | ||
| if (!mtd_dev) | ||
| { | ||
| LOG_E("Failed to create device.\n"); | ||
| } | ||
| #ifdef BSP_USING_ON_CHIP_FLASH_FATFS | ||
| if (dfs_mount(FS_PARTITION_NAME, "/", "elm", 0, 0) == 0) | ||
| { | ||
| LOG_I("Filesystem initialized!"); | ||
| } | ||
| else | ||
| { | ||
| dfs_mkfs("elm", FS_PARTITION_NAME); | ||
| if (dfs_mount(FS_PARTITION_NAME, "/", "elm", 0, 0) != 0) | ||
| { | ||
| LOG_E("Failed to initialize filesystem!"); | ||
| } | ||
| } | ||
| #endif /* BSP_USING_ON_CHIP_FLASH_FATFS */ | ||
| #endif /* BSP_USING_ON_CHIP_FLASH */ | ||
| return 0; | ||
| } | ||
| INIT_ENV_EXPORT(mnt_init); | ||
| #endif /* RT_USING_DFS */ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.