[SOLVED] STM32 and Kinetis MCU in daisy chain

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] STM32 and Kinetis MCU in daisy chain

    Hello!

    I'm trying to program a STM32F446RE and a MKV46F256 CPU via JTAG in daisy chain.

    My setup is this:
    TDI -> STM32F446RE -> MKV46F256 -> TDO

    On Windows I can connect to the STM32, debugging works fine. The MKV46F256 I can't reach. I get the following messages:
    SEGGER J-Link GDB Server V6.34e Command Line Version


    JLinkARM.dll V6.34e (DLL compiled Aug 30 2018 17:36:45)


    Command line: -nosilent -swoport 2332 -select USB=50123300 -telnetport 2333 -singlerun -endian little -noir -speed 1000 -port 2331 -jtagconf 9,2 -powertarget 50 -vd -device MKV46F256xxx16 -if JTAG -halt -reportuseraction
    -----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: MKV46F256xxx16
    Target interface: JTAG
    Target interface speed: 1000kHz
    Target endian: little


    Connecting to J-Link...
    J-Link is connected.
    Device "MKV46F256XXX16" selected.
    Firmware: J-Link V10 compiled Sep 4 2018 11:24:21
    Hardware: V10.10
    S/N: 50123300
    Feature(s): GDB
    Checking target voltage...
    Target voltage: 3.27 V
    Listening on TCP/IP port 2331
    Connecting to target...InitTarget()
    Connect Under Reset
    Connect Under Reset
    InitTarget()
    Connect Under Reset
    Connect Under Reset
    ERROR: InitTarget(): PCode returned with error code -1


    ERROR: Could not connect to target.
    Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
    Shutting down...
    Could not connect to target.
    Please check power, connection and settings.

    JTAG scan looks like this:
    Connecting to target via JTAG
    TotalIRLen = 13, IRPrint = 0x0211
    JTAG chain detection found 3 devices:
    #0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    #1 Id: 0x06421041, IRLen: 05, STM32 Boundary Scan
    #2 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP

    What could be wrong?

    Regards

    Konrad
  • Hello Konrad,

    Thank you for your inquiry.
    When setting up your daisy chain connections, did you consider the design recommendations when chaining Kinetis devices?
    wiki.segger.com/Kinetis_Series…e_devices_in_a_scan-chain

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    Alternatively our support ticketing system can be used as well: segger.com/ticket/
  • Hi Nino,

    here is an update. In the meantime I can debug my Kinetis application in daisy chain.

    I'm using a script with my own (empty) InitTarget() function. It looks like this:

    void InitTarget(void) {
    JLINK_SYS_Report("custom INIT for MKV46F256");
    }

    I don't know what the original Init function does, can I use this workaround whith any drawbacks?

    Regards

    Konrad
  • Hello Konrad,

    The connect sequence for Kinetis devices is rather "tricky" so the default behaviour in J-Link software is to assume that if JTAG is used the Kinetis device is first in the JTAG chain.
    This is obviously not the case in your setup.
    For the ST device these special handling is not needed so connect works with the settings you pick externally.
    What we can offer you is to provide you with the connect sequence so you can overwrite the default behaviour for your custom JTAG chain with the Kinetis device.
    For that I will PM you contact information.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    Alternatively our support ticketing system can be used as well: segger.com/ticket/