Skip to main content
Graduate
August 6, 2024
Solved

Connect a debugger to STM32MP257F-EV1 board

  • August 6, 2024
  • 1 reply
  • 2883 views

Hi,

At my company, we develop debuggers and are trying to access STM32MP257F-EV1(ES) board via the DAP,
Unfortunately, we are unable to access the DAP and it seems like JTAG (DAP) access is prohibited by hardware
.
The result was the same even after shorting JP3 and turning off ST-LINK.

I have the following questions:

  1. Are there any other jumpers positions that have to be changed? Please let me know.
  2. Does STM32MP257F-EV1(ES) have debug authentication enabled by default?
    If so, please let me know if there are any technical documents that explain the procedure for debug authentication.
  3. I tried to connect to the on-board debugger by running STM32CubeProgrammer and choosing ST-LINK (SWD), but access was denied.
    The boot mode that I tried were "UART/USB" and "Development", but both showed the following error:
    Error: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication
    Please let me know if there is a document or URL that explains how
    STM32CubeProgrammer can be used to access STM32MP257F.

I would appreciate any response.
Thank you.

    This topic has been closed for replies.
    Best answer by PatrickF

    Hi,

    in 'development boot' (BOOT=0b0011 or 0b1100), the debug is enabled and nothing specific is needed to access thru JTAG/SWD. In development boot, the red led (LD1, close to reset button) is light.

    As you are building debuggers for ST chipset, There is maybe some partnership already in place. Could you give me more details on your company and if you get the board through distributor or directly from ST (by private message if you prefer).

    If it helps, here is part of the T32 initialisation I use:

    SYStem.RESetOut
    
    wait 100.ms
    
    ; Cortex-A35
    sys.cpu CortexA35
    
    ; JTAG/SWD freq
    system.JTAGCLOCK 2M
    SYSTEM.CONFIG.DEBUGPORTTYPE SWD
    SYStem.CONFIG SWDP ON
    
    ; DAP Config
    sys.config CHIPIRPRE 4.
    sys.config CHIPDRPRE 1.
    sys.config DAPIRPOST 5.
    sys.config DAPDRPOST 1.
    
    ; Dual core (A35)
    system.CONFIG.CoreNumber 2.
    
    ;Assign the two CA35 to this debug session
    core.assign 1. 2.
    
    ; Debug base address for each core
    SYStem.CONFIG.COREDEBUG.Base DAP:0x80210000 DAP:0x80310000
    
    ; Config access ports
    SYStem.CONFIG MEMORYACCESSPORT 0.
    SYStem.CONFIG AHBACCESSPORT 0.
    SYStem.CONFIG APBACCESSPORT 0.
    SYStem.CONFIG DEBUGACCESSPORT 0.
    SYStem.CONFIG AXIACCESSPORT 4.
    
    sys.o.WaitReset 1.s
    
    sys.o.EnReset OFF
    sys.o.ResBreak OFF
    
    ; connect DAP only
    SYStem.Mode.Prepare
    
    ; Disable vector catch
    tronchip.reset
    tronchip.set reset off
    tronchip.set StepVector off
    
    ; Attach and halt
    sys.mode.up
    if run()
    	break.

     

    I you cannot progress, maybe ask for direct support to your local ST representative.

     

    Regards.

    1 reply

    Technical Moderator
    August 6, 2024

    Hi @Aiyps 

    please see some answers:

    1. JP3 is not needed to allows 3rd party debugger access thru CN22. You could keep JP3 off to use STLINK VCP for console(s) even with CN22 usage

    2. There is no debug authentication, but debug is not enabled in all cases. 'Development boot' could be used to debug (or need to have a SW running which enable the debug inside BSEC)

    3. Unlike STM32MCUs, CubeProgrammer cannot be used with STLINK. Only USB or UART is available for download binaries. STLINK is only for debugging purpose (e.g. CubeIDE) and to show UART VCP for serial console(s)

    CubeProgrammer should work to download Starter Package into flash (with adequate BOOT pins). See https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP2_boards/STM32MP257x-EV1/Let%27s_start/Populate_the_target_and_boot_the_image

     

    I personally use a 3rd party debugger (Lauterbach Trace32 PowerDebug) on EV board without issues.

     

    Could you please precise which board revision (MB1936x) and which device revision (B, X or Y, seen on top of  STM32MP257 package) you have ?

    Regards.

    AiypsAuthor
    Graduate
    August 7, 2024

    Hi @PatrickF  

    Thank you for your reply.
    Please find the details of the board below:

    • Main Board: MB1936-MP257F_X-C01
    • Chip details: "ES2MP257F AI3 - AA042 9R B - TWN 3R 410 - 05". "E2" is mentioned on the top.
      I have attached the photo of the package for your reference.
      Aiyps_1-1723007143942.png

    Note that the STM32MP257F-EV1 board has a sticker with "ES" on it. 

     

    Thank you, I understand that CubeProgrammer cannot be used via ST-LINK to debug and can only be used to flash images. We will try to use STM32CubeIDE instead via ST-LINK(SWD).

    Since you are able to perform debug by connecting Lauterbach Trace32 PowerDebug via the MIPI10 connector (CN22) of the STM32MP257F-EV1, could you please let me know if there is any procedure to be followed (jumper, boot mode etc.) when
    Lauterbach debugger is used.

    We thought that when the board is booted using 'Development boot', JTAG (DAP) would be enabled. But unfortunately access is denied.

    I would appreciate any help with regard to this.

    Thank you again.

    PatrickFAnswer
    Technical Moderator
    August 7, 2024

    Hi,

    in 'development boot' (BOOT=0b0011 or 0b1100), the debug is enabled and nothing specific is needed to access thru JTAG/SWD. In development boot, the red led (LD1, close to reset button) is light.

    As you are building debuggers for ST chipset, There is maybe some partnership already in place. Could you give me more details on your company and if you get the board through distributor or directly from ST (by private message if you prefer).

    If it helps, here is part of the T32 initialisation I use:

    SYStem.RESetOut
    
    wait 100.ms
    
    ; Cortex-A35
    sys.cpu CortexA35
    
    ; JTAG/SWD freq
    system.JTAGCLOCK 2M
    SYSTEM.CONFIG.DEBUGPORTTYPE SWD
    SYStem.CONFIG SWDP ON
    
    ; DAP Config
    sys.config CHIPIRPRE 4.
    sys.config CHIPDRPRE 1.
    sys.config DAPIRPOST 5.
    sys.config DAPDRPOST 1.
    
    ; Dual core (A35)
    system.CONFIG.CoreNumber 2.
    
    ;Assign the two CA35 to this debug session
    core.assign 1. 2.
    
    ; Debug base address for each core
    SYStem.CONFIG.COREDEBUG.Base DAP:0x80210000 DAP:0x80310000
    
    ; Config access ports
    SYStem.CONFIG MEMORYACCESSPORT 0.
    SYStem.CONFIG AHBACCESSPORT 0.
    SYStem.CONFIG APBACCESSPORT 0.
    SYStem.CONFIG DEBUGACCESSPORT 0.
    SYStem.CONFIG AXIACCESSPORT 4.
    
    sys.o.WaitReset 1.s
    
    sys.o.EnReset OFF
    sys.o.ResBreak OFF
    
    ; connect DAP only
    SYStem.Mode.Prepare
    
    ; Disable vector catch
    tronchip.reset
    tronchip.set reset off
    tronchip.set StepVector off
    
    ; Attach and halt
    sys.mode.up
    if run()
    	break.

     

    I you cannot progress, maybe ask for direct support to your local ST representative.

     

    Regards.