Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
9779c993
Commit
9779c993
authored
8 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
stmhal: Add ability to skip booting from SD card via /flash/SKIPSD file.
parent
de48a27d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/pyboard/general.rst
+5
-0
5 additions, 0 deletions
docs/pyboard/general.rst
stmhal/main.c
+4
-1
4 additions, 1 deletion
stmhal/main.c
with
9 additions
and
1 deletion
docs/pyboard/general.rst
+
5
−
0
View file @
9779c993
...
...
@@ -11,6 +11,11 @@ is inserted into the slot, it is available as ``/sd``.
When the pyboard boots up, it needs to choose a filesystem to boot from. If
there is no SD card, then it uses the internal filesystem ``/flash`` as the boot
filesystem, otherwise, it uses the SD card ``/sd``.
If needed, you can prevent the use of the SD card by creating an empty file
called ``/flash/SKIPSD``. If this file exists when the pyboard boots
up then the SD card will be skipped and the pyboard will always boot from the
internal filesystem (in this case the SD card won't be mounted but you can still
mount and use it later in your program using ``os.mount``).
(Note that on older versions of the board, ``/flash`` is called ``0:/`` and ``/sd``
is called ``1:/``).
...
...
This diff is collapsed.
Click to expand it.
stmhal/main.c
+
4
−
1
View file @
9779c993
...
...
@@ -568,8 +568,11 @@ soft_reset:
#if MICROPY_HW_HAS_SDCARD
// if an SD card is present then mount it on /sd/
if
(
sdcard_is_present
())
{
// if there is a file in the flash called "SKIPSD", then we don't mount the SD card
if
(
!
mounted_flash
||
f_stat
(
&
fs_user_mount_flash
.
fatfs
,
"/SKIPSD"
,
NULL
)
!=
FR_OK
)
{
mounted_sdcard
=
init_sdcard_fs
(
first_soft_reset
);
}
}
#endif
// set sys.path based on mounted filesystems (/sd is first so it can override /flash)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment