[SOLVED] Error Erasing second MB on STM32F429II remains

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

  • [SOLVED] Error Erasing second MB on STM32F429II remains

    Hello,

    I'm using a Jlink Plus, HW V9.10, DLL V5.02h, FW J-Link V9 compiled Oct 9 2015 20:34:47 on Keil MDK-Arm 4.74 and 5.17

    Problem:
    The Debug Adapter fails to erase the second Megabyte of the STM32F429 flash. A verify after an erase/program cycle fails.
    This does not occur when i erase the whole chip!

    My Software contains a Bootloader and the real firmware. Both programs are different Keil Projects.
    The address of the Bootloader is 0x0800_0000 - 0x0800_7FFF.

    When i use the Firmware Project, than i won't overwrite the already existing Bootloader. So i have configured the debug Adapter settings inside Keil MDK to use a address range from 0x0800_8000 - 0x081F_FFFF for flash operations.

    My second Debug Adapter (Keil ULINK Pro) works perfectly in this Situation!

    The Output of the Debug Adapter is:

    * JLink Info: Device "STM32F429II" selected.

    JLink info:
    ------------
    DLL: V5.02h, compiled Oct 29 2015 19:04:05
    Firmware: J-Link V9 compiled Oct 9 2015 20:34:47
    Hardware: V9.10
    S/N : xxxxxxxxx
    Feature(s) : RDI, FlashBP, FlashDL, JFlash, GDB

    * JLink Info: Found SWD-DP with ID 0x2BA01477
    * JLink Info: Found SWD-DP with ID 0x2BA01477
    * JLink Info: Found Cortex-M4 r0p1, Little endian.
    * JLink Info: FPUnit: 6 code (BP) slots and 2 literal slots
    * JLink Info: CoreSight components:
    * JLink Info: ROMTbl 0 @ E00FF000
    * JLink Info: ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
    * JLink Info: ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
    * JLink Info: ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
    * JLink Info: ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
    * JLink Info: ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
    * JLink Info: ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM
    ROMTableAddr = 0xE00FF003

    Target info:
    ------------
    Device: STM32F429II
    VTarget = 3.330V
    State of Pins:
    TCK: 0, TDI: 1, TDO: 0, TMS: 1, TRES: 1, TRST: 1
    Hardware-Breakpoints: 6
    Software-Breakpoints: 8192
    Watchpoints: 4
    JTAG speed: 12000 kHz

    Erase Done.
    Programming Done.
    Contents mismatch at: 08100000H (Flash=00H Required=80H) !
    Contents mismatch at: 08100001H (Flash=20H Required=A0H) !
    Contents mismatch at: 08100003H (Flash=00H Required=D3H) !
    Contents mismatch at: 08100004H (Flash=00H Required=4AH) !
    Contents mismatch at: 08100006H (Flash=00H Required=F3H) !
    Contents mismatch at: 08100007H (Flash=23H Required=ABH) !
    Contents mismatch at: 08100009H (Flash=00H Required=E1H) !
    ... and so on

    Thank you
    Martin
  • Hello Martin,



    Is the Keil project configured to use J-Link flashloader?
    Could you provide us with a J-Link logfile?



    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.
  • From the log I would say that he is using the Keil flashloader, so flashing is not under control of J-Link and if something fails, it is highly possible that the problem is on the Keil/ARM side as it's their flashloader.
    Are you using *exactly* the same settings with J-Link and uLink?
    My guess: For uLink you have 2 flashloaders selected (one for each flash bank), for J-Link only one (only the first flash bank).
    If I remember correctly, uVision separates the settings for J-Link and uLink so configuring the project correctly for one probe does not mean it will automatically be configured correctly for the second one as well.

    Could you give it a try with the J-Link flashloader?:
    segger.com/IDE_Integration_Keil.html#usingflashloader


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

    I have configured both to use the "debug driver " settings and both are equal.

    Now i have changed the flash tool to the j-link flash loader and changed the debug settings to upload the new program with the flash tool.
    The jlink flash loader works perfectly!

    So i have to contact the Keil Team?

    Thank you so far
    Martin
  • Hi,

    After a long time...

    Is it possible, that Errata 2.1.10 (STM32F42xx) comes into the game?


    PA12 GPIO limitation
    Description
    When PA12 is used as GPIO or alternate function in input or output mode, the data read
    from Flash memory can be corrupted. This behavior is observed only when the following
    conditions are met:
    • The device operates from a 2.7 to 3.6 V V DD power supply whatever the temperature
    range
    • Flash memory Bank2 is used or the dual bank feature is enabled.
    Impacted products
    • STM32F42xxI and STM32F43xxI part numbers
    • STM32F42xxG and STM32F43xxG part numbers only when dual bank feature is
    enabled.
    Not impacted products
    • STM32F42xxG and STM32F43xxG part numbers when dual bank feature is disabled
    • STM32F42xxE and STM32F43xxE part numbers.
    Workaround
    PA12 must be left unconnected on the PCB (configured as push-pull and held Low). You
    can use all the other GPIOs and all alternate functions except for the ones mapped on
    PA12. Use the OTG_HS peripheral in full-speed mode instead of the OTG_FS peripheral.
  • Hi Martin,
    The jlink flash loader works perfectly!

    Did this change? Do you experience any issues with the J-Link loader?

    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,

    Yes, it seems that this behaviour is not stable and i cannot say why.
    In the meantime i have used a ULink Pro Debug Adapter without any Problems, but know i whould like to use my JLinks also, so i have to come back to this Problem.

    All of my Boards are using Port PA12 in Alternate Funktion Mode an most of my Boards are using a STM32F429II Rev. 1

    Martin
  • Hi Martin,

    I am sorry that you are experiencing issues.
    Yes, it seems that this behaviour is not stable and i cannot say why.

    In which way is it unstable? Do you get an error message? What is the problem?
    How often does it fail? (On in two, one in three, one in 10 attempts?)

    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.
  • Sorry for my bad english,

    Error Message as bevore:
    Contents mismatch at: 08100000H (Flash=00H Required=80H) !

    Contents mismatch at: 08100001H (Flash=20H Required=A0H) !

    Contents mismatch at: 08100003H (Flash=00H Required=D3H) !

    It fails sometimes on every attempt and sometimes only on 3 of 10.
    The erase cycle fails on the second MB of the flash. If i erase the flash manually bevor i reprogram it everything is OK.

    Martin
  • Hi,

    I think i got it:

    The problem arrives when i change the flash range in the "Cortex-M Target Driver Setup" Dialog on the Page "Flash Download" of Keil MDK.
    I have changed the Range to 08008000H - 081FFFFFH to protect my Bootloader. When i change the range back to 08000000H - 081FFFFFH everything works fine with my JLink probe also.

    Martin