Wykres commitów

7 Commity (master)

Autor SHA1 Wiadomość Data
Damien George b6ab9e420b stm32/flash: Change flash_erase to only erase a single sector at a time.
An erase sector sits in a given flash bank and some MCUs have two flash
banks.  If trying to erase a range of sectors and that range crosses from
one flash bank into the next, the original implementation of
`flash_erase()` would not handle this case and would do the wrong thing.

This commit changes `flash_erase()` to only erase a single sector, which
sidesteps the need to handle flash-bank-crossing.  Most callers of this
function only need to erase a single sector anyway.

Signed-off-by: Damien George <damien@micropython.org>
2024-01-08 12:33:34 +11:00
Andrew Leech 40006813c3 stm32/flash: Update flash_get_sector_info to return -1 on invalid addr.
So the caller can tell when an invalid address is used and can take
appropriate action.
2020-06-30 21:24:28 +10:00
Damien George 736daebfc8 stm32/flash: Add flash_is_valid_addr, and extend sectors for 2MB F7.
Signed-off-by: Damien George <damien@micropython.org>
2020-06-22 14:18:15 +10:00
Damien George afd47d58ac stm32/flash: Make flash C-API reusable, and funcs return an error code.
This commit makes the low-level flash C functions usable by code other than
flashbdev.c (eg by mboot).  Changes in this commit are:
- flash_erase() and flash_write() now return an errno error code, a
  negative value on error.
- flash_erase() now automatically locks the flash, as well as unlocking it.
- flash_write() now automatically unlocks the flash, as well as locking it.
- flashbdev.c is modified for the above changes.

Signed-off-by: Damien George <damien@micropython.org>
2020-06-22 14:18:15 +10:00
Damien George 4c0f664b1a stm32/flash: Remove unused src parameter from flash_erase(). 2018-05-02 13:11:56 +10:00
Damien George d966a33486 stm32: Change header include guards from STMHAL to STM32 to match dir. 2018-02-15 15:47:04 +11:00
Damien George 01dd7804b8 ports: Make new ports/ sub-directory and move all ports there.
This is to keep the top-level directory clean, to make it clear what is
core and what is a port, and to allow the repository to grow with new ports
in a sustainable way.
2017-09-06 13:40:51 +10:00