STM32L0 chips use loader_code_stm32lx, but this flash loader is built
for armv7-m and uses instructions that are unsupported on STM32L0 (which
have Cortex M0+ cores implementing armv6-m).
In particular, loader_code_stm32lx uses variants of add-immediate that
do not update the condition flags ( `add r0, r0, #4` ). These are 32bit
instructions in armv7-m and are not available in armv6-m.
Enable loader_code_stm32lx to run on both armv6-m and armv7-m by
building for armv6-m, which requires changing the `add` instructions to
`adds` instructions that do update condition flags (which is ok because
the subs updates the condition flags again before the branch).
stm32l1_write_half_pages uses a local flash_loader_t that is never
initialized.
This results in stlink_flash_loader_run using uninitialized values for
fl->buf_addr and fl->loader_addr when copying the buffer
and initializing the source register and PC before running the core to
execute the flashloader.
Pass the flash_loader_t from stlink_flashloader_write through to
stm32l1_write_half_pages and use that one instead of an uninitialized
local structure.
- Moved declarations for read/write functions to read_write.h .
- Checked & revised header includes
- Changed some datatypes for write_buffer_to_sram() to avoid explicit
casting.
- Ensure proper function declaration
- Moved some functions to related modules
- Checked & revised header includes
- Renamed "md5" to "lib_md5"
- New source file "md5"
- Unified variable types (Closes#909)
short --> int16_t
unsigned short --> uint16_t
int --> int32_t
unsigned int --> uint32_t
long --> int32_t
unsigned long --> uint32_t
long long --> int64_t
unsigned long long --> uint64_t
- Added missing header includes
- Moved chip-specific parameters into separate files (#1129)
- Aligned chip names & references
- General spelling & formatting fixes
- Set of fixes and improvements (#1154)
(Closes#237)