Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some flashing issues on STM32L0 #1330

Merged

Commits on Aug 27, 2023

  1. Fix use of uninitialized flash_loader_t in stm32l1_write_half_pages

    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.
    andars committed Aug 27, 2023
    Configuration menu
    Copy the full SHA
    2e6cf7d View commit details
    Browse the repository at this point in the history
  2. Fix stm32lx flash loader on STM32L0

    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, stlink-org#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).
    andars committed Aug 27, 2023
    Configuration menu
    Copy the full SHA
    1861b8d View commit details
    Browse the repository at this point in the history