CTSU Integration Blocks Execution Before R_TOUCH_Open() – Stuck in CTSU Scan Loop

Hello Renesas Community,

I'm currently integrating the CTSU module into an existing project on the RA6M1 MCU. I followed the standard steps using QE Touch, and placed R_TOUCH_Open(&g_qe_touch_ctrl, &g_qe_touch_cfg); at the beginning of qe_touch_main() to ensure CTSU is initialized first.

However, after flashing the program, execution never reaches the if (FSP_SUCCESS == err) block or the timer initialization (R_AGT_Open). When I pause the debugger, the program is stuck in the following line inside the CTSU correction measurement function:

while (p_instance_ctrl->state != CTSU_STATE_SCANNED)

(Screenshot attached: green highlight in r_ctsu.c)(First Screenshot)

It seems that the system is getting stuck waiting for CTSU to complete scanning, but this scan never finishes, preventing the program from proceeding beyond initialization.

What I’ve Observed:

  • R_TOUCH_Open() is the first API being called.

  • System never reaches timer startup or even QE Touch ScanStart.

  • No visible error, just infinite wait on CTSU scan completion.

  • This only occurs after integrating CTSU into my full project. It works fine in standalone CTSU testing.

Suspected Causes (Need Guidance):

  • Is there any known condition where the CTSU never exits the scanning state?

  • Could a clock misconfiguration or pin conflict prevent the scan from completing?

  • Is this possibly due to timer or interrupt conflicts before R_TOUCH_Open()?

  • e² studio version: 2025-01 (25.1.0)

  • FSP version: 5.2.0

  • Device:   R7FA6M1AD3CFM
    Core:   CM4
    Toolchain:   GCC ARM Embedded
    Toolchain Version:   10.3.1.20210824

Please let me know if there are specific CTSU timing, ELC, or interrupt configurations I should double-check.

Thank you!

Parents Reply Children