Hi there,
I am using the Renesas R5F52315ADFP MCU in E2 studio on a custom PCB and am trying to configure the device as a peripheral communication device class (PCDC) to communicate over USB with a PC. I have been using the sample code outlined in R01AN2296EJ0120 and have been trying to have the device recognized by the Windows PC (running Windows 11). The device is discovered however does not communicate. I believe this is due to having the incorrect driver for the device. I have used the sample .inf file provided to install the custom .inf file. Is there a sample driver available?Cheers,Ed Bayliss
Hello Edward,
Have you followed the application note below:
https://www.renesas.com/en/document/apn/rx-family-sample-program-using-usb-peripheral-communication-device-class-driver-pcdc-usb-mini
and downloading the sample project from below:
https://www.renesas.com/en/document/scd/rx-family-sample-program-using-usb-peripheral-communication-device-class-driver-pcdc-usb-mini?language=en
and you observed the behavior that you described?
About the drivers, on the Program Files on your system, you should be able to find a Renesas Electronics Folder that includes a folder called MCU tools drivers, that include all the necessary files. Can you check that you can see this folder on your Windows system?
If the issue cannot be solved, you can attach your project here to check it in detail.
Regards,
AL_Renesas
RX231.zip
Hi AL_Renesas,I have the MCU tools drivers in the Renesas Electronics Folder and have been using the sample program as described in the application note. The only modification I have made to the sample code is changing the board from the R5F52318 to the R5F52315 as the program crashes with an interrupt error otherwise. When connecting to the computer, the program receives a Suspend, Resume, and then another Suspend event. The program does not seem to receive or respond to an enumeration request. Windows shows a Device Descriptor Request Failed status on connected USB device.I have attached the code below RX231.zipCheers,Ed Bayliss
The project seems ok.
Can you use Wireshark- USBPcap free tool to debug the project, when you try to communicate between PC and RX231?
Also, during enumerarion, the following steps should be done:
USBcap extension tool on Wireshark is a very good debugging usb option, on different case can you set breakpoints on the main process on USB_STS_REQUEST case and see if your project enter on this case and simultaneously read the value of ctrl.event?
Also, you mentioned that the program crashes with an interrupt error. Can you please give more details about it ?
Hi AL_Renesas,I have used the Wireshark debugging tool and it appears that no usb data is being transmitted over the USB bus to the embedded system. Wireshark captures the data of other usb devices. However, I have confirmed that no data is transmitted to the embedded system by removing all usb devices, connecting the embedded system and observing no data captchured using Wireshark. The embedded system does not receive a STS_REQUEST event. The embedded system receives a STS_SUSPEND event, then a STS_RESUME event, and finally another STS_SUSPEND event. After this, no more events are generated/received. On the usb lines (D+, D-), I have confirmed a reset signal on initial connection but cannot confirm if differential signalling occurs.
The interrupt error only occurs when programming the R5F52315ADFP as the default R5F52318ADFP MCU. The error is the Undefined instruction exception ISR 'R_BSP_ATTRIB_INTERRUPT void excep_undefined_inst_isr(void)'Can you confirm that this project works on Windows 11? Have you used the default USB drivers to connect from Windows to an RX231 MCU? If not, which drivers have you used and how have you installed them? I can install the Renesas MCU Tools driver's .inf file but cannot specify this .inf file as the embedded systems device driver (error message: 'The folder you specified doesn't contain a compatible software driver for your device. If the folder contains a driver, make sure it is designed to work with x64-based systems.)
Cheers,
Edward Bayliss
About Windows 11, a known issue tha may affect RX drivers is if the memory integrity feature on core insulation is activated (I think that it is activated by default on Windows 11):
About the undefined exception, you should resolve it, on different case the functionality of the project cannot be guaranteed.
Can you please check the value of the Program Counter (PC) and where the program stucks, when this exception occurs?
Hi Al_Renesas,I have checked the memory integrity feature and it has been off.
I have since resolved the undefined exception error. I was setting the debug configuration as R5F52315 while the board definition within the project was set to R5F52318. The exception would occur on the first instruction 'R_BSP_POR_FUNCTION(R_BSP_STARTUP_FUNCTION)'. By setting the debug config as R5F52318 the fresh download program runs as before.My destination MCU is still the R5F52315, however as far as I know, the R5F52318 and the R5F52315 are equivalent MCUs except for RAM and Flash size. The memory of the build does not overflow the R5F52315 specs.By programming the R5F52315 as a R5F52318, the fresh downloaded program runs. However, the functionality of the program is the same as before with event sequence STS_SUSPEND, STS_RESUME, and finally STS_SUSPEND.
My board has a connection to VBUS at pin 55 instead of pin 16.
I have attached the error message I get when I connect the embedded system to the PC as well as the steps I take to change the installed driver which does not complete successfully.
If the issue still remains, can you please attach your schematic to check the usb connections?
Also, have you modified anything on the device descriptor?
Regards
Hi AL_Renesas,
Can I please private message you with the schematic details?
For the device descriptor, I have tried a version where I modified the vendor ID and USB product ID. I have also tried a version where I left those two fields unchanged. I have left the rest of the device descriptor field unmodified.
Cheers