I am new to Renesas products. I have got a Compact Emulator M3062PT3-CPE with M3062PT-EPBM MCU board as my hardware setup. I am running HEW 4.09.00.007 using Renesas M16C Toolchain V6.0 and M16C R8C Compact Emulator Debuuger V1.03 Release 00.
I am able to CONNECT to the emulator and start running my project. However, on hitting a HALT button, it starts showing "Can't send data (16013)" error. The "self check" option when clicked on the emulator init dialog, it shows "target is used already (16015)".
The self check test when run from the emulator (After pressing the reset button twice as described in the manual), shows Power LEDs and Reset and SAFE LEDs ON. This condition is described in the manual as "Emulator may be damaged". But if the emulator is damaged, HEW is still connecting to the emulator, so I rule out this possibility.
Can anyone please give some clue how to debug this problem?
Thanks in advance to all.
The compact emulator has on the upper board an M32C processor doing the USB communication to the PC and controlling the M16C emulation processors on the lower board.
It is possible that the lower board is damaged and the upper one still works fine. Then the PC will recognise the emulator correctly, but you are not able to run your software.
Do you use your compact emulator connected to your target, or do use it stand alone only connected to your PC? For testing purpose it should be operated stand alone.
Did you check if the emulation memory is programmed correctly after you download your software?
To do so you can either open the memory window and check the contents of the program memory, or you push and then switch the source window to mixed view. In both cases you should be able to see the programmed flash and may be you can tell if the memory has been programmed correctly.
If it is programmed correctly, did you try to do a single step after pushing reset?
What is the setting for MCU power (on the comnpact emulator) and MCU clock (in the Init dialog)?
frankL, Thanks for reply.
Now it is always showing error 16015 (Target is already used), even in the standalone mode. Also, in the standalone mode the Power LED of the target status LEDs is OFF, while RESET LED is ON. The power and safe LED in the emulator status are ON.
Also, if I press reset switch now, the Reset LED turns OFF and Clock LED is turned ON.
At this moment, I am not able to even connect.
Earlier, when I was able to connect to the emulator, I tried single stepping, but it was showing the "Can't send data (16013)" error.
Power setting is: INT and 5V. Clock settings: Main-Internal, Sub-External.
I have the OSC3 board attached to the emulator.
Ok, after restarting my PC, the 16015 error is gone now. It is now back to the earlier state, where the program runs when a module is downloaded. But any further operation is responded with error 16013 (Can't send data).
Now when I am looking in the'mixed view', I am seeing only the source i.e. my C code, but there is nothing seen in the disassembly columns. This looks something wrong I guess.
You should see the assembler code in mixed view. But if you don't even see addresses in the address column there is something wrong. Usually you have a file opened that does not belong to the actual project. I usually do the following:
- Close all source windows.
- Download the application code again.
- Push RESET button.
After pushing the RESET button HEW should open the source window for the start-up code. There should also be addresses and switching to mixed view should work.
I created another simple project of type "Application" from the project wizard. it created a main() function and I just put a couple of dummy lines code there. It works fine. I am able to debug source level, put breakpoints, view disassembly code etc. So there seems a problem with the other project which I was trying to debug. At least my emulator is working well.
Good to hear.
If you still need to debug the old application have a look at the memory map, especially at the value loaded to ISP after RESET.
Yes, I do need to debug the old application.
ISP remains at 0x0500h. PC is modified to 0x0F5C04h. I had closed all files in the editor window and downloaded the module. A disassembly window shows some code but there is no source code associated with that.
Looks like I am making some mistake in building the code. I will do some more investigation.
Finally, got it working.
The problem was in hardware. I had tapped the 5V supply from my hardware and given it to the emulator. While single stepping or running through the code, the power was dropping at some point to below 4V or so. This was causing the emulator to RESET and thus loose connection with the PC. Thats why HEW was showing "Can't communicate".