Menu

#382 errorin target/stm32h7x.cfg

0.11.0
new
nobody
None
2023-03-26
2023-02-09
No

if i do connect to a STM32H7 target, i get

Error executing event examine-end on target stm32h7x.cpu0:
/usr/bin/../share/openocd/scripts/target/stm32h7x.cfg:202: Error: wrong # args: should be "expr expression"
in procedure 'stm32h7x_dbgmcu_mmw' called at file "/usr/bin/../share/openocd/scripts/target/stm32h7x.cfg", line 166
in procedure 'stm32h7x_get_chipname' called at file "/usr/bin/../share/openocd/scripts/target/stm32h7x.cfg", line 243
at file "/usr/bin/../share/openocd/scripts/target/stm32h7x.cfg", line 202

something seems to be wrong in line 202 (return statement):

# get _CHIPNAME from current target
proc stm32h7x_get_chipname {} {
        set t [target current]
        set sep [string last "." $t]
        if {$sep == -1} {
                return $t
        }
        return [string range $t 0 [expr $sep - 1]]
}

unfort i dont speak tcl …

Discussion

  • Niki W. Waibel

    Niki W. Waibel - 2023-02-10

    so it seems within expr, curly brackets are required:
    return [string range $t 0 [expr $sep - 1]]
    -->
    return [string range $t 0 [expr {$sep - 1}]]
    that's a simple fix. cheers.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.