Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
97a9d8e1
Commit
97a9d8e1
authored
3 years ago
by
C-Glick
Browse files
Options
Downloads
Patches
Plain Diff
Remap memory before jumping
Still not working
parent
8e5c6675
No related branches found
No related tags found
1 merge request
!69
Streamlined USB flashing
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.vscode/settings.json
+2
-1
2 additions, 1 deletion
.vscode/settings.json
crazyflie_software/crazyflie-firmware-2021.06/src/hal/src/usb.c
+13
-3
13 additions, 3 deletions
...lie_software/crazyflie-firmware-2021.06/src/hal/src/usb.c
with
15 additions
and
4 deletions
.vscode/settings.json
+
2
−
1
View file @
97a9d8e1
{
"files.associations"
:
{
"controller.h"
:
"c"
,
"typeinfo"
:
"c"
"typeinfo"
:
"c"
,
"attitude_controller.h"
:
"c"
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
crazyflie_software/crazyflie-firmware-2021.06/src/hal/src/usb.c
+
13
−
3
View file @
97a9d8e1
...
...
@@ -182,13 +182,23 @@ static uint8_t usbd_cf_Setup(void *pdev , USB_SETUP_REQ *req)
}
else
if
(
command
==
0x02
){
//transition to DFU bootloader mode
// arm-none-eabi-gcc 4.9.0 does not correctly inline this
// // // MSP function, so we write it out explicitly here.
//shutdown any tasks running
RCC_DeInit
();
SysTick
->
CTRL
=
0
;
//reset the Systick timer
SysTick
->
LOAD
=
0
;
SysTick
->
VAL
=
0
;
__set_PRIMASK
(
1
);
//disable interrupts
SYSCFG_MemoryRemapConfig
(
SYSCFG_MemoryRemap_SystemFlash
);
//set main stack pointer to its default value
__set_MSP
(
*
((
uint32_t
*
)
0x00000000
));
//__ASM volatile ("movs r3, #0\nldr r3, [r3, #0]\nMSR msp, r3\n" : : : "r3", "sp");
//jump to boot loader (start of system memory plus 4)
((
void
(
*
)(
void
))
*
((
uint32_t
*
)
0x00000004
))();
while
(
1
);
}
...
...
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