Elektroda.pl
Elektroda.pl
X
Proszę, dodaj wyjątek dla www.elektroda.pl do Adblock.
Dzięki temu, że oglądasz reklamy, wspierasz portal i użytkowników.

stm32 primer, openocd i rlink

27 Lip 2010 21:04 3215 6
  • Poziom 16  
    próbuje uruchomić openocd i rlinka na targecie stm32 primer (circle).
    Komunikacja z Ride7 działa, ale chciałem skonfigurować eklipsa tak jak radzi Freedie.
    Skompilowałem openocd 0.4.0
    odpalam:
    G:\arm\openocd\tcl>openocd openocd -d 3 -l openocd.log -f interface/rlink.cfg -f
    board/stm3210e_eval.cfg
    lub
    G:\arm\openocd\tcl>openocd openocd -d 3 -l openocd.log -f interface/rlink.cfg -f
    board/stm32f10x_128k_eval.cfg

    i w logu dostaje coś takiego:
    Code:


    Debug: 14 9 configuration.c:45 add_script_search_dir(): adding /home/Viki/.openocd
    Debug: 15 9 configuration.c:45 add_script_search_dir(): adding /usr/local/share/openocd/site
    Debug: 16 9 configuration.c:45 add_script_search_dir(): adding /usr/local/share/openocd/scripts
    Debug: 17 10 configuration.c:87 find_file(): found interface/rlink.cfg
    Debug: 18 10 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_interface rlink
    Debug: 19 10 command.c:133 script_debug(): command - interface ocd_interface rlink
    Debug: 21 11 configuration.c:87 find_file(): found board/stm3210e_eval.cfg
    Debug: 22 12 configuration.c:87 find_file(): found target/stm32.cfg
    Debug: 23 13 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_jtag_khz 1000
    Debug: 24 13 command.c:133 script_debug(): command - jtag_khz ocd_jtag_khz 1000
    Debug: 26 13 core.c:1560 jtag_config_khz(): handle jtag khz
    Debug: 27 13 core.c:1523 jtag_khz_to_speed(): convert khz to interface specific speed value
    User : 28 13 command.c:539 command_print(): 1000 kHz
    Debug: 29 13 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_jtag_nsrst_delay 100
    Debug: 30 13 command.c:133 script_debug(): command - jtag_nsrst_delay ocd_jtag_nsrst_delay 100
    User : 32 13 command.c:539 command_print(): jtag_nsrst_delay: 100
    Debug: 33 13 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_jtag_ntrst_delay 100
    Debug: 34 13 command.c:133 script_debug(): command - jtag_ntrst_delay ocd_jtag_ntrst_delay 100
    User : 36 13 command.c:539 command_print(): jtag_ntrst_delay: 100
    Debug: 37 14 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_jtag newtap stm32 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x3ba00477
    Debug: 38 14 command.c:133 script_debug(): command - ocd_jtag ocd_jtag newtap stm32 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x3ba00477
    Debug: 39 14 tcl.c:568 jim_newtap_cmd(): Creating New Tap, Chip: stm32, Tap: cpu, Dotted: stm32.cpu, 8 params
    Debug: 40 14 tcl.c:585 jim_newtap_cmd(): Processing option: -irlen
    Debug: 41 14 tcl.c:585 jim_newtap_cmd(): Processing option: -ircapture
    Debug: 42 14 tcl.c:585 jim_newtap_cmd(): Processing option: -irmask
    Debug: 43 14 tcl.c:585 jim_newtap_cmd(): Processing option: -expected-id
    Debug: 44 14 core.c:1300 jtag_tap_init(): Created Tap: stm32.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0xf
    Debug: 45 14 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_jtag newtap stm32 bs -irlen 5 -expected-id 0x06412041 -expected-id 0x06410041 -expected-id 0x16410041 -expected-id 0x06414041 -expected-id 0x06418041
    Debug: 46 14 command.c:133 script_debug(): command - ocd_jtag ocd_jtag newtap stm32 bs -irlen 5 -expected-id 0x06412041 -expected-id 0x06410041 -expected-id 0x16410041 -expected-id 0x06414041 -expected-id 0x06418041
    Debug: 47 14 tcl.c:568 jim_newtap_cmd(): Creating New Tap, Chip: stm32, Tap: bs, Dotted: stm32.bs, 12 params
    Debug: 48 14 tcl.c:585 jim_newtap_cmd(): Processing option: -irlen
    Debug: 49 14 tcl.c:585 jim_newtap_cmd(): Processing option: -expected-id
    Debug: 50 14 tcl.c:585 jim_newtap_cmd(): Processing option: -expected-id
    Debug: 51 14 tcl.c:585 jim_newtap_cmd(): Processing option: -expected-id
    Debug: 52 14 tcl.c:585 jim_newtap_cmd(): Processing option: -expected-id
    Debug: 53 14 tcl.c:585 jim_newtap_cmd(): Processing option: -expected-id
    Debug: 54 14 core.c:1300 jtag_tap_init(): Created Tap: stm32.bs @ abs position 0, irlen 5, capture: 0x1 mask: 0x3
    Debug: 55 15 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_target create stm32.cpu cortex_m3 -endian little -chain-position stm32.cpu
    Debug: 56 15 command.c:133 script_debug(): command - ocd_target ocd_target create stm32.cpu cortex_m3 -endian little -chain-position stm32.cpu
    Debug: 57 15 command.c:346 register_command_handler(): registering 'ocd_dap'...
    Debug: 58 15 command.c:346 register_command_handler(): registering 'ocd_dap'...
    Debug: 59 16 command.c:346 register_command_handler(): registering 'ocd_dap'...
    Debug: 60 16 command.c:346 register_command_handler(): registering 'ocd_dap'...
    Debug: 61 16 command.c:346 register_command_handler(): registering 'ocd_dap'...
    Debug: 62 16 command.c:346 register_command_handler(): registering 'ocd_cortex_m3'...
    Debug: 63 16 command.c:346 register_command_handler(): registering 'ocd_cortex_m3'...
    Debug: 64 16 command.c:346 register_command_handler(): registering 'ocd_cortex_m3'...
    Debug: 65 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 66 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 67 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 68 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 69 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 70 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 71 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 72 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 73 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 74 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 75 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 76 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 77 16 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 78 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 79 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 80 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 81 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 82 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 83 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 84 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 85 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 86 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 87 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 88 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 89 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 90 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 91 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 92 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 93 17 command.c:346 register_command_handler(): registering 'ocd_stm32.cpu'...
    Debug: 94 17 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_stm32.cpu configure -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0
    Debug: 95 17 command.c:133 script_debug(): command - ocd_stm32.cpu ocd_stm32.cpu configure -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0
    Debug: 96 18 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_flash bank stm32.flash stm32x 0 0 0 0 stm32.cpu
    Debug: 97 18 command.c:133 script_debug(): command - ocd_flash ocd_flash bank stm32.flash stm32x 0 0 0 0 stm32.cpu
    Debug: 99 18 command.c:346 register_command_handler(): registering 'ocd_stm32x'...
    Debug: 100 18 command.c:346 register_command_handler(): registering 'ocd_stm32x'...
    Debug: 101 18 command.c:346 register_command_handler(): registering 'ocd_stm32x'...
    Debug: 102 18 command.c:346 register_command_handler(): registering 'ocd_stm32x'...
    Debug: 103 18 command.c:346 register_command_handler(): registering 'ocd_stm32x'...
    Debug: 104 18 httpd_stubs.c:28 httpd_start(): libocdserver was built without HTTPD support
    Debug: 105 33 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_init
    Debug: 106 33 command.c:133 script_debug(): command - init ocd_init
    Debug: 108 33 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_target init
    Debug: 109 33 command.c:133 script_debug(): command - ocd_target ocd_target init
    Debug: 111 33 target.c:835 handle_target_init_command(): Initializing targets...
    Debug: 112 33 command.c:346 register_command_handler(): registering 'ocd_target_request'...
    Debug: 113 33 command.c:346 register_command_handler(): registering 'ocd_trace'...
    Debug: 114 34 command.c:346 register_command_handler(): registering 'ocd_trace'...
    Debug: 115 34 command.c:346 register_command_handler(): registering 'ocd_fast_load_image'...
    Debug: 116 34 command.c:346 register_command_handler(): registering 'ocd_fast_load'...
    Debug: 117 34 command.c:346 register_command_handler(): registering 'ocd_profile'...
    Debug: 118 34 command.c:346 register_command_handler(): registering 'ocd_virt2phys'...
    Debug: 119 34 command.c:346 register_command_handler(): registering 'ocd_reg'...
    Debug: 120 34 command.c:346 register_command_handler(): registering 'ocd_poll'...
    Debug: 121 34 command.c:346 register_command_handler(): registering 'ocd_wait_halt'...
    Debug: 122 34 command.c:346 register_command_handler(): registering 'ocd_halt'...
    Debug: 123 34 command.c:346 register_command_handler(): registering 'ocd_resume'...
    Debug: 124 34 command.c:346 register_command_handler(): registering 'ocd_reset'...
    Debug: 125 34 command.c:346 register_command_handler(): registering 'ocd_soft_reset_halt'...
    Debug: 126 34 command.c:346 register_command_handler(): registering 'ocd_step'...
    Debug: 127 34 command.c:346 register_command_handler(): registering 'ocd_mdw'...
    Debug: 128 34 command.c:346 register_command_handler(): registering 'ocd_mdh'...
    Debug: 129 34 command.c:346 register_command_handler(): registering 'ocd_mdb'...
    Debug: 130 34 command.c:346 register_command_handler(): registering 'ocd_mww'...
    Debug: 131 34 command.c:346 register_command_handler(): registering 'ocd_mwh'...
    Debug: 132 34 command.c:346 register_command_handler(): registering 'ocd_mwb'...
    Debug: 133 34 command.c:346 register_command_handler(): registering 'ocd_bp'...
    Debug: 134 35 command.c:346 register_command_handler(): registering 'ocd_rbp'...
    Debug: 135 35 command.c:346 register_command_handler(): registering 'ocd_wp'...
    Debug: 136 35 command.c:346 register_command_handler(): registering 'ocd_rwp'...
    Debug: 137 35 command.c:346 register_command_handler(): registering 'ocd_load_image'...
    Debug: 138 35 command.c:346 register_command_handler(): registering 'ocd_dump_image'...
    Debug: 139 35 command.c:346 register_command_handler(): registering 'ocd_verify_image'...
    Debug: 140 35 command.c:346 register_command_handler(): registering 'ocd_test_image'...
    Debug: 141 35 command.c:346 register_command_handler(): registering 'ocd_reset_nag'...
    Debug: 142 38 command.c:620 run_command(): Command failed with error code -100
    User : 143 38 command.c:824 openocd_jim_vfprintf(): Command handler execution failed
    User : 146 38 command.c:824 openocd_jim_vfprintf():
    User : 148 38 command.c:824 openocd_jim_vfprintf(): 


    co jest nie tak?
  • Pomocny post
    Specjalista - Mikrokontrolery
    Użyj OpenOCD skompilowanego przeze mnie i wyłącz ten debug level 3, bo ja w sumie nie widzę co się dzieje...

    Tak w ogóle to nie wiem czy wiesz, ale OpenOCD wymaga innych sterowników do RLinka niż Ride - sterowniki te dołączone są do paczki z OpenOCD z mojej strony.

    4\/3!!
  • Poziom 16  
    Dzięki Freddie. Jestem już o krok bliżej. Zainstalowałem drivery z najnowszej paczki openocd z Twojej strony. (nie wiedziałem, że Ride7 i openocd wymagają różnych sterów) Zainstalowałem też openocd 0.4.0 ze strony. Teraz zostaje w sesji openocd, ale pojawia się błąd:

    Code:

    G:\arm\openocd\src>openocd -f ..\tcl\interface\rlink.cfg
    Open On-Chip Debugger 0.4.0 (2010-07-28-23:12)
    Licensed under GNU GPL v2
    For bug reports, read
            http://openocd.berlios.de/doc/doxygen/bugs.html
    Error: 0 is not a supported speed
    Info : interface specific clock speed value 0
    Warn : There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!
    Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -expected-id 0x3ba00477 ..."
    Warn : AUTO auto1.tap - use "jtag newtap auto1 tap -expected-id 0x16410041 ..."
    Warn : AUTO auto0.tap - use "... -irlen 4"
    Warn : AUTO auto1.tap - use "... -irlen 5"
    Warn : gdb services need one or more targets defined


    Code:

    G:\arm\openocd\src>openocd -f ..\tcl\interface\rlink.cfg -f ..\tcl\target\stm32.
    cfg
    Open On-Chip Debugger 0.4.0 (2010-07-28-23:12)
    Licensed under GNU GPL v2
    For bug reports, read
            http://openocd.berlios.de/doc/doxygen/bugs.html
    1000 kHz
    jtag_nsrst_delay: 100
    jtag_ntrst_delay: 100
    Info : clock speed 375 kHz
    Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba0
    0, ver: 0x3)
    Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410
    , ver: 0x1)
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0xe0001004
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0xe0001004
    Warn : Block read error address 0xe0001000, count 0x1
    Info : stm32.cpu: hardware has 6 breakpoints, 0 watchpoints
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed


    Jak na razie w necie nic nie znalazłem więc liczę na pomoc.
    p.s. moja kompilacja openocd z --enable-rlink daje ten sam błąd
    pozdrawiam
  • Specjalista - Mikrokontrolery
    Te błędy wyskakują Ci przy debuggowaniu czy od razu po włączeniu OpenOCD? Bo jeśli przy debuggowaniu, to się nie przejmuj, bo to "normalne". Popróbuj debuggować.

    No i zawsze możesz zmniejszyć prędkość JTAGa dodając na końcu wywołania -c "jtag_khz XXX".

    W wolnej chwili możesz też dorzucić do któregoś pliku konfiguracyjnego "reset_config trst_and_srst"

    4\/3!!
  • Poziom 16  
    Ciągle nic. Nie mogę zacząć debugowania ba cały czas dostaje śmieci jak poniżej.
    Może Freddie masz pomysł co jeszcze mogę pozmieniać?


    Code:

    G:\arm\openocd\tcl>openocd -f interface/rlink.cfg -f board/stm32f10x_128k_eval.c
    fg -c "jtag_khz 300"
    Open On-Chip Debugger 0.4.0 (2010-07-27-20:27)
    Licensed under GNU GPL v2
    For bug reports, read
            http://openocd.berlios.de/doc/doxygen/bugs.html
    1000 kHz
    jtag_nsrst_delay: 100
    jtag_ntrst_delay: 100
    trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
    300 kHz
    Warn : The lowest supported JTAG speed is 375 KHz
    Warn : The lowest supported JTAG speed is 375 KHz
    Info : clock speed 375 kHz
    Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba0
    0, ver: 0x3)
    Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410
    , ver: 0x1)
    Warn : Block read error address 0xe000ed00, count 0x1
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
    Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
    Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe000edf0
  • Specjalista - Mikrokontrolery
    No cóż, nie wiem... U mnie primer poszedł bez większych problemów, ale ostatnio miałem go w ręce półtora roku temu - za czasów OpenOCD 0.1.0 - może spróbuj z tamtą antyczną wersją i zobaczysz czy to problem programu czy sprzętu...

    4\/3!!
  • Poziom 16  
    Przeinstalowałem driver i działa. Teraz mam nadzieje integracja z eclipse pójdzie już łatwiej