Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
a974f2dc
Commit
a974f2dc
authored
May 02, 2019
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stm32/flash: Fix bug computing page number for L432 page erase.
parent
3fbf32b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
ports/stm32/flash.c
ports/stm32/flash.c
+7
-1
No files found.
ports/stm32/flash.c
View file @
a974f2dc
...
...
@@ -122,6 +122,12 @@ static uint32_t get_page(uint32_t addr) {
}
#endif
#elif defined(STM32L4) && !defined(SYSCFG_MEMRMP_FB_MODE)
static
uint32_t
get_page
(
uint32_t
addr
)
{
return
(
addr
-
FLASH_BASE
)
/
FLASH_PAGE_SIZE
;
}
#endif
uint32_t
flash_get_sector_info
(
uint32_t
addr
,
uint32_t
*
start_addr
,
uint32_t
*
size
)
{
...
...
@@ -167,7 +173,7 @@ void flash_erase(uint32_t flash_dest, uint32_t num_word32) {
#elif (defined(STM32L4) && !defined(SYSCFG_MEMRMP_FB_MODE))
__HAL_FLASH_CLEAR_FLAG
(
FLASH_FLAG_ALL_ERRORS
);
EraseInitStruct
.
TypeErase
=
FLASH_TYPEERASE_PAGES
;
EraseInitStruct
.
Page
=
flash_dest
;
EraseInitStruct
.
Page
=
get_page
(
flash_dest
)
;
EraseInitStruct
.
NbPages
=
(
4
*
num_word32
+
FLASH_PAGE_SIZE
-
4
)
/
FLASH_PAGE_SIZE
;
#elif defined(STM32L4)
__HAL_FLASH_CLEAR_FLAG
(
FLASH_FLAG_ALL_ERRORS
);
...
...
Write
Preview
Markdown
is supported
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