I was working on a bootloader for the RA6M2. While working on writing to program flash, I did not realize that once you enter flash programming mode, the flash becomes unreadable. And my bootloader WAS in flash and as a result, I had many cases where random code was executed on the processor. So right now I have figured out that the boot loader must copy itself to SRAM before programing the program flash. But now, when I try to connect to the RA6M2 with the E2 emulator, I am getting an error code
And here is the contents of the console:
GDB Server for Renesas targets.
Version 8.9.0.v20220622-094354 [a337bc4f] (Jul 4 2022 11:34:02)
Starting server with the following options:
Raw options : /home/ta/.eclipse/com.renesas.platform_917604430/DebugComp//RA/e2-server-gdb -g E2 -t R7FA6M2AF -uConnectionTimeout= 30 -uClockSrc= 0 -uAllowClockSourceInternal= 1 -uInteface= JTAG -uIfSpeed= auto -w 0 -z 33 -uIdCodeBytes= FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -uResetCon= 1 -uLowPower= 1 -uresetOnReload= 1 -n 0 -uFlashBp= 1 -ueraseRomOnDownload= 0 -ueraseDataRomOnDownload= 0 -uTraceMTB= 0 -uTraceSizeMTB= 1024 -uProgReWriteIRom= 0 -uProgReWriteDFlash= 0 -uOSRestriction= 0 -uTimeMeasurementEnable= 1 -uMemRegion= 0x00000000:0x100000:FLASH:e -uMemRegion= 0x40100000:0x8000:DATA_FLASH:e -l -uCore= SINGLE_CORE|enabled|1|main -uSyncMode= async -uFirstGDB= main --english
Connecting to E2, ARM target
GDBServer endian : little
Target power from emulator : Off
Starting target connection
GDB action 'connect to target', has failed with error report, Error 0x0F000003: Command code received from the emulator firmware was unexpected.
Disconnected from the Target Debugger.
I have first speculated that this might be because random data was written to the option settings area, so I tried to use the ALeRASE ID code to completely erase all program, data, and option flash, but this did not help.
I tried this with both the e2studio and the windows flash programmer. With windows flash programmer I'm getting a timeout error.
I have then disabled loading the image and symbols during connection. And then the emulator connected. But while I can examine the program flash memory and it seems to contain at least some valid data (the vectors etc are valid and the first few blcoks seems to contain sensible code), when I look at the SRAM, I am only seeing a fixed pattern and I cannot change the SRAM contents.
Below is the fixed pattern that I'm seeing. So my question is, because of all the random code execution, something happened to this chip. Can it somehow be recovered? (some kind of low level reset or erase)
Because I can examine the program flash area, I checked the option settings area and it contains all FFFFFFFF, so it appears that I haven't locked myself out of the chip. So what could be the problem? Any help greatly appreciated!
Hi, do you have memory dump 0x00000400~43F? Also AWS 0100A164 ..
Here are the memory dumps
Here is what happens when I hardware reset the RA6M2 with a hardware breakpoint at the entry point: It breaks, and I can single step a few instructions. But once it tries a subroutine call, the program crashes with a 0xFFFFFFFE exception. I suppose it fails to write to SRAM. And I can confirm that, I cannot use the Memory view to edit the SRAM.
You have 0301 @ 0x0438. This means Security MPU region 1,2,3 are enabled..
The rest of security MPU registers have garbage data. Most likely your SRAM, flash register area are rendered in-accessible from debugger/other bus master. I dont think you can recover from this. You have to replace this chip.