8000 stm32/boards: Allow OpenOCD stm_flash procedure to accept single FW img. · msuszko/micropython@59f409a · GitHub
[go: up one dir, main page]

Skip to content

Commit 59f409a

Browse files
committed
stm32/boards: Allow OpenOCD stm_flash procedure to accept single FW img.
To support deplop-openocd on target boards that use TEXT0_ADDR only and have their firmware in a single binary image.
1 parent d4d4bc5 commit 59f409a

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

ports/stm32/boards/openocd_stm32f4.cfg

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,20 @@ source [find target/stm32f4x.cfg]
1717
reset_config srst_only
1818
init
1919

20-
proc stm_flash { BIN0 ADDR0 BIN1 ADDR1 } {
20+
proc stm_flash { BIN0 ADDR0 {BIN1 ""} {ADDR1 ""} } {
2121
reset halt
2222
sleep 100
2323
wait_halt 2
2424
flash write_image erase $BIN0 $ADDR0
2525
sleep 100
2626
verify_image $BIN0 $ADDR0
2727
sleep 100
28-
flash write_image erase $BIN1 $ADDR1
29-
sleep 100
30-
verify_image $BIN1 $ADDR1
31-
sleep 100
28+
if {$BIN1 ne ""} {
29+
flash write_image erase $BIN1 $ADDR1
30+
sleep 100
31+
verify_image $BIN1 $ADDR1
32+
sleep 100
33+
}
3234
reset run
3335
shutdown
3436
}

ports/stm32/boards/openocd_stm32f7.cfg

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,20 @@ source [find target/stm32f7x.cfg]
1717
reset_config srst_only
1818
init
1919

20-
proc stm_flash { BIN0 ADDR0 BIN1 ADDR1 } {
20+
proc stm_flash { BIN0 ADDR0 {BIN1 ""} {ADDR1 ""} } {
2121
reset halt
2222
sleep 100
2323
wait_halt 2
2424
flash write_image erase $BIN0 $ADDR0
2525
sleep 100
2626
verify_image $BIN0 $ADDR0
2727
sleep 100
28-
flash write_image erase $BIN1 $ADDR1
29-
sleep 100
30-
verify_image $BIN1 $ADDR1
31-
sleep 100
28+
if {$BIN1 ne ""} {
29+
flash write_image erase $BIN1 $ADDR1
30+
sleep 100
31+
verify_image $BIN1 $ADDR1
32+
sleep 100
33+
}
3234
reset run
3335
shutdown
3436
}

ports/stm32/boards/openocd_stm32l4.cfg

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,20 @@ source [find target/stm32l4x.cfg]
1717
reset_config srst_only
1818
init
1919

20-
proc stm_flash { BIN0 ADDR0 BIN1 ADDR1 } {
20+
proc stm_flash { BIN0 ADDR0 {BIN1 ""} {ADDR1 ""} } {
2121
reset halt
2222
sleep 100
2323
wait_halt 2
2424
flash write_image erase $BIN0 $ADDR0
2525
sleep 100
2626
verify_image $BIN0 $ADDR0
2727
sleep 100
28-
flash write_image erase $BIN1 $ADDR1
29-
sleep 100
30-
verify_image $BIN1 $ADDR1
31-
sleep 100
28+
if {$BIN1 ne ""} {
29+
flash write_image erase $BIN1 $ADDR1
30+
sleep 100
31+
verify_image $BIN1 $ADDR1
32+
sleep 100
33+
}
3234
reset run
3335
shutdown
3436
}

0 commit comments

Comments
 (0)
0