-
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
Changes from 7 commits
79ce3cf
54706c8
aaba2c0
e8c6e9f
e6830f3
b30363c
0017b74
263ef92
d27c285
1d20c69
64690ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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> | ||||||||||||
|
|
||||||||||||
|
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
|
||||||||||||
| #include "fal.h" | ||||||||||||
| #include <dfs_fs.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) | ||||||||||||
| { | ||||||||||||
| rt_kprintf("Failed to create device.\n"); | ||||||||||||
|
||||||||||||
| rt_kprintf("Failed to create device.\n"); | |
| LOG_E("Failed to create device."); |
supperthomas marked this conversation as resolved.
Show resolved
Hide resolved
supperthomas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
supperthomas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,10 +19,16 @@ | |||||||||
|
|
||||||||||
|
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) | ||||||||||
| { | ||||||||||
| rt_kprintf("Failed to create device.\n"); | ||||||||||
|
||||||||||
| rt_kprintf("Failed to create device.\n"); | |
| LOG_E("Failed to create device."); |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| rt_kprintf("Filesystem initialized!"); | |
| LOG_I("Filesystem initialized!"); |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| rt_kprintf("Failed to initialize filesystem!"); | |
| LOG_E("Failed to initialize filesystem!"); |
Uh oh!
There was an error while loading. Please reload this page.