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 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.