Skip to main content
Visitor II
October 25, 2022
Solved

Using STLink with STM32MP151 - illegal access error

  • October 25, 2022
  • 1 reply
  • 2276 views

We have a custom PCB application that uses the STM32MP151CAC1 as the main CPU. We have tried to use an STLink v3 to connect to the chip over SWD, but have been unable to do so. The chip (through UART4) throws the following error when I try to connect:

ERROR: Illegal access to 0xe000edf0:
ERROR: FAIL_ID = 0x2
ERROR: Non-Secure
ERROR: Privilege
ERROR: Write
PANIC at PC : 0x2ffc9b61
Exception mode=0x00000016 at: 0x2ffc9b61

Meanwhile, on the STCube Programmer, depending on what settings I have, I get one of the following error messages:

Error: Cannot connect to access port 1 If you are trying to connet to a device with TrustZone enabled please try to connect with HotPlug mode

Error: DEV_UNKNOWN_MCU_TARGET

Error: Cannot identify the device

Some additional information:

The signals I'm trying to communicate over are:

JTMS (pin C20 on the STM32MP1)

JTCK (B20)

JTDI (A20)

JTDO (A19)

JTRST (19)

Of those, JTMS and JTRST are pulled up to VDD through 10K resistors. JTCK is pulled down to ground through another 10K resistor. Let me know if that shouldn't be the case.

    This topic has been closed for replies.
    Best answer by Olivier GALLIEN

    Hi @TCros.1​ ,

    it's seems you are trying to use STM32CubeProgrammer with ST-Link, which is not supported with STM32MPx. USB (or UART) must be used with CubeProgrammer.

    Nevertheless, STLINK connection could be tested using the openocd command used in https://wiki.st.com/stm32mpu/wiki/STM32_MPU_ROM_trace_analyzer#On_STM32MP15x_lines (to be done in either Engi boot or when BootROM is waiting for USB/serial boot).

    For HW, checks please refer to AN5031 Figure 18. JTAG/SWD MIPI10 connector implementation example

    Olivier

    1 reply

    Technical Moderator
    October 28, 2022

    Hi @TCros.1​ ,

    it's seems you are trying to use STM32CubeProgrammer with ST-Link, which is not supported with STM32MPx. USB (or UART) must be used with CubeProgrammer.

    Nevertheless, STLINK connection could be tested using the openocd command used in https://wiki.st.com/stm32mpu/wiki/STM32_MPU_ROM_trace_analyzer#On_STM32MP15x_lines (to be done in either Engi boot or when BootROM is waiting for USB/serial boot).

    For HW, checks please refer to AN5031 Figure 18. JTAG/SWD MIPI10 connector implementation example

    Olivier

    TCros.1Author
    Visitor II
    November 3, 2022

    Good to know, thanks!!