Need help with e2studio debug configuration on RZ/A1H board

This may be an e2studio question - but I didn't see how to cross-post into two forums...

I'm adapting the RGA Sample app for RZ to my custom hardware (using e2studio).  At first, I had trouble getting e2studio to download my code into flash(*), but then I managed to tweak the debug configuration to enable the "Use CFI-Flash" option.  All worked well for day or so.

Then, "something" happened.  Now, when I launch the debug session, it no longer attempts to download my code into flash (or at least I see no pop-up window).  Instead, it seems to launch a "normal" debug session - but I can't seem to even run that way.

Can someone point me to instructions on how to build a debug configuration that might work?  I've tried tweaking every option I can think of, but nothing seems to help.

Thanks.

 

(*) Our board uses 16-bit NOR Flash on CS0, if that matters. (S29GL064S70TFI020)

  • In reply to jdseymour:

    The icon of "J-Link Control Panel" is shown to a system tray of Windows while J-link and a target board connect.
    When a connection of J-Link and a target board cuts by some errors, the icon becomes hidden.
    I think that's the reason that you can't find an icon.

    By the way I think an error might occur before trying writing in to a flash from log.

    Please input the next command list which has no relation to flash operation.
    Could you confirm whether any errors occur with that?

    si JTAG
    speed 12000
    Device R7S721001
    rx 100
    mem 0x20000000, 0x1000
  • Have you tried the same thing with the earlier Segger J-link version. If it works on the earlier version do the following to the atest e2studio.
    copy the JlinkARM.dll for the earlier Segger J-link version
    i.e.
    C:\Program Files (x86)\SEGGER\JLink_V492\JLinkARM.dll
    copy it to this folder. The folder C:\Renesas\e2studio54 will vary depending on the where you in installed the latest e2studio.
    C:\Renesas\e2_studio54\DebugComp\ARM\Segger

    NOTE: make a backup of the dll in the e2studio before over writing it.
  • In reply to jdseymour:

    Have you tried the same thing with the earlier Segger J-link version. If it works on the earlier version do the following to the atest e2studio.
    copy the JlinkARM.dll for the earlier Segger J-link version
    i.e.
    C:\Program Files (x86)\SEGGER\JLink_V492\JLinkARM.dll
    copy it to this folder. The folder C:\Renesas\e2studio54 will vary depending on the where you in installed the latest e2studio.
    C:\Renesas\e2_studio54\DebugComp\ARM\Segger

    NOTE: make a backup of the dll in the e2studio before over writing it.
  • In reply to michael kosinski:

    I installed 616j after I discovered this problem - so I think it failed with the older version (510g), as well. But I'll do some experiments later today to make sure. (I also have 502i and 490e installed)
  • In reply to hodl layee:

    OK.  I found another clue!  In response to hodl layee's post, I found the J-Link Control panel.  On the "Log" tab, I see the following:

    JLinkLog.txt
    SEGGER J-Link V6.16j DLL Log
    DLL Compiled: Jul 24 2017 18:42:23
    Logging started @ 2017-08-10 14:30
    
    
    T1CD0 000:787 JLINK_Reset() -- Type: 0
    T1CD0 000:961 JLINK_Halt()
    T2368 001:855 JLINK_ReadMem (0xFFFFFFFF, 0x0001 Bytes, ...) - Data: DF
    T2368 002:136 JLINK_WriteMemEx(0xFCFE341C, 0x0002 Bytes, ..., Flags = 2) - Data: 41 FF
    T2368 002:150 JLINK_WriteMemEx(0xFCFE3A1C, 0x0002 Bytes, ..., Flags = 2) - Data: 00 00
    T2368 002:156 JLINK_WriteMemEx(0xFCFE361C, 0x0002 Bytes, ..., Flags = 2) - Data: 00 00
    T2368 002:162 JLINK_WriteMemEx(0xFCFE351C, 0x0002 Bytes, ..., Flags = 2) - Data: 00 00
    T2368 002:166 JLINK_WriteMemEx(0xFCFE721C, 0x0002 Bytes, ..., Flags = 2) - Data: 41 FF
    T2368 002:171 JLINK_WriteMemEx(0xFCFE3420, 0x0002 Bytes, ..., Flags = 2) - Data: FF FF
    T2368 002:176 JLINK_WriteMemEx(0xFCFE3A20, 0x0002 Bytes, ..., Flags = 2) - Data: 00 00
    T2368 002:180 JLINK_WriteMemEx(0xFCFE3620, 0x0002 Bytes, ..., Flags = 2) - Data: 00 00
    T2368 002:186 JLINK_WriteMemEx(0xFCFE3520, 0x0002 Bytes, ..., Flags = 2) - Data: 00 00
    T2368 002:192 JLINK_WriteMemEx(0xFCFE7220, 0x0002 Bytes, ..., Flags = 2) - Data: FF FF
    T2368 002:199 JLINK_WriteMemEx(0xFCFE3424, 0x0002 Bytes, ..., Flags = 2) - Data: 03 00
    T2368 002:204 JLINK_WriteMemEx(0xFCFE3A24, 0x0002 Bytes, ..., Flags = 2) - Data: 00 00
    T2368 002:211 JLINK_WriteMemEx(0xFCFE3624, 0x0002 Bytes, ..., Flags = 2) - Data: 00 00
    T2368 002:216 JLINK_WriteMemEx(0xFCFE3524, 0x0002 Bytes, ..., Flags = 2) - Data: 00 00
    T2368 002:221 JLINK_WriteMemEx(0xFCFE7224, 0x0002 Bytes, ..., Flags = 2) - Data: 03 00
    T2368 002:260 JLINK_WriteMem(0x00000000, 0x0BE0 Bytes, ...) - Data: 18 F0 9F E5 18 F0 9F E5 ... - In flash
    T2368 002:261 JLINK_WriteMem(0x00000BE0, 0x0BE0 Bytes, ...) - Data: 00 48 2D E9 04 B0 8D E2 ... - In flash
    T2368 002:261 JLINK_WriteMem(0x000017C0, 0x0BE0 Bytes, ...) - Data: B0 20 83 E1 02 30 A0 E3 ... - In flash
    T2368 002:261 JLINK_WriteMem(0x000023A0, 0x0BE0 Bytes, ...) - Data: 00 01 96 E7 08 C0 8E E5 ... - In flash
    T2368 002:261 JLINK_WriteMem(0x00002F80, 0x0BD0 Bytes, ...) - Data: 01 60 A0 E3 00 00 A0 E3 ... - In flash
    T2368 002:262 JLINK_WriteMem(0x00003B50, 0x0BE0 Bytes, ...) - Data: 30 80 1B E5 00 C0 93 E5 ... - In flash
    T2368 002:262 JLINK_WriteMem(0x00004730, 0x0BD0 Bytes, ...) - Data: 0F 00 00 E2 00 48 2D E9 ... - In flash
    T2368 002:262 JLINK_WriteMem(0x00005300, 0x0BD0 Bytes, ...) - Data: 03 10 C2 D7 F0 88 BD E8 ... - In flash
    T2368 002:262 JLINK_WriteMem(0x00005ED0, 0x0BE0 Bytes, ...) - Data: 74 20 9F 15 7F 3F 0F 13 ... - In flash
    T2368 002:262 JLINK_WriteMem(0x00006AB0, 0x0BE0 Bytes, ...) - Data: 04 30 9F E5 31 16 83 E5 ... - In flash
    T2368 002:262 JLINK_WriteMem(0x00007690, 0x0BE0 Bytes, ...) - Data: C0 00 9F E5 00 20 94 E5 ... - In flash
    T2368 002:263 JLINK_WriteMem(0x00008270, 0x0BE0 Bytes, ...) - Data: 23 30 4B E5 24 20 4B E5 ... - In flash
    T2368 002:263 JLINK_WriteMem(0x00008E50, 0x0BE0 Bytes, ...) - Data: 34 33 9F E5 48 23 9F E5 ... - In flash
    T2368 002:263 JLINK_WriteMem(0x00009A30, 0x0BE0 Bytes, ...) - Data: 35 2B 42 EC 36 2B 42 EC ... - In flash
    T2368 002:263 JLINK_WriteMem(0x0000A610, 0x0BE0 Bytes, ...) - Data: 1C 30 9F E5 00 30 93 E5 ... - In flash
    T2368 002:263 JLINK_WriteMem(0x0000B1F0, 0x0BE0 Bytes, ...) - Data: 03 60 A0 E1 00 00 52 E3 ... - In flash
    T2368 002:263 JLINK_WriteMem(0x0000BDD0, 0x0BD0 Bytes, ...) - Data: 18 88 BD E8 00 00 93 E5 ... - In flash
    T2368 002:263 JLINK_WriteMem(0x0000C9A0, 0x0BE0 Bytes, ...) - Data: 03 00 00 0A 40 30 94 E5 ... - In flash
    T2368 002:264 JLINK_WriteMem(0x0000D580, 0x0BE0 Bytes, ...) - Data: 1F 30 03 E2 03 00 80 E1 ... - In flash
    T2368 002:264 JLINK_WriteMem(0x0000E160, 0x0BE0 Bytes, ...) - Data: 00 E0 DC E5 04 00 00 1A ... - In flash
    T2368 002:264 JLINK_WriteMem(0x0000ED40, 0x0BE0 Bytes, ...) - Data: 7C 10 BF E6 0B 20 63 E0 ... - In flash
    T2368 002:264 JLINK_WriteMem(0x0000F920, 0x0BF0 Bytes, ...) - Data: 00 00 54 E3 04 30 A0 01 ... - In flash
    T2368 002:264 JLINK_WriteMem(0x00010510, 0x0BE0 Bytes, ...) - Data: B4 31 DC E1 03 20 82 E0 ... - In flash
    T2368 002:264 JLINK_WriteMem(0x000110F0, 0x0BE0 Bytes, ...) - Data: 02 30 D1 E5 03 00 52 E1 ... - In flash
    T2368 002:264 JLINK_WriteMem(0x00011CD0, 0x0BD0 Bytes, ...) - Data: 00 0A BD F8 1F F0 7F F5 ... - In flash
    T2368 002:265 JLINK_WriteMem(0x000128A0, 0x0BE0 Bytes, ...) - Data: 01 30 83 E2 E0 30 84 E5 ... - In flash
    T2368 002:265 JLINK_WriteMem(0x00013480, 0x0BD0 Bytes, ...) - Data: E8 20 94 E5 01 00 A0 E3 ... - In flash
    T2368 002:265 JLINK_WriteMem(0x00014050, 0x0BD0 Bytes, ...) - Data: 40 30 92 05 48 20 94 05 ... - In flash
    T2368 002:265 JLINK_WriteMem(0x00014C20, 0x0BD0 Bytes, ...) - Data: E0 A2 03 E8 F0 A2 03 E8 ... - In flash
    T2368 002:265 JLINK_WriteMem(0x000157F0, 0x0BE0 Bytes, ...) - Data: F0 31 9F E5 05 30 03 E0 ... - In flash
    T2368 002:265 JLINK_WriteMem(0x000163D0, 0x0BB0 Bytes, ...) - Data: 20 24 93 E5 D2 21 E0 E7 ... - In flash
    T2368 002:266 JLINK_WriteMem(0x00016F80, 0x0BE0 Bytes, ...) - Data: 56 8B 06 00 E8 88 06 00 ... - In flash
    T2368 002:266 JLINK_WriteMem(0x00017B60, 0x0BD0 Bytes, ...) - Data: B0 40 D6 E1 02 4A 84 E3 ... - In flash
    T2368 002:266 JLINK_WriteMem(0x00018730, 0x0BE0 Bytes, ...) - Data: 04 00 A0 01 01 10 A0 03 ... - In flash
    T2368 002:266 JLINK_WriteMem(0x00019310, 0x0BC0 Bytes, ...) - Data: 28 31 9F E5 00 20 93 E5 ... - In flash
    T2368 002:266 JLINK_WriteMem(0x00019ED0, 0x0BD0 Bytes, ...) - Data: 4E 00 00 EA 00 00 55 E3 ... - In flash
    T2368 002:266 JLINK_WriteMem(0x0001AAA0, 0x0BD0 Bytes, ...) - Data: D9 0A 00 EB 0C D0 8D E2 ... - In flash
    T2368 002:267 JLINK_WriteMem(0x0001B670, 0x0BD0 Bytes, ...) - Data: 10 50 85 13 00 50 83 15 ... - In flash
    T2368 002:267 JLINK_WriteMem(0x0001C240, 0x0BD0 Bytes, ...) - Data: 00 30 86 E5 B2 30 D8 E1 ... - In flash
    T2368 002:267 JLINK_WriteMem(0x0001CE10, 0x0BE0 Bytes, ...) - Data: 38 80 BD E8 90 91 06 00 ... - In flash
    T2368 002:267 JLINK_WriteMem(0x0001D9F0, 0x0BE0 Bytes, ...) - Data: EE FF FF EA 00 00 55 E3 ... - In flash
    T2368 002:267 JLINK_WriteMem(0x0001E5D0, 0x0BE0 Bytes, ...) - Data: 8C B1 FF EB 00 00 50 E3 ... - In flash
    T2368 002:267 JLINK_WriteMem(0x0001F1B0, 0x0BC0 Bytes, ...) - Data: 2C 6A D4 ED 00 30 A0 E3 ... - In flash
    T2368 002:267 JLINK_WriteMem(0x0001FD70, 0x0BE0 Bytes, ...) - Data: FF 24 01 E2 00 28 82 E1 ... - In flash
    T2368 002:268 JLINK_WriteMem(0x00020950, 0x0BD0 Bytes, ...) - Data: 40 10 A0 E3 14 30 96 E5 ... - In flash
    T2368 002:268 JLINK_WriteMem(0x00021520, 0x0BE0 Bytes, ...) - Data: 0C C0 87 E0 00 10 A0 E1 ... - In flash
    T2368 002:268 JLINK_WriteMem(0x00022100, 0x0BE0 Bytes, ...) - Data: 20 20 9D E5 10 30 9D E5 ... - In flash
    T2368 002:268 JLINK_WriteMem(0x00022CE0, 0x0BE0 Bytes, ...) - Data: D4 E0 8D E5 D8 40 8D E5 ... - In flash
    T2368 002:268 JLINK_WriteMem(0x000238C0, 0x0BE0 Bytes, ...) - Data: 58 C1 9D E5 58 00 8D E2 ... - In flash
    T2368 002:268 JLINK_WriteMem(0x000244A0, 0x0BE0 Bytes, ...) - Data: 09 30 A0 E1 B8 40 8D E5 ... - In flash
    T2368 002:269 JLINK_WriteMem(0x00025080, 0x0BE0 Bytes, ...) - Data: 64 20 9D E5 78 30 9D E5 ... - In flash
    T2368 002:269 JLINK_WriteMem(0x00025C60, 0x0BD0 Bytes, ...) - Data: 00 40 A0 01 10 20 9D 05 ... - In flash
    T2368 002:269 JLINK_WriteMem(0x00026830, 0x0BE0 Bytes, ...) - Data: 03 30 C2 13 02 00 53 E1 ... - In flash
    T2368 002:269 JLINK_WriteMem(0x00027410, 0x0BD0 Bytes, ...) - Data: 30 80 BD E8 00 40 A0 E1 ... - In flash
    T2368 002:269 JLINK_WriteMem(0x00027FE0, 0x0BD0 Bytes, ...) - Data: 01 00 A0 13 06 10 40 E3 ... - In flash
    T2368 002:269 JLINK_WriteMem(0x00028BB0, 0x0BC0 Bytes, ...) - Data: F0 87 BD E8 F0 4F 2D E9 ... - In flash
    T2368 002:269 JLINK_WriteMem(0x00029770, 0x0BD0 Bytes, ...) - Data: 00 30 A0 E1 00 00 90 E2 ... - In flash
    T2368 002:270 JLINK_WriteMem(0x0002A340, 0x0BD0 Bytes, ...) - Data: A7 2D 00 E3 A0 0F A0 E1 ... - In flash
    T2368 002:270 JLINK_WriteMem(0x0002AF10, 0x0BC0 Bytes, ...) - Data: 2C C0 9D E5 02 00 51 E3 ... - In flash
    T2368 002:270 JLINK_WriteMem(0x0002BAD0, 0x0BB0 Bytes, ...) - Data: 04 6A 92 ED 06 7A F0 EE ... - In flash
    T2368 002:270 JLINK_WriteMem(0x0002C680, 0x0BC0 Bytes, ...) - Data: A7 6A 87 EE 27 7A C0 ED ... - In flash
    T2368 002:270 JLINK_WriteMem(0x0002D240, 0x0BB0 Bytes, ...) - Data: A9 9A 84 ED 18 8A C4 ED ... - In flash
    T2368 002:270 JLINK_WriteMem(0x0002DDF0, 0x0BC0 Bytes, ...) - Data: 67 EE A4 7A 83 F8 85 20 ... - In flash
    T2368 002:271 JLINK_WriteMem(0x0002E9B0, 0x0BC0 Bytes, ...) - Data: CE F6 10 00 CA F2 02 02 ... - In flash
    T2368 002:271 JLINK_WriteMem(0x0002F570, 0x0BD0 Bytes, ...) - Data: 0C F1 FF 3C 99 46 4F EA ... - In flash
    T2368 002:271 JLINK_WriteMem(0x00030140, 0x0BE0 Bytes, ...) - Data: 0C 00 53 E1 CC FF FF CA ... - In flash
    T2368 002:271 JLINK_WriteMem(0x00030D20, 0x0BE0 Bytes, ...) - Data: 00 30 A0 E3 E0 30 84 E5 ... - In flash
    T2368 002:271 JLINK_WriteMem(0x00031900, 0x0BE0 Bytes, ...) - Data: 06 C0 40 13 BD FF FF 0A ... - In flash
    T2368 002:271 JLINK_WriteMem(0x000324E0, 0x0BE0 Bytes, ...) - Data: 08 30 8D E2 00 20 8A E0 ... - In flash
    T2368 002:272 JLINK_WriteMem(0x000330C0, 0x0BE0 Bytes, ...) - Data: 06 00 A0 E1 24 C0 9D E5 ... - In flash
    T2368 002:272 JLINK_WriteMem(0x00033CA0, 0x0BE0 Bytes, ...) - Data: 2C 10 93 E5 01 3B A0 E3 ... - In flash
    T2368 002:272 JLINK_WriteMem(0x00034880, 0x0BE0 Bytes, ...) - Data: 08 30 91 E5 80 00 13 E3 ... - In flash
    T2368 002:272 JLINK_WriteMem(0x00035460, 0x0BE0 Bytes, ...) - Data: 00 10 A0 03 01 10 A0 13 ... - In flash
    T2368 002:272 JLINK_WriteMem(0x00036040, 0x0BC0 Bytes, ...) - Data: 24 30 94 E5 04 00 13 E3 ... - In flash
    T2368 002:272 JLINK_WriteMem(0x00036C00, 0x0BE0 Bytes, ...) - Data: 02 00 13 E3 D9 FF FF 0A ... - In flash
    T2368 002:273 JLINK_WriteMem(0x000377E0, 0x0BE0 Bytes, ...) - Data: 30 1C 0A E3 0C D0 4D E2 ... - In flash
    T2368 002:273 JLINK_WriteMem(0x000383C0, 0x0BE0 Bytes, ...) - Data: 02 20 D2 E5 BA 2C C4 E1 ... - In flash
    T2368 002:273 JLINK_WriteMem(0x00038FA0, 0x0BE0 Bytes, ...) - Data: AB EC FF EB 2C 30 94 E5 ... - In flash
    T2368 002:273 JLINK_WriteMem(0x00039B80, 0x0BE0 Bytes, ...) - Data: 98 8C 03 00 98 8C 03 00 ... - In flash
    T2368 002:273 JLINK_WriteMem(0x0003A760, 0x0BE0 Bytes, ...) - Data: 03 10 01 E2 01 10 42 E4 ... - In flash
    T2368 002:273 JLINK_WriteMem(0x0003B340, 0x0BE0 Bytes, ...) - Data: 01 90 89 E1 20 02 8A E1 ... - In flash
    T2368 002:274 JLINK_WriteMem(0x0003BF20, 0x0BD0 Bytes, ...) - Data: 70 40 2D E9 00 60 50 E2 ... - In flash
    T2368 002:274 JLINK_WriteMem(0x0003CAF0, 0x0BE0 Bytes, ...) - Data: B2 30 84 E1 CA D2 FF EB ... - In flash
    T2368 002:274 JLINK_WriteMem(0x0003D6D0, 0x0BD0 Bytes, ...) - Data: B0 21 CD E1 B2 31 CD E1 ... - In flash
    T2368 002:274 JLINK_WriteMem(0x0003E2A0, 0x0BE0 Bytes, ...) - Data: 08 10 A0 E1 05 20 A0 E1 ... - In flash
    T2368 002:274 JLINK_WriteMem(0x0003EE80, 0x0BE0 Bytes, ...) - Data: 00 00 90 E5 02 21 8C E0 ... - In flash
    T2368 002:274 JLINK_WriteMem(0x0003FA60, 0x0BE0 Bytes, ...) - Data: 02 60 A0 E1 00 50 A0 E1 ... - In flash
    T2368 002:274 JLINK_WriteMem(0x00040640, 0x0BE0 Bytes, ...) - Data: A1 36 FF EB 00 30 A0 E1 ... - In flash
    T2368 002:275 JLINK_WriteMem(0x00041220, 0x0BE0 Bytes, ...) - Data: 09 00 A0 E1 00 80 A0 E3 ... - In flash
    T2368 002:275 JLINK_WriteMem(0x00041E00, 0x0BD0 Bytes, ...) - Data: 0C 10 53 E5 0C C0 89 E0 ... - In flash
    T2368 002:275 JLINK_WriteMem(0x000429D0, 0x0BE0 Bytes, ...) - Data: 00 30 A0 E3 11 00 A0 E3 ... - In flash
    T2368 002:275 JLINK_WriteMem(0x000435B0, 0x0BE0 Bytes, ...) - Data: 5F 01 00 8A 00 00 55 E3 ... - In flash
    T2368 002:275 JLINK_WriteMem(0x00044190, 0x0BE0 Bytes, ...) - Data: 10 80 BD E8 01 00 E0 E3 ... - In flash
    T2368 002:275 JLINK_WriteMem(0x00044D70, 0x0BE0 Bytes, ...) - Data: 28 10 8D E5 34 50 8D E5 ... - In flash
    T2368 002:275 JLINK_WriteMem(0x00045950, 0x0BE0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:275 JLINK_WriteMem(0x00046530, 0x0BF0 Bytes, ...) - Data: 04 F0 1F E5 75 BD 02 00 ... - In flash
    T2368 002:276 JLINK_WriteMem(0x00047120, 0x0BF0 Bytes, ...) - Data: FF 0F FF 0F FF 0F FF 0F ... - In flash
    T2368 002:276 JLINK_WriteMem(0x00047D10, 0x0BE0 Bytes, ...) - Data: FF 0F FF FF FF FF EE FE ... - In flash
    T2368 002:276 JLINK_WriteMem(0x000488F0, 0x0BF0 Bytes, ...) - Data: FF 0F FF 0F FF 0F FF 0F ... - In flash
    T2368 002:276 JLINK_WriteMem(0x000494E0, 0x0BF0 Bytes, ...) - Data: FF 0F FF 0F FF 0F FF 0F ... - In flash
    T2368 002:276 JLINK_WriteMem(0x0004A0D0, 0x0BF0 Bytes, ...) - Data: 22 FD 22 FD 22 FD 22 FD ... - In flash
    T2368 002:276 JLINK_WriteMem(0x0004ACC0, 0x0BF0 Bytes, ...) - Data: FF 0F FF 0F FF 0F FF 0F ... - In flash
    T2368 002:276 JLINK_WriteMem(0x0004B8B0, 0x0BE0 Bytes, ...) - Data: DD FD EE FE FF FF DD FD ... - In flash
    T2368 002:277 JLINK_WriteMem(0x0004C490, 0x0BF0 Bytes, ...) - Data: 44 F8 66 F4 55 F5 55 F5 ... - In flash
    T2368 002:277 JLINK_WriteMem(0x0004D080, 0x0BE0 Bytes, ...) - Data: 33 F3 AA FA FF FF FF FF ... - In flash
    T2368 002:277 JLINK_WriteMem(0x0004DC60, 0x0BF0 Bytes, ...) - Data: 88 F9 55 F5 00 F0 11 F1 ... - In flash
    T2368 002:277 JLINK_WriteMem(0x0004E850, 0x0BF0 Bytes, ...) - Data: FF FF EF FE EE FE EE FE ... - In flash
    T2368 002:277 JLINK_WriteMem(0x0004F440, 0x0BF0 Bytes, ...) - Data: FF 0F FF 0F FF 0F FF 0F ... - In flash
    T2368 002:277 JLINK_WriteMem(0x00050030, 0x0BF0 Bytes, ...) - Data: 22 F2 22 F2 22 F2 22 F2 ... - In flash
    T2368 002:278 JLINK_WriteMem(0x00050C20, 0x0BF0 Bytes, ...) - Data: 22 F2 22 F2 22 F2 22 F2 ... - In flash
    T2368 002:278 JLINK_WriteMem(0x00051810, 0x0BF0 Bytes, ...) - Data: FF 0F FF 0F FF 0F FF 0F ... - In flash
    T2368 002:278 JLINK_WriteMem(0x00052400, 0x0BF0 Bytes, ...) - Data: 12 FB 12 FC 12 FE 12 FC ... - In flash
    T2368 002:278 JLINK_WriteMem(0x00052FF0, 0x0BF0 Bytes, ...) - Data: FF 0F FF 0F FF 0F FF 0F ... - In flash
    T2368 002:278 JLINK_WriteMem(0x00053BE0, 0x0BF0 Bytes, ...) - Data: FF 0F FF 0F FF 0F FF 0F ... - In flash
    T2368 002:279 JLINK_WriteMem(0x000547D0, 0x0BF0 Bytes, ...) - Data: 22 F2 22 F2 22 F2 22 F2 ... - In flash
    T2368 002:279 JLINK_WriteMem(0x000553C0, 0x0BF0 Bytes, ...) - Data: FF 0F FF 0F FF 0F FF 0F ... - In flash
    T2368 002:279 JLINK_WriteMem(0x00055FB0, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:279 JLINK_WriteMem(0x00056BA0, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:279 JLINK_WriteMem(0x00057790, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:279 JLINK_WriteMem(0x00058380, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:280 JLINK_WriteMem(0x00058F70, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:280 JLINK_WriteMem(0x00059B60, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:280 JLINK_WriteMem(0x0005A750, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:280 JLINK_WriteMem(0x0005B340, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:280 JLINK_WriteMem(0x0005BF30, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:280 JLINK_WriteMem(0x0005CB20, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:280 JLINK_WriteMem(0x0005D710, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:281 JLINK_WriteMem(0x0005E300, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:281 JLINK_WriteMem(0x0005EEF0, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:281 JLINK_WriteMem(0x0005FAE0, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:281 JLINK_WriteMem(0x000606D0, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:281 JLINK_WriteMem(0x000612C0, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:281 JLINK_WriteMem(0x00061EB0, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:281 JLINK_WriteMem(0x00062AA0, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:282 JLINK_WriteMem(0x00063690, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:282 JLINK_WriteMem(0x00064280, 0x0BF0 Bytes, ...) - Data: 00 00 00 00 00 00 00 00 ... - In flash
    T2368 002:282 JLINK_WriteMem(0x00064E70, 0x0BF0 Bytes, ...) - Data: C6 C6 7C 00 00 00 00 00 ... - In flash
    T2368 002:282 JLINK_WriteMem(0x00065A60, 0x0BD0 Bytes, ...) - Data: 30 38 58 20 3A 20 6C 61 ... - In flash
    T2368 002:282 JLINK_WriteMem(0x00066630, 0x0BE0 Bytes, ...) - Data: 00 25 73 3A 20 25 30 32 ... - In flash
    T2368 002:282 JLINK_WriteMem(0x00067210, 0x0BE0 Bytes, ...) - Data: 61 20 73 6D 61 6C 6C 20 ... - In flash
    T2368 002:282 JLINK_WriteMem(0x00067DF0, 0x0BE0 Bytes, ...) - Data: 45 4E 54 5F 41 6C 6C 6F ... - In flash
    T2368 002:283 JLINK_WriteMem(0x000689D0, 0x0BC0 Bytes, ...) - Data: 18 03 50 02 00 01 02 00 ... - In flash
    T2368 002:283 JLINK_WriteMem(0x00069590, 0x0BC0 Bytes, ...) - Data: EC 9E FF FC 00 9F FF FC ... - In flash
    T2368 002:283 JLINK_WriteMem(0x0006A150, 0x0BF0 Bytes, ...) - Data: 48 0C 00 00 00 00 00 00 ... - In flash
    T2368 002:283 JLINK_WriteMem(0x0006AD40, 0x0BE0 Bytes, ...) - Data: AA AA AA AA 00 FF 00 FF ... - In flash
    T2368 002:283 JLINK_WriteMem(0x0006B920, 0x0BD0 Bytes, ...) - Data: 45 55 65 75 85 95 A5 B5 ... - In flash
    T2368 002:283 JLINK_WriteMem(0x0006C4F0, 0x0BE0 Bytes, ...) - Data: 00 09 EB 00 10 07 08 00 ... - In flash
    T2368 002:283 JLINK_WriteMem(0x0006D0D0, 0x00BC Bytes, ...) - Data: 00 02 00 00 00 00 00 00 ... - In flash
    T2368 002:284 JLINK_WriteMem(0x0006D1A0, 0x0BE0 Bytes, ...) - Data: 04 96 00 00 00 00 00 00 ... - In flash  returns 0x6000011F
    T2368 002:654 JLINK_Reset() -- Type: 0
    T2368 002:816 JLINK_Halt()
    T2368 002:822 JLINK_ReadMem (0xFFFFFFFF, 0x0001 Bytes, ...) - Data: DF
    T2368 002:825 JLINK_ReadMem (0x00000000, 0x0004 Bytes, ...) - Data: 18 F0 9F E5
    T2368 003:513 JLINK_ReadMem (0x00006444, 0x0004 Bytes, ...) - Data: BA BD CB FF
    T2368 003:553 JLINK_ReadMem (0x00006444, 0x0004 Bytes, ...) - Data: BA BD CB FF
    T2368 003:553 JLINK_ReadMem (0x00006440, 0x0004 Bytes, ...) - Data: 5C 87 9C FF
    

    The important line appears near the bottom:

    "T2368 002:284 JLINK_WriteMem(0x0006D1A0, 0x0BE0 Bytes, ...) - Data: 04 96 00 00 00 00 00 00 ... - In flash  returns 0x6000011F"

    It seems as though the flash write results in an error.  I'll do some digging to see if I can make sense of the value 0x6000011F - which I'm guessing is a flash chip status response.

    I will also try the commands you mention above...

  • In reply to hodl layee:

    As to your command list, the software I'm using doesn't know about the "si", "Device", or "rx" commands - and the "speed" command seems to top out at 2000kHz. But the "mem" command worked and dumped a bunch of stuff.
  • In reply to jdseymour:

    I dropped back to version 490e, but the symptoms did not change.
    I also got a fresh supply of boards, so I sacrificed one to confirm that the problem remains the same: Once I "touch" one of my boards using e2studio5 and a new experimental project (based on the CMSIS_RTOS_RTX sample), then any subsequent attempt to load code from e2studio4 and my main project will fail.
    I'm still hoping someone can explain a manual process to erase the flash chip using JLink.exe (or anything else). Perhaps if I can manually erase the flash, I can recover the "bricked" boards...
  • In reply to jdseymour:

    You can manually erase your flash chip via the J-Link Commander utility.
    You can download it for free here www.segger.com/.../
    Choose the J-Link Software and Documentation Pack
    then run follwing commands in the command line

    JLink.exe (in the install directory)
    connect
    4 times Enter key -> Cortex-A9 identified. -> should be printed lastly after Jlink found and identified your device
    exec enableeraseallflashbanks
    erase

    then your flash should be erased completly

    you can manually load binary files in the flash with following command
    loadbin rz_a1h_qspi_loader.bin,0x18000000

    maybe the command line will give you a more detailed error message

  • In reply to Stojag:

    Thanks for this. It confirms what I tried already (see my post from August 10th). The error I get when I try this is:
    "T2368 002:284 JLINK_WriteMem(0x0006D1A0, 0x0BE0 Bytes, ...) - Data: 04 96 00 00 00 00 00 00 ... - In flash returns 0x6000011F"
    I haven't yet looked up what 0x6000011F means - and I haven't verified this on more than one board. I'll try to do that later today...
  • In reply to jdseymour:

    I'm sorry for not replying sooner.

    I expected trouble of Reset processing.
    But an error didn't occur by Reset processing.

    And I am sorry, I don't know the meaning of 0x6000011F.
    Well then, how about seeing the change by lowering the JTAG transfer rate?

    Please open "Connection Settings" of "Debugger" tab in Debug Configuration of e2studio.
    And change "Interface Speed (kHz)" to 100 from Auto.

    Is there any change in the error?
  • In reply to jdseymour:

    Hi,

    Please can you confirm the erase succeeded, and then you powered down the board and powered it up again between erasing the flash and attempting to re-program the device? If not please repeat this process as described by Stojag. If the erase succeeded the following suggestions may safely be ignored...

    My understanding of the issue is that after programming some new software, programming now fails.

    The description implies that the Segger tools program the connected NOR flash device correctly. This is shown by the initial programming sequence completing successfully.

    All operations after this point have failed. This is most likely because the code has started running as soon as power is applied to the board, and the RTX code will have configured some other operations such as an interrupt, reconfigured the parallel bus port pins or disabled the JTAG Pins. I have not inspected the RTX code, but I would suspect that a timer is running with an interrupt as it is based on an RTX OS which will modify the 'lr' register when performing a task swap, preventing return to the programming kernel.

    Question: Does the programming always fail at the same point in the NOR Flash?

    Please try, de-power the board / system then follow one of the following options. All are intended to stop NOR flash code running at startup.

    Option 1 (easiest & most likely to work):
    If you can modify the Mode pins on your board, change the operating mode of the processor to QSPI, or a different mode, to prevent NOR code from running at all.
    Then power up the board and program the NOR flash normally with known good code, not the RTX sample, without changing the mode pins. This will work as the initial configuration writes are there to configure the address data and control lines.
    Do not forget to turn off the board and re-set the mode pin after programming.

    Option 2:
    Program a very small application (such as the RSK tutorial) to overwrite the program before the programming process fails.

    Option 3:
    Create a batch file with the follwing content:
    "<path>\JLink.exe" -speed 12000 -if JTAG -device R7S721001 -CommanderScript EraseFlash.command

    Create a text file called EraseFlash.command

    add the content below between the --- markers:

    ---

    r
    exec setcfiflash 0x00000000-0x00FFFFFF
    exec setworkram 0x20090000-0x200FFFFF
    exec SetSkipProgOnCRCMatch=0
    w2 0xFCFE341C,0xFF41
    w2 0xFCFE3A1C,0x0000
    w2 0xFCFE361C,0x0000
    w2 0xFCFE351C,0x0000
    w2 0xFCFE721C,0xFF41
    w2 0xFCFE3420,0xFFFF
    w2 0xFCFE3A20,0x0000
    w2 0xFCFE3620,0x0000
    w2 0xFCFE3520,0x0000
    w2 0xFCFE7220,0xFFFF
    w2 0xFCFE3424,0x0003
    w2 0xFCFE3A24,0x0000
    w2 0xFCFE3624,0x0000
    w2 0xFCFE3524,0x0000
    w2 0xFCFE7224,0x0003
    exec enableeraseallflashbanks
    erase
    exit

    ---

    Power up the board and run the batch file.
    Hopefully this will execute quickly enough to begin the erase before code runs away. This should at least destroy the vector tables.

    Please let me know if this works.

    Martin.
  • In reply to hodl layee:

    Yes, it does seem that the error changed.  I seem to get the following error consistently on one board:

    J-Link>erase
    Erasing device (R7S721001)...

    ****** Error: Timeout while checking target RAM, core does not stop. (PC = 0x00001A40, CPSR = 0x40000197, LR = 0x00001EE0)!
    Failed to prepare for programming.
    Failed to execute RAMCode for RAM check!
    Error while determining flash info (Bank @ 0x18000000)
    ERROR: Erase returned with error code -1.

    I tried it three times (power-cycling and reconnecting the JLink each time) and the PC was the same each time.  Although on a different board, it gave a different address (probably because it had a different code image in it).  This is running at 100kHz.

    Just for giggles, I dropped the speed to 1kHz.  It still failed (after several minutes), but the error message was different:

    J-Link>erase
    Erasing device (R7S721001)...

    ****** Error: Communication timed out: Requested 4 bytes, received 0 bytes !

    ****** Error: Failed to download RAMCode.
    Failed to prepare for programming.
    Failed to download RAMCode!
    Error while determining flash info (Bank @ 0x18000000)
    ERROR: Erase returned with error code -1.

    Now I'm off to try Martin Baker's suggestions...  Stay tuned!

  • In reply to Martin Baker:

    Thanks for the detailed response.  Unfortunately, on my board, the Boot Mode pins are not connected to any jumpers or anything.  The relevant engineer is out eclipse-watching today, so I'll ask him tomorrow whether he can wire me up something.  (My fear is that the pins in question do not come out from under the BGA, so this may be a non-starter).

    (In a pinch, I can have him remove the flash chip and replace it with an unprogrammed one).

    I doubt Option 2 will work since my current failures seem to occur because the J-Link is unable to stop the processor.

    As for option 3, it produced the same result that I saw when I manually entered the commands (see my response to hodl layee earlier today):

    ****** Error: Timeout while checking target RAM, core does not stop. (PC = 0x00001A40, CPSR = 0x40000197, LR = 0x00001EE0)!
    Failed to prepare for programming.
    Failed to execute RAMCode for RAM check!
    Error while determining flash info (Bank @ 0x18000000)
    ERROR: Erase returned with error code -1.

    I guess the good news is that it's consistent!

  • In reply to jdseymour:

    In case anyone is still reading this thread...

     

    I managed to get jumpers installed on the three BOOT pins (which includes the CS0 chip select).  After playing around with all combinations that we could think of, the board stubbornly refused to let us program it.

    So we pulled the flash chip and replaced it with a fresh one...  This made no difference!

    This tells me that my problem is NOT related to any "broken" code in the flash.

    I also verified that my J-Link LITE is functional by using it on a known good board with my known good project.

    The bottom line: I can "brick" my boards to the point where nothing I have tried will bring them back to the land of the living - and I still don't know if it's a problem with my environment or my hardware design or what...

     

    If anybody has any ideas (brilliant or otherwise), I'm all ears!

  • In reply to jdseymour:

    So, it sounds like it's only 1 board that's giving you the issue, correct?

    Did you at least put a scope on the lines and make sure there were 'wiggles' on all the lines (CS, RD,WR,A0-Ax,D0-Dx, etc...). That's usually one of the first things I do to make sure the pins are designed and set up correctly.

    Of course if everything works find on another board, then you would think the pin setup is fine (unless there is some floating pin or something acts differently from board to board...which I've run into before over the years).

    If you set the boot pins to boot from CS0 NOR Flash, then the pins should default to the correct pinmux settings (address, data, etc..). If they are set for QSPI boot or something else, you would have to manually set them up. I'm not sure if the JLINK sets that up for you, or just assumes that is already taken care of.

    Anyway, since you can connect with JLINK:

    1. What happens if you build some code to run from RAM (start address = 0x20020000, not 0x20000000) and then simply try to read the flash? Do you get 0xFF like you'd expect? or do you get something different?

    2. If you get 0xFF, can you write some simple code to use the CFI interface and see if you can in fact read out the device ID and such.

    This at least this takes the JLINK firmware out of the equation (because I'm not really sure what id does or doesn't do in terms of pin/device setup)

    Chris