Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
404f7cf9
Commit
404f7cf9
authored
May 19, 2014
by
Damien George
Browse files
Merge pull request #618 from swegener/jump-to-bootloader
Jump to bootloader
parents
5cdff5fa
9bf4f7e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
stmhal/modpyb.c
View file @
404f7cf9
...
...
@@ -62,6 +62,22 @@
///
/// The `pyb` module contains specific functions related to the pyboard.
/// \function bootloader()
/// Activate the bootloader without BOOT* pins.
STATIC
NORETURN
mp_obj_t
pyb_bootloader
(
uint
n_args
,
const
mp_obj_t
*
args
)
{
storage_flush
();
HAL_RCC_DeInit
();
HAL_DeInit
();
__HAL_REMAPMEMORY_SYSTEMFLASH
();
__set_MSP
(
*
((
uint32_t
*
)
0x00000000
));
((
void
(
*
)(
void
))
*
((
uint32_t
*
)
0x00000004
))();
while
(
1
);
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
pyb_bootloader_obj
,
0
,
1
,
pyb_bootloader
);
/// \function info([dump_alloc_table])
/// Print out lots of information about the board.
STATIC
mp_obj_t
pyb_info
(
uint
n_args
,
const
mp_obj_t
*
args
)
{
...
...
@@ -302,6 +318,7 @@ MP_DECLARE_CONST_FUN_OBJ(pyb_usb_mode_obj); // defined in main.c
STATIC
const
mp_map_elem_t
pyb_module_globals_table
[]
=
{
{
MP_OBJ_NEW_QSTR
(
MP_QSTR___name__
),
MP_OBJ_NEW_QSTR
(
MP_QSTR_pyb
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_bootloader
),
(
mp_obj_t
)
&
pyb_bootloader_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_info
),
(
mp_obj_t
)
&
pyb_info_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_unique_id
),
(
mp_obj_t
)
&
pyb_unique_id_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_freq
),
(
mp_obj_t
)
&
pyb_freq_obj
},
...
...
stmhal/qstrdefsport.h
View file @
404f7cf9
...
...
@@ -29,6 +29,7 @@
Q
(
help
)
Q
(
pyb
)
Q
(
unique_id
)
Q
(
bootloader
)
Q
(
info
)
Q
(
sd_test
)
Q
(
present
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment