Skip to content

Commit

Permalink
Merge pull request #138 from 6thimage/master
Browse files Browse the repository at this point in the history
Fix for programming STM32L152
  • Loading branch information
texane committed Mar 22, 2013
2 parents 69fecdc + 0b2c105 commit d1635e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions flash/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,16 @@ int main(int ac, char** av)
stlink_enter_swd_mode(sl);

// Disable DMA - Set All DMA CCR Registers to zero. - AKS 1/7/2013
if (sl->chip_id == STM32_CHIPID_F4)
{
memset(sl->q_buf,0,4);
for (int i=0;i<8;i++) {
stlink_write_mem32(sl,0x40026000+0x10+0x18*i,4);
stlink_write_mem32(sl,0x40026400+0x10+0x18*i,4);
stlink_write_mem32(sl,0x40026000+0x24+0x18*i,4);
stlink_write_mem32(sl,0x40026400+0x24+0x18*i,4);
}
}
if (o.cmd == DO_WRITE) /* write */
{
if ((o.addr >= sl->flash_base) &&
Expand Down
2 changes: 1 addition & 1 deletion src/stlink-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ int run_flash_loader(stlink_t *sl, flash_loader_t* fl, stm32_addr_t target, cons
}

if (i >= WAIT_ROUNDS) {
fatal("flash loader run error\n");
ELOG("flash loader run error\n");
return -1;
}

Expand Down

0 comments on commit d1635e8

Please sign in to comment.