logo elektroda
logo elektroda
X
logo elektroda
REKLAMA
REKLAMA
Adblock/uBlockOrigin/AdGuard mogą powodować znikanie niektórych postów z powodu nowej reguły.

[Rozwiązano] STM32, J-LINK, Atolic TrueStudio debugowanie zawiesza się na samym początku

matej1410 10 Cze 2021 12:22 681 3
REKLAMA
  • #1 19473330
    matej1410
    Poziom 25  
    Posty: 1085
    Pomógł: 115
    Ocena: 219
    Witam serdecznie.
    Proszę o poradę. Programuje STM32L051 w Atolicu. Wstępna konfiguracja została wykonana poprzez Cube.

    Kod to tylko i wyłącznie ustawianie w pętli: naprzemiennie stanu wysokiego i niskiego na dwóch pinach z opóźnieniem i wygląda tak:

    Kod: C / C++
    Zaloguj się, aby zobaczyć kod


    Po kliknięciu w debugowanie J-link wrzuca do konsoli takie informacje:

    SEGGER J-Link GDB Server V6.44i Command Line Version

    JLinkARM.dll V6.44i (DLL compiled May 17 2019 17:34:22)

    Command line: -port 2331 -s -CPU Cortex-M -device STM32L051K8 -endian little -speed 4000 -if swd -vd
    -----GDB Server start settings-----
    GDBInit file: none
    GDB Server Listening port: 2331
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: localhost only
    Generate logfile: off
    Verify download: on
    Init regs on start: off
    Silent mode: off
    Single run mode: on
    Target connection timeout: 0 ms
    ------J-Link related settings------
    J-Link Host interface: USB
    J-Link script: none
    J-Link settings file: none
    ------Target related settings------
    Target device: STM32L051K8
    Target interface: SWD
    Target interface speed: 4000kHz
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link V10 compiled Nov 8 2019 16:40:12
    Hardware: V10.10
    S/N: 260116522
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    Checking target voltage...
    Target voltage: 3.74 V
    Listening on TCP/IP port 2331
    Connecting to target...Connected to target
    Waiting for GDB connection...Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x1FF0017A (Data = 0x28016920)
    Read 2 bytes @ address 0x1FF0017A (Data = 0x6920)
    Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x1FF0017A (Data = 0x28016920)
    Read 2 bytes @ address 0x1FF0017A (Data = 0x6920)
    Received monitor command: WriteDP 0x2 0x000000F0
    O.K.
    Received monitor command: ReadAP 0x2
    O.K.:0xF0000003
    Reading 32 bytes @ address 0xF0000FD0
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Received monitor command: speed 30
    Target interface speed set to 30 kHz
    Received monitor command: endian little
    Target endianess set to "little endian"
    Received monitor command: reset
    Resetting target
    Received monitor command: speed auto
    Select auto target interface speed (2000 kHz)
    Received monitor command: flash download = 1
    Flash download enabled
    Downloading 192 bytes @ address 0x08000000 - Verified OK
    Downloading 976 bytes @ address 0x080000C0 - Verified OK
    Downloading 976 bytes @ address 0x08000490 - Verified OK
    Downloading 976 bytes @ address 0x08000860 - Verified OK
    Downloading 960 bytes @ address 0x08000C30 - Verified OK
    Downloading 960 bytes @ address 0x08000FF0 - Verified OK
    Downloading 960 bytes @ address 0x080013B0 - Verified OK
    Downloading 960 bytes @ address 0x08001770 - Verified OK
    Downloading 976 bytes @ address 0x08001B30 - Verified OK
    Downloading 976 bytes @ address 0x08001F00 - Verified OK
    Downloading 960 bytes @ address 0x080022D0 - Verified OK
    Downloading 344 bytes @ address 0x08002690 - Verified OK
    Downloading 108 bytes @ address 0x080027E8 - Verified OK
    Downloading 8 bytes @ address 0x08002854 - Verified OK
    Downloading 4 bytes @ address 0x0800285C - Verified OK
    Downloading 4 bytes @ address 0x08002860 - Verified OK
    Downloading 12 bytes @ address 0x08002864 - Verified OK
    Writing register (PC = 0x 8002724)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 4 bytes @ address 0x08002724 (Data = 0x4685480D)
    Received monitor command: reset
    Resetting target
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Setting breakpoint @ address 0x08002278, Size = 2, BPHandle = 0x0001
    Starting target CPU...
    Debugger requested to halt target...
    ...Target halted (PC = 0x1FF000FE)
    Reading all registers
    Read 4 bytes @ address 0x1FF000FE (Data = 0x05408A28)
    Read 2 bytes @ address 0x1FF000FE (Data = 0x8A28)
    Removing breakpoint @ address 0x08002278, Size = 2
    Starting target CPU...
    Debugger requested to halt target...
    ...Target halted (PC = 0x1FF00118)
    Reading all registers
    Read 4 bytes @ address 0x1FF00118 (Data = 0x8980D002)
    Read 2 bytes @ address 0x1FF00118 (Data = 0xD002)
    Read 2 bytes @ address 0x08002278 (Data = 0xF7FE)
    Read 2 bytes @ address 0x0800228C (Data = 0x4B0B)
    Starting target CPU...


    po czym zawisa i nie można kliknąć w Resume, Step over ani Step into ponieważ pola te są wyszarzone:
    STM32, J-LINK, Atolic TrueStudio debugowanie zawiesza się na samym początku
    Dlaczego tak się dzieje? Czy to kwesta niepoprawnej konfiguracji J-Linka?

    Dodano po 35 [minuty]:

    Na ST-link/V2 dzieje się dokładnie to samo.
  • REKLAMA
  • Pomocny post
    #2 19473443
    BlueDraco
    Specjalista - Mikrokontrolery
    Posty: 6479
    Pomógł: 939
    Ocena: 421
    A z jakiego to powodu używasz starej wersji oprogramowania ze znanymi usterkami zamiast aktualnej, wolnej od tych usterek? ściągnij STM32CubeIDE, a prawdopodobnie większość problemów z debugowaniem zniknie, tak to przynajmniej wynika z moich doświadczeń.

    Aha, no i zawsze możesz kliknąć w Pauzę lub Stop, które nie są na szaro. Może w konfiguracji debugowania nie ma włączonej pułapki na początku main()?
  • REKLAMA
  • #3 19473509
    matej1410
    Poziom 25  
    Posty: 1085
    Pomógł: 115
    Ocena: 219
    BlueDraco dziękuję za wskazówki. Pobrałem STM32CubeIDE i wszystko super działa.
  • #4 19473536
    matej1410
    Poziom 25  
    Posty: 1085
    Pomógł: 115
    Ocena: 219
    BlueDraco dziękuję za wskazówki. Pobrałem STM32CubeIDE i wszystko super działa.

    Dodano po 23 [minuty]:

    Przed pobraniem STM32CubeIDE 1.6.1 używałem STM32CubeMX do generowania kodu z konfiguracja natomiast po wygenerowaniu kodu do programowania używałem Atolic TrueStudio w wersji 9.3.0.

    Po zainstalowaniu STM32CubeIDE, które łączy ze sobą funkcjonalność STM32CubeMX oraz Atolic TrueStudio problem opisany w tym temacie zniknął.
    Polecam to środowisko.
REKLAMA