Debugger disconnects with exception

When trying to debug an application running on an RX64M (R5F564MFCDFB), the debugger always disconnects after a short while with the following message:

warning: Remote failure reply: E31
Remote communication error. Target disconnected.: No error.
Exception condition detected on fd 552

The debugger can connect to the device, program it, and I can single-step, set breakpoints and so on, but after a short while (less than a second when running without breakpoints) it always disconnects. Any ideas or hints on what's going on?

E2 Studio 4.02.008 on Windows 7, using an E1 with firmware version (the same thing happens with an E20 emulator). The emulator is connected via JTAG, and changing the JTAG clock has no effect.