I managed to program my FPB-R9A02G021 board exactly once when I got it out of the box - so I know the J-Link OB is working and the J-Link tools are working, and the USB cable is working. However, now when I try to connect with JFlash, I get an error (see [Log 1 below]). I saw there was another thread reporting the same error message, but there was no solution.
If I move J8 to Closed and power up the board, then tap Reset, which in theory will stop any of my code executing, connecting with J-Flash produces [Log 2] below.
I tried soldering jumpers to J5 and J6 (which came as bare plated through holes) and selecting the 2-3 position, but that didn't affect J-Flash (I wondered if maybe having the UART pins floating made it stop working).
I installed the Renesas Flash Programmer hoping that maybe UART Boot mode was working and I could use that to program the chip (J5 and J6 on 2-3, J8 closed). Noting the line in the manual that says it will not enter the UART Boot mode on Power-On Reset and only on Reset, I pressed Reset and tried the Renesas Flash Programmer. It asked me for an Authentication Code, offering all-FFs as a default. Accepting the default, or selecting "Auto Authentication" produces [Log 3].
The only sign of life is if I:
However, even in this state, JFlash does not work.
Is my board really dead? What else can I try? Can I RMA it?
[Log 1]:
Application log started - J-Flash V8.12 (J-Flash compiled Dec 18 2024 15:28:23) - JLinkARM.dll V8.12 (DLL compiled Dec 18 2024 15:27:57)Reading flash device list [C:\Program Files\SEGGER\JLink_V812\ETC/JFlash/Flash.csv] ... - List of flash devices read successfully (451 Devices)Reading MCU device list ... - List of MCU devices read successfully (11667 Devices)Creating new project ... - New project created successfullyConnecting ... - Connecting via USB to probe/ programmer device 0 - Probe/ Programmer firmware: J-Link OB-RA4M2 compiled Oct 9 2024 11:01:47 - Probe/ Programmer S/N: 1085508066 - Device "R9A02G021" selected. - Target interface speed: 4000 kHz (Fixed) - VTarget = 3.300V - ConfigTargetSettings() start - ConfigTargetSettings() end - Took 16us - TotalIRLen = 5, IRPrint = 0x05 - JTAG chain detection found 1 devices: - #0 Id: 0x00000001, IRLen: 05, Unknown device - Assuming RISC-V TAP with DTM setup - Debug architecture: - RISC-V debug: 0.13 - AddrBits: 14 - DataBits: 32 - IdleClks: 4 - Memory access: - Via system bus: No - Via ProgBuf: No (0 ProgBuf entries) - Via abstract command (AAM): May be tried as last resort - DataBuf: 0 entries - autoexec[0] implemented: No - Failed to temporarily halt core during identification - Attaching to core failed. Trying again with connect under reset (ndmreset-bit) - Memory access: - Detected: RV32 core - Temp. halting CPU for for feature detection... - CPU could not be halted - Connect failed. Resetting via Reset pin and trying again. - ConfigTargetSettings() start - ConfigTargetSettings() end - Took 10us - TotalIRLen = 5, IRPrint = 0x05 - JTAG chain detection found 1 devices: - #0 Id: 0x00000001, IRLen: 05, Unknown device - ERROR: Timeout while waiting for core to halt after reset and halt requestSpecific core setup failed. - CPU could not be halted - OnDisconnectTarget() start - OnDisconnectTarget() end - Took 18us - ERROR: Failed to connect.Could not establish a connection to target. - ERROR: Connect failed
[Log 2]:
Connecting ... - Connecting via USB to probe/ programmer device 0 - Probe/ Programmer firmware: J-Link OB-RA4M2 compiled Oct 9 2024 11:01:47 - Probe/ Programmer S/N: 1085508066 - Device "R9A02G021" selected. - Target interface speed: 4000 kHz (Fixed) - VTarget = 3.300V - ConfigTargetSettings() start - ConfigTargetSettings() end - Took 7us - Could not measure total IR len. TDO is constant high. - Failed to identify target. Resetting via Reset pin and trying again. - ConfigTargetSettings() start - ConfigTargetSettings() end - Took 6us - TotalIRLen = ?, IRPrint = 0x..000000000000000000000000 - Executing init sequence ... - ERROR: Could not perform target reset - ERROR: Failed to connect.Could not perform custom init sequence. - ERROR: Connect failed
[Log 3]:
Connecting the toolTool : COM port (COM5), Interface : 2 wire UARTConnecting to the target deviceSetting the target deviceDisconnecting the toolError(E100000C): A serial programming connection is prohibited for this device. (Command: 30, Response: DC)Operation failed.
Hello,
The reason of this error is seems to be that the ID authentication command fails.
theJPster said:Error(E100000C): A serial programming connection is prohibited for this device. (Command: 30, Response: DC)
Command 30 is the authentication command and the response is serial programming disable error:
www.renesas.com/.../standard-boot-firmware-r9a02g021-risc-v-mcus
This error is caused because bit 127 of the OCD/Serial Programmer ID Setting Register is 0.
When this is the case the debug and serial programming interface is disabled:
Ok, but how did this happen? And can my board be recovered or is it now scrap, after 30 seconds of use?
All I did was compile an LED blinky program that wrote to two registers, and then flashed it with JFlash Lite. Oh, and I upgraded the J-Link OB firmware because the SEGGER J-Link software said I had to.
I can provide the binary if it helps.
I had seen a similar issue in the past with a device programmed by J-Link tools. It is possible that J-Link miss-handles the ID code of R9A02G021, I will need to further check this with the product team.
Hi!
This seems to be a problem with the Segger tools and this board. I have found at least two instances of people "bricking" their boards using j-link.
I don't have a board to test out this idea - I'm still in the mode of "curiosity" about this board and chip (I'm a big RISC-V fan and I have been eagerly awaiting a mainstream RISC-V microcontroller) - but there is a possible way to erase the flash on the chip, even in the state that it's in.
If you look at section 35.5.1 in the hardware manual, table 35.14, there is a documented "escape valve": using ASCII "ALeRASE" (0x414C_6552_4153_45FF_FFFF_FFFF_FFFF_FFFF) as the ID CODE when connecting the debugger or using the UART bootloader. As long as the FAPR bit has not been programmed to 0 this should do a full chip erase.
Does that make sense? Do you have a way to try this?
I believe I tried that and it didn’t work.
My RMA was refused so I uninstalled all the tools and threw the board into e-waste.
I have two of these boards that exhibited similar behavior, sa,e error messages. I have a third board but I am afraid that hooking it up to my computer will brick that one too!
Maybe the best thing to do is to never allow the installed jlink software to update.
I have three of these boards.
Two I ordered a long time ago, both say "Made in Japan" on the box and have the date 2024/01/22 on them. Both these boards have failed.
I later ordered another board. It says "Made in China" and has a date of 2024/04/25 on it. This board works! I have been able to update its JLink software and have been able to program it using the JLinkGDBServer with gdb.
If you can order and get the newer chinese board you might have similar success.