I recently bought an EK-RA8M1 board. I was able to generate a project for it, compile, flash, debug, receive data via SEGGER RTT, etc. Everything was working absolutely perfectly.
However, all of this was done with the gcc compiler. A requirement that I have is to make it work with clang and so I was experimenting with it. Once I managed to generate an .ELF file using clang, I started a debugging session, flashing this binary, and it stopped in a breakpoint in address 0xdeadbeee (clearly there was something wrong with the generated binary, but OK, this happens during development).
The problem is, after I stopped this debugging session, I was no longer able to connect to the board ever since. J-Link gives me messages like this:
$ JLinkExe -if SWD -device R7FA8M1AH -speed auto
SEGGER J-Link Commander V7.96h (Compiled May 15 2024 15:50:52)
DLL version V7.96h, compiled May 15 2024 15:50:24
Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-RA4M2 compiled Apr 23 2024 10:48:30
Hardware version: V1.00
J-Link uptime (since boot): 0d 00h 00m 07s
S/N: 1083797446
USB speed mode: Full speed (12 MBit/s)
VTref=3.300V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Device "R7FA8M1AH" selected.
Connecting to target via SWD
ConfigTargetSettings() start
Configuring FlashDLNoRMWThreshold=0x200 in order to make sure that option bytes programming is done via read-modify-write
ConfigTargetSettings() end - Took 22us
InitTarget() start
Identifying target device...
SWD selected. Executing JTAG -> SWD switching sequence...
Initializing DAP...
Error: Failed to initialize DAP.
Attach to CPU failed. Trying connect under reset.
Identifying target device...
SWD selected. Executing JTAG -> SWD switching sequence...
Initializing DAP...
DAP initialized successfully.
Determining TrustZone configuration...
Error: Failed to configure AP.
Secure Debug: Enabled (SSD)
Determining currently configured transfer type by reading the AHB-AP CSW register.
Error: Failed to configure AP.
Transfer type does not match DLM state. Changing transfer type accordingly.
InitTarget() end - Took 254ms
Found SW-DP with ID 0x6BA02477
Failed to power up DAP
ConfigTargetSettings() start
Configuring FlashDLNoRMWThreshold=0x200 in order to make sure that option bytes programming is done via read-modify-write
ConfigTargetSettings() end - Took 19us
InitTarget() start
Identifying target device...
SWD selected. Executing JTAG -> SWD switching sequence...
Initializing DAP...
Error: Failed to initialize DAP.
Attach to CPU failed. Trying connect under reset.
Identifying target device...
SWD selected. Executing JTAG -> SWD switching sequence...
Initializing DAP...
DAP initialized successfully.
Determining TrustZone configuration...
Error: Failed to configure AP.
Secure Debug: Enabled (SSD)
Determining currently configured transfer type by reading the AHB-AP CSW register.
Error: Failed to configure AP.
Transfer type does not match DLM state. Changing transfer type accordingly.
InitTarget() end - Took 254ms
Found SW-DP with ID 0x6BA02477
Failed to power up DAP
Error occurred: Could not connect to the target device.
For troubleshooting steps visit: https://wiki.segger.com/J-Link_Troubleshooting
I have been working on it for hours, trying a lot of different things, to no effect:
- Unplug and plug the board again.
- Try to use JTAG instead of SWD in J-Link Commander.
- Inside the J-Link Commander, try to connect while the reset button is pressed down.
- I set J16 (the boot mode jumper), which originally was open (the default position when it comes from the factory), to closed, and replugged the J-Link USB cable. My understanding is that J16 should put it in USB/SCI bootloader mode, which in my STM32 boards was always enough to connect via SWD and erase any misbehaving code, reviving the board. However, I still get the same message as above from J-Link.
- With J16 set to closed (so in USB/SCI bootloader mode), I tried to connect to each of the USB connectors on the opposite side from the J-Link connectors (note I’m only using a single cable, so EITHER the J-Link is connected, OR the USB full speed, OR the USB high-speed. Never two or three of them at the same time). I do not see any new devices available in my computer.
So, as it currently stands, this board has become a paperweight. Although I have experience with STM32 devices, I am completely new to the Renesas world, so maybe I’m missing something obvious to those with Renesas experience (or maybe these new ARMv8.1-M MCUs with the TrustZone security features need some kind of special handling), but I am at my wits’ end right now. I simply do not have any other ideas of what I could do to revive the board.
Any suggestions for me?