[SOLVED]J-Flash cant unsecure stm32f303 chip

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED]J-Flash cant unsecure stm32f303 chip

    Hello!
    I try to use J-Flash to unsecure STM32F303CC in my hardware.

    In my project i secure chip on power up with code:

    Source Code

    1. if (FLASH_OB_GetRDP() == RESET)
    2. {
    3. FLASH_Unlock();
    4. FLASH_OB_Unlock();
    5. FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPERR);
    6. FLASH_OB_RDPConfig(OB_RDP_Level_1);
    7. FLASH_OB_Launch();
    8. FLASH_OB_Lock();
    9. FLASH_Lock();
    10. }

    When i try to read back entire chip J-Flash Says:

    Brainfuck Source Code

    1. Application log started
    2. - J-Flash ARM V4.54 (J-Flash compiled Sep 11 2012 18:33:38)
    3. - JLinkARM.dll V4.54 (DLL compiled Sep 11 2012 18:32:59)
    4. Reading flash device list [C:\Program Files (x86)\SEGGER\JLinkARM_V454\ETC\JFlash\Flash.csv] ...
    5. - List of flash devices read successfully (1476 Devices)
    6. Reading MCU device list [C:\Program Files (x86)\SEGGER\JLinkARM_V454\ETC\JFlash\MCU.csv] ...
    7. - List of MCU devices read successfully (1720 Devices)
    8. Opening project file [C:\Program Files (x86)\SEGGER\JLinkARM_V454\Default.jflash] ...
    9. - Project opened successfully
    10. Connecting ...
    11. - Connecting via USB to J-Link device 0
    12. - J-Link firmware: V1.20 (J-Link ARM V6 compiled Jun 20 2012 19:43:26)
    13. - JTAG speed: 5 kHz (Fixed)
    14. - Initializing CPU core (Init sequence) ...
    15. - Initialized successfully
    16. - JTAG speed: 2000 kHz (Auto)
    17. - Connected successfully
    18. Reading entire flash chip ...
    19. - 128 sectors, 1 range, 0x8000000 - 0x803FFFF
    20. - RAM tested O.K.
    21. - ERROR: PC of target system has unexpected value after blank checking. (PC = 0x200000E2)!
    22. ---------------------------------------------------------------------- Registers -------------------------------------------------------------------------------------
    23. PC = 200000E2
    24. Current: R0 = 00007BB8, R1 = 08000000, R2 = 00008000, R3 = 00007BB8
    25. R4 = 20000000, R5 = 00007BB4, R6 = 000000FF, R7 = 20000147
    26. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    27. - ERROR: Failed to read back target memory
    28. Disconnecting ...
    29. - Disconnected
    Display All

    Then i try to unsecure chip :

    Source Code

    1. Connecting ...
    2. - Connecting via USB to J-Link device 0
    3. - J-Link firmware: V1.20 (J-Link ARM V6 compiled Jun 20 2012 19:43:26)
    4. - JTAG speed: 5 kHz (Fixed)
    5. - Initializing CPU core (Init sequence) ...
    6. - Initialized successfully
    7. - JTAG speed: 2000 kHz (Auto)
    8. - Connected successfully
    9. Unsecure chip ...
    10. - Disconnecting ...
    11. - Disconnected
    12. - Connecting via USB to J-Link device 0
    13. - Chip unsecured successfully - Completed after 0.557 sec
    Display All

    It seems unsecure was successfull?
    But then i try to read back entire chip again
    And

    Brainfuck Source Code

    1. Reading entire flash chip ...
    2. - Connecting ...
    3. - Connected successfully
    4. - 128 sectors, 1 range, 0x8000000 - 0x803FFFF
    5. - RAM tested O.K.
    6. - ERROR: PC of target system has unexpected value after blank checking. (PC = 0x200000E2)!
    7. ---------------------------------------------------------------------- Registers -------------------------------------------------------------------------------------
    8. PC = 200000E2
    9. Current: R0 = 00007BB8, R1 = 08000000, R2 = 00008000, R3 = 00007BB8
    10. R4 = 20000000, R5 = 00007BB4, R6 = 000000FF, R7 = 20000147
    11. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    12. - ERROR: Failed to read back target memory
    13. Disconnecting ...
    14. - Disconnected
    Display All

    In addition - I tried to reconnect the power and i tried to use J-Link STM32 Unlock utility - all the same.
    Please help to understand
  • Hi,

    and i tried to use J-Link STM32 Unlock utility - all the same.

    Could you please try a current version of the J-Link software?
    From your log outputs it looks like you are using V4.54. Current version is V4.80d. (segger.com/jlink-software.html)
    Could you please give it a try?


    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Ok, all the same:

    Brainfuck Source Code

    1. Application log started
    2. - J-Flash ARM V4.80c (J-Flash compiled Jan 21 2014 20:02:00)
    3. - JLinkARM.dll V4.80c (DLL compiled Jan 21 2014 20:01:42)
    4. Reading flash device list [C:\Program Files (x86)\SEGGER\JLinkARM_V480c\ETC\JFlash\Flash.csv] ...
    5. - List of flash devices read successfully (2208 Devices)
    6. Reading MCU device list [C:\Program Files (x86)\SEGGER\JLinkARM_V480c\ETC\JFlash\MCU.csv] ...
    7. - List of MCU devices read successfully (3489 Devices)
    8. Opening project file [C:\Program Files (x86)\SEGGER\JLinkARM_V480c\Samples\JFlash\ProjectFiles\303cc.jflash] ...
    9. - Project opened successfully
    10. Close project
    11. - Project closed
    12. Opening project file [C:\Program Files (x86)\SEGGER\JLinkARM_V480c\Samples\JFlash\ProjectFiles\303cc.jflash] ...
    13. - Project opened successfully
    14. Reading entire flash chip ...
    15. - Connecting ...
    16. - Connected successfully
    17. - 128 sectors, 1 range, 0x8000000 - 0x803FFFF
    18. - RAM tested O.K.
    19. - ERROR: PC of target system has unexpected value after blank checking. (PC = 0x200000EA)!
    20. ---------------------------------------------------------------------- Registers -------------------------------------------------------------------------------------
    21. PC = 200000EA
    22. Current: R0 = 00007BA0, R1 = 08000000, R2 = 00008000, R3 = FFFFFFFF
    23. R4 = 20000000, R5 = 00007B9C, R6 = 000000FF, R7 = 2000014F
    24. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    25. - ERROR: Failed to read back target memory
    26. Disconnecting ...
    27. - Disconnected
    28. Unsecure chip ...
    29. - Connecting via USB to J-Link device 0
    30. - Chip unsecured successfully - Completed after 0.402 sec
    Display All

    Then i reconnected the power

    Brainfuck Source Code

    1. Connecting ...
    2. - Connecting via USB to J-Link device 0
    3. - J-Link firmware: V1.20 (J-Link ARM V6 compiled Jun 20 2012 19:43:26)
    4. - JTAG speed: 5 kHz (Fixed)
    5. - Initializing CPU core (Init sequence) ...
    6. - Initialized successfully
    7. - JTAG speed: 2000 kHz (Auto)
    8. - Connected successfully
    9. Reading entire flash chip ...
    10. - 128 sectors, 1 range, 0x8000000 - 0x803FFFF
    11. - RAM tested O.K.
    12. - ERROR: PC of target system has unexpected value after blank checking. (PC = 0x200000EA)!
    13. ---------------------------------------------------------------------- Registers -------------------------------------------------------------------------------------
    14. PC = 200000EA
    15. Current: R0 = 00007BA0, R1 = 08000000, R2 = 00008000, R3 = FFFFFFFF
    16. R4 = 20000000, R5 = 00007B9C, R6 = 000000FF, R7 = 2000014F
    17. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    18. - ERROR: Failed to read back target memory
    19. Disconnecting ...
    20. - Disconnected
    21. [code]
    Display All
  • Hi,

    Thank you for pointing this out.
    We determined the problem here. We plan to create a new
    version of the J-Link software which includes this fix tomorrow/next week.


    Best regards
    Erik
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.