Skip to content

Commit

Permalink
Clears DMA config registers for Discovery F4 board
Browse files Browse the repository at this point in the history
to allow flash programming.  See texane/stlink issue stlink-org#74.
  • Loading branch information
A Sheaff committed Jan 9, 2013
1 parent d66a700 commit 0ed3907
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flash/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ int main(int ac, char** av)
if (stlink_current_mode(sl) != STLINK_DEV_DEBUG_MODE)
stlink_enter_swd_mode(sl);

// Disable DMA - Set All DMA CCR Registers to zero. - AKS 1/7/2013
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

0 comments on commit 0ed3907

Please sign in to comment.