RFP doesn't work correctly in serial mode with EK-RA4M3

Hi all,

I've played a little with RFP v3.14 with my eval board EK-RA4M3. 

I wanted to check some communication over UART (by using J-Link on eval board). 

With baudrate 9600 everything is fine, I can read memory option bytes etc., but when I change to 115200 I cannot do anything and some error occurs:

I've checked communication with logic analyzer and I didn't find anything special, setting baudrate with command 0x34 looks exactly the same for 9600 like for 115200. With 9600 after ~118ms programmer continues communication, with 115200 there is no communication after 0x34 command. 

I've tried with different USB cables, different Windows (11 and 10 checked), I also upgraded J-link firmware to the newest one (from 12.2023).

I don't know what else I could check.

Also I don't know why only 9600 and 115200 speeds are supported if AN R01AN5372EU0110 (System Specifications for Standard Boot Firmware) indicates that we can set up to 2Mbit (Table 24).

If you have any idea what could be wrong or how I can fix it or show more, please let me know.

Thanks in advance,

Adam

  • Hello sir,

    Please  let me  inform you that if you select to use the J-Link OB-S124 debugger available on the EK board and select the 2-wire UART interface the only options for the speeds that can be selected is 9600bps or 115200 bps.

    If you will check some information provided for users for RFP here you will see that:

    https://www.renesas.com/us/en/software-tool/renesas-flash-programmer-programming-gui-support

     

    "However the actual maximum communication speed that will work will depend on the J-Link model being used."

    Generally the J-Link-OB-S124 is meant to do basic debugging on the connected target. It is not suited for manufacturing.

    The S124 only has a 32-MHz Cortex M0+ core, so the maximum target interface speed for J-Link-OB-S124 seems to be limited.

    If you want to create custom boards with RA4M3 for production, E2 Lite emulator would be a much better option to use .

    https://www.renesas.com/us/en/software-tool/e2-emulator-lite-rte0t0002lkce00000r#overview

    Since for UART communications it can reach speeds bigger than 115200 bps. As you can see from the screenshot below:

    As you can see I was able to flash my board with E2 lite at 1,500,000 bps.

    Now if you want to achieve bigger speeds by using the J-Link OB-S14, please select instead of 2-wire-UART, the SWD interface.

    Since with SWD interface you can achieve speeds up to 25MHz.

    Hope it helps.

    Best Regards,

    IK

  • Hello Adam,

    After checking your issue internally, your issue is caused due to the fact that you are using the J-Link OB-S124 debug interface. And the J-Link- OB- S124 cannot work properly and keep up with 115200 bps.

    You could either use a USB to UART adapter and select COM port and 2-wire UART interface in RFP  by making the connections according to app note mentioned here:

    https://www.renesas.com/us/en/document/mat/pg-fp6-renesas-flash-programmer-additional-document-users-manual-recommended-circuits-connecting?r=488871

    Check TYPE C connections for COM port.

    Or either you can connect your USB cable to USB Full Speed Port available.

    Make sure that you have  closed jumper J16 to drive the MD pin to low to enter the boot mode and also close jumper J15 to provide power to the MCU from the USB port and set jumper 12 to pins 2-3.

    Reset once your board by pressing the reset button and go to device manager and you will see the COM port get recognized as:

    And then in RFP connect with these settings:

    And then you will be able to communicate through USB at 115200 bps via RFP.

    I have tested this with EK-RA4M2 but Boot Firmware through USBFS is also supported on RA4M3.

    Best Regards,

    IK

  • Hi IK, 

    first of all - thanks for response! I was afraid that this post will be lost on the forum ;)

    Then let's split two (or even three) different things:

    1. Limitation on J-link on eval board

    2. Issue with using 115200 baudrate

    3. SWD speed

    1. This is clear now, thanks for that :) I knew that there are "some" versions of J-link (like, base, pro etc.) but i didn't know about that. This is clear, probably when I will use some "standalone"J-link, then I will have more options.

    2. Here I have issue with using supported by eval's j-link baudrate 115200, after chosing it I have no communication with MCU, but MCU responds.

    Here is sniffed communication on pins P109+P110 with J-link using serial communication, baudrate 9600:

     

    - Bytes 0x00 0x00 0x25 0x80 from j-link is baudrate 9600

    After getting response there is ~ 117ms break and communication continues:

    And here everything is fine, according to protocol specification etc.

    The problem raises when I try to use 115200 baudrate, then communication looks like following:

    - bytes 0x00 0x01 0xC2 0x00 indicates 115200 baudrate.

    After that command I have complete silence on TX/RX lines and after few seconds error showed in first post. 

    So even if built-in j-link supports only 9600 and 115200, only 9600 works correctly, the other one don't want to work.

    3. About SWD, here I also sniffed communication on SWDCLK and SWDIO lines (pins P108 + P300) and changing SWD speed...doesn't work :) I mean it doesn't change anything:

    EDIT: I saw your update, thanks for that :)

    Anyway if J-Link- OB- S124 cannot keep up 115200, maybe RFP shouldn't show it as support communication speed?

    Of course I will test external serial converter and check what I can "squeeze" from that and also some standalone jlink to check if programming with 25MHz is possible.

    Best regards,

    Adam

  • Hello Adam,

    Regarding using the SWD interface as I suggested to you in my first response , please also check the response provided by Jeremy, where you can find the list with the functions that cannot be supported through RFP and SWD interface for RA4M3.

    So maybe using SWD would not be the best option.

    A more straightforward solution would be to use the USBFS port as described in my previous response, since no  external connections are required on the EK.

    Also don't forget to disable the J-Link-OB-S124 by closing jumper J9.

    Best Regards,

    IK

  • Hi again,

    I've make connection with simple external serial converter (with setting all jumpers as you suggested) - I was able to reach 1Mbit communication :) WIth some better converter I will also check real limit here. Thank you very much!

    About SWD - I've checked Jeremy response but it just about limitation on protocol/commands level (cannot set IDAU regions etc.) but in my case the issue is that regardless of chosen SWD speed, it always run on ~1.7MHz. I've checked external SWD programmer and it correctly changes SWD communication speed - probably issue sits in firmware in built-in jlink.

  • The JLink-OB S124 is limited in the SWD speed it can achieve, I think it is 4MHz. You would need an external JLink model to run at a faster SWD speed.

  • Hi again,

    I was able to reach satisfied communication speed with external programmer for SWD and nice speed with external converter. 

    I think it would be good to limit number of possible settings for JLink-OBI S124 in new RFP in advance, to not confuse users.

    We can close the topic, thanks again for your suggestions Slight smile

    Adam

  • Hello Adam,

    Thanks for your feedback and your suggestions.

    Best Regards,

    IK