JLINK - STM32L431RC erase fail

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

  • JLINK - STM32L431RC erase fail

    Hi,

    We are using the STM32L431RG STM32L431RC on customs boards ( 256k of flash ). After some investigations on a flash initialization problem, we realized that the Jlink don't erase the second part of the flash whereas stlink do it.
    We highlight the problem by filling the flash with a value and then clear it with Jlink . Result is only first 128k of flash are erased.
    We need the JLink to debug our board throw gdb. Can you fix this problem ? Maybe STM32431RG STM32431RC description file is wrong ?

    Best regards,


    Thomas POINSOT

    The post was edited 3 times, last by thom0801 ().

  • Hi Thomas,

    thanks for your inquiry.
    I am not eware of any device named "STM32L431RG".
    According to ST's website,
    the following STM32L4x1 devices exist:
    256k: STM32L431KC, STM32L431CC, STM32L431RC, STM32L431VC
    128k: STM32L431KB, STM32L431CB, STM32L431RB

    In case this is not a typ0, could you please provide me with a link to the product page or documentation?

    Best regards,
    Niklas
    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.
  • Hi Thomas,

    Unfortunately, we do not have a STM32L4x1 device here for testing purposes.
    STM32L476 and STM32L432 work just fine, and the STM32L431RC device is correctly listed with 256K Flash.

    Could you please give J-Link Commander a try?
    J-Link commander is part of the J-Link software package, which is available free of charge here .

    • Start J-Link Commander (jlink.exe)
    • Type "connect" in order to start a debug session
    • Type in the target device name when asked ("STM32L431RC")
    • Choose the correct target interface (JTAG/SWD/etc..)
    • Use a valid speed (Default: 4000kHz, try 100-500 if default does not work)
    • [JTAG only]JTAG conf can be default(most of the times)
    • You should now be successfully connected
    • Now type "erase" in order to request a chip erase of the device
    • Check the contents of the Flash by using the mem32 command
    If anything fails, could you please post a screenshot of the complete session?

    Best regards,
    Niklas
    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.
  • Hi,

    Device was previously filled with "DF" byte ( with st-link utilities).
    Then I plug J-link instead of st-link and I run the erase command with J-Link commander as you described ( see attachment ).
    No error seems to be returned by the jlink.

    After that, I plug again the stlink and i read back the entire chip. We can see that the memory is erased only before the 0x0801FFFF address and not after...

    Regards,

    Thomas


    [img]http://forum.segger.com/index.php?page=Attachment&attachmentID=1258&h=fab3c88507a06a03a202cdcd3ea2cb610764f61c[/img]
    Images
    • captureSegger.png

      206.86 kB, 1,505×981, viewed 725 times
  • Hi Thomas,

    Could you please make sure that Option Byte DUALBANK is set to 1?
    More info: wiki.segger.com/STM32L4_dualbank_flash_programming

    Best regards,
    Niklas
    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.
  • Hi Thomas,

    you are correct, sorry for wasting your time.
    We just found an error in the Flash programming Algo for STM32L4xN devices.

    Will be fixed by the end of this week.

    Best regards,
    Niklas
    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.
  • Hi Thomas,

    I am sorry the delay, the fix for the Algo did not made it in time for 6.10a.
    We will either publish V6.10b or I will provide with a preliminary version that fixes this issue by tomorrow evening.

    I am sorry for any inconvenience caused.

    Best regards,
    Niklas
    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.
  • Hi Thomas,

    please find here a preliminary version of the J-Link software that fixes the issue regarding STM32L4 single bank devices:

    EDIT: Link removed, change has been merged into the official version of the J-Link software & documentation pack.

    Could you please provide feedback if this version works for you?

    Best regards,
    Niklas
    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.
  • STM32L476RE - Flash sector 2 locked after writing

    Hi Niklas,

    Using the last J-link suite V6.10i I had problems writing the 2nd FLASH sector (0x08040000-0x0807FFFF) of a STM32L476RE.
    After many tests it seems as the 2nd sector is "locked" after the first write.

    In fact, I write and erase a piece of code on FLASH sector 1 how many times I want (standard behavior of a debug session).
    If I try to write the same code on the 2nd sector, after the very first time it isn't possible to erase and rewrite it again.

    After this, the processor FLASH can be "unlocked" only using the JlinkSTM32 utility.

    Do the write-erase sequences with the J-Link Commander leads to the same results.
    I investigated also on FLASH_OPTR, WPR and PCROP status after writing, but nothing seems to write-protect the FLASH sector 2.

    Maybe this is an hidden issue of the Flash programming Algo?


    Thank you in advance for investigating it.

    Dario
    Images
    • Erasefailure.PNG

      36.47 kB, 1,291×526, viewed 483 times