cancel
Showing results for 
Search instead for 
Did you mean: 

AEK-MCU-C4MINI1 – cannot attach debugger over onboard USB (OpenOCD)

Amal_V
Associate II

Hello AutoDevKit Support Team,

I’m setting up an AEK-MCU-C4MINI1 board and I’m unable to get a working debug session through the board’s mini-USB (P2). I’ve read the user manual, followed the bring-up steps, and tried several configurations, but OpenOCD never manages to see the device over JTAG.

Summary

  • Expected: OpenOCD starts, identifies the SPC58 device, and GDB halts at main().
  • Actual: OpenOCD starts but repeatedly reports JTAG scan/IDCODE errors (“all ones”; IR capture 0x3F). GDB then disconnects.

Hardware

  • Board: AEK-MCU-C4MINI1 (power to J2 = 12 V, S1 ON; D10 LED on)
  • Connection: single mini-USB to P2 (no external probe connected to J3)
  • Windows Device Manager shows:
    • Ports (COM & LPT): AEK-MCU-C4MINI1 (Interface 1) (COMx)
    • USB devices: AEK-MCU-C4MINI1 (Interface 0)
  • USB IDs seen via Zadig: 0483:049A for both interfaces

Host / Tools

  • Windows 11 x64
  • AutoDevKit Studio 2.6.1
  • OpenOCD bundled with AutoDevKit: 0.12.0+dev-00318-g0e98d766e
  • GDB: ppc-freevle-eabi-gdb.exe (AutoDevKit toolchain)

Project

  • New SPC5 project (RLA bareboard / empty app for SPC58ECxx), minimal main.c that loops; builds fine to build/out.elf.

Current debug config (OpenOCD)

  • Config options used most recently:

-s "C:\AutoDevKitStudio-2.6.1\openocd\scripts" -f board\spc58xc_dis.cfg -c "transport select jtag" -c "adapter speed 50" -c "reset_config srst_only srst_nogate connect_assert_srst"

 

Representative logs

Open On-Chip Debugger 0.12.0+dev-00318-g0e98d766eadapter srst pulse_width: 100adapter speed: 50 kHzInfo : Listening on port 3333 for gdb connectionsError: JTAG scan chain interrogation failed: all onesError: spc58xc.tap: IR capture error; saw 0x3f not 0x01Error: no IDCODE present on deviceWarn : target spc58xc.cpu examination failed...Error: Connect failed ... 'gdb' connection rejected

 

What I’ve already tried

  • Power-cycle, different USB ports and data-rated cable; ensured no terminal has COM open.

  • Held RESET during attach; used very low adapter speeds (4000 → 250 → 100 → 50 kHz).

  • Tested both spc58xc_dis.cfg and spc58ec.cfg.

  • Driver mapping via Zadig:

    • Interface 0WinUSB (Microsoft) (also tried libusbK)

    • Interface 1USB Serial (CDC) (shows up as COMx)

  • Confirmed only the P2 USB is used (nothing on J3).

  • Attempted UDE briefly, but I don’t have a PLS UAD probe, so I returned to OpenOCD.

Questions / Requests

  1. Official, board-specific debug recipe for AEK-MCU-C4MINI1 using the onboard USB:

    • Exact driver mapping per interface (which driver for Interface 0 and Interface 1, and expected USB VID:PID values).

    • The correct OpenOCD .cfg file for this board (board vs. target), and any required reset_config / JTAG options.

    • Any jumpers/straps or special sequence needed to enable JTAG/OnCE on this board (beyond S1 and RESET).

  2. A known-good sample project + debug configuration (or a screenshot of the Debug Configuration “Debugger” tab) that you recommend.

  3. Please confirm whether UDE is required for this board, or if the onboard USB path with OpenOCD is the supported method.

  4. If possible, please assign an expert or provide a step-by-step guide (driver install, expected Device Manager entries, OpenOCD line, and how to verify the chain/IDCODE).

    I’m happy to provide additional logs or run any diagnostic commands you suggest. I’ve read the user manual but I’m still blocked at the debug-attach step.

    Thank you for your help—please let me know the correct setup and any board-specific requirements, or schedule a short session with an expert to get this unblocked.



13 REPLIES 13
SRomeo
ST Employee

Hi Amal,

I think you have made some mistakes during openOCD driver installation.
Let me share a step-by-step installation guide so this procedure gets clearer.

This guide will also explain how to create a debug configuration from an existing project. (which is mandatory in order to program your MCU board)

After completing the installation, please make sure that the jumpers of your AEK-MCU-C4MINI are configured as follows:

SRomeo_0-1763373081650.png

 

Best regards,
Simone
AEK_Team

 

Hello SRomeo,
Thanks for the reply, it helped a lot in the installing of drivers.

In device manager i can see one as USB JTAG adapter, which was not available before.(pic uploaded)

I followed all the steps and still i am not able to debug or flash the code to the Mcu.

i have given a 12 v to mcu and connected via usb mini b with my laptop.( these are the hardware setup)

 

i am using the sample project from the auto dev kit studio- AEK-MCU-C4MINI- AEK_POW_BMSCCTX_2_nodes_chin_GUI_application for discovery.

I have connected 8 cells in series with the BMSCCTX with C0 to C8 and gnd. But my code is not writing in the mcu.

 

I will attach some pics for your understanding and hope you would provide me with a valid answer.

SRomeo
ST Employee

If you follow every page of the guide you should be able to flash.

I think you are still missing the "Create a new configuration to debug
your custom application from scratch" section (slide 13)

Please follow also the rest of the slides and retry.
Best Regards
Simone 


daynialkhan
Associate II

daynialkhan_0-1763553781898.png

daynialkhan_1-1763553804059.png

i have issue with run and debugging i have also updated the debug configurations! still i am getting error 

Open On-Chip Debugger 0.12.0+dev-00318-g0e98d766e (2023-05-17-15:52)
Licensed under GNU GPL v2
For bug reports, read
adapter srst pulse_width: 100
Started by GNU MCU Eclipse
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: failed to reset FTDI device: LIBUSB_ERROR_PIPE
Error: unable to open ftdi device with description '*', serial '*' at bus location '*'
 
Assertion failed: jtag_trst == 0, file src/jtag/core.c, line 344

what can be the possible error



SRomeo
ST Employee

From the screen I see that your "config option" of the debugger tab is different with respect to the one in the documentation.

SRomeo_0-1763559989373.png


You should have just:
-s C:\AutoDevKitStudio-2.6.1\openocd\scripts -f board\spc58ec_dis.cfg

Make sure all the steps described on the guide I shared are followed @daynialkhan
Moreover, we cannot assure "Zadig" is installing the correct drivers.


I suggest the manual procedure,
Thanks

daynialkhan
Associate II

I have followed AEK-MCU-SPC5LNK_QSG_reduced.pdf step by step! but screenshot can be seen that i have only 2 ports! plus i have got same error board is already powered on 
please help!!

daynialkhan_0-1763616684009.png

daynialkhan_1-1763618252151.png

daynialkhan_2-1763618277740.png

daynialkhan_3-1763618346994.jpeg

 

 

Try converting your interface 1 to Usb serial Port. 
I was able to pass this phase

 

SRomeo
ST Employee

Take a look also to MAIN, STARTUP and SVD path tabs.

I'll share an example for reference:

-Project pointing the correct "project explorer" file (the demo needs to be in the workspace, already compiled)
-C/C++ application pointing to the .elf file of your demo  (into C//autodevkit_X/workspace_X/yourdemoname/build/out.elf)

MAIN tab:

SRomeo_1-1763628064904.png


Startup tab:

SRomeo_0-1763628049654.png

SVD tab (pointing to the SVD file corresponding to your micro)

SRomeo_2-1763628139756.png


Then:
1) connect the USB port
2) Switch on the 4MINI

3) Click on debug->debug configuration (using the discussed configuration and with the project already compiled)
4) Your project is flashad

If this doesn't work either then your board/USB port is somehow broken.
Change machine and retry

Best regards,
Simone
AEK_Team



Amal_V
Associate II

can you provide a step-by-step OpenOCD + board setup guide.