Skip to content

Commit

Permalink
Fix apparent STM32G0 flashing issue. (#797)
Browse files Browse the repository at this point in the history
* Add simple read/write support for STM32WB55 chips.

* Clean up and unify G0/WB erase/program operations.

* Fix apparent issue with STM32G0 flashing.
  • Loading branch information
WRansohoff authored and xor-gate committed Apr 26, 2019
1 parent feb8661 commit cf67780
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ int stlink_erase_flash_page(stlink_t *sl, stm32_addr_t flashaddr)
uint32_t flash_page = ((flashaddr - STM32_FLASH_BASE) / sl->flash_pgsz);
stlink_read_debug32(sl, STM32G0_FLASH_CR, &val);
// sec 3.7.5 - PNB[5:0] is offset by 3. PER is 0x2.
val |= ((flash_page & 0x3F) << 3);
val = ((flash_page & 0x3F) << 3) | ( 1 << FLASH_CR_PER );
stlink_write_debug32(sl, STM32G0_FLASH_CR, val);
}

Expand Down

0 comments on commit cf67780

Please sign in to comment.