[SOLVED] failure to program flash on STM32F407

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

  • [SOLVED] failure to program flash on STM32F407

    Hi
    I notice that others are also having problems with St micros and flash programming, but my brand new jlink won't flash at all
    Im following this page from the manufacturers website segger.com/products/debug-prob…lash-download/#tab-3145-4
    The output from JLinkExe is shown at the bottom.
    Im using linux and the program binary will download OK but will not program the flash, no errors shown, and the flash is still blank
    I can use an olimex usb-ocd-h and the flash can be programmed correctly
    According to the Segger website "Supports direct download into RAM and flash memory"
    If I program the flash with the olimex, then I can debug with the Jlink, so connections and power must be OK

    I have now tried arm_segger_embedded_studio_334_linux_x64 which can program the flash under linux, which suggests the problem is JLinkExe.
    Which may sound like a solution, but Im trying to use eclipse which cannot program the flash through jlink either

    Does anybody have any suggestion about what the problem might be ?
    Thanks in advance Chris

    --- JLinkExe output when trying to program flash at 0x8000000 ----
    J-Link>
    user@linux:~/eclipse> ./JLink_Linux_V622d_x86_64/JLinkExe -if swd -device cortex-m4 -speed 4000
    SEGGER J-Link Commander V6.22d (Compiled Dec 14 2017 18:34:26)
    DLL version V6.22d, compiled Dec 14 2017 18:34:21

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V10 compiled Dec 12 2017 16:37:47
    Hardware version: V10.10
    S/N: 260104775
    License(s): FlashBP, GDB
    OEM: SEGGER-EDU
    VTref = 4.902V


    Type "connect" to establish a target connection, '?' for help
    J-Link>loadbin /home/user/sandpit/st_micro/stm32f1_work/Project/IOToggle/main.hex 0x8000000
    Target connection not established yet but required for command.
    Device "CORTEX-M4" selected.


    Connecting to target via SWD
    Found SW-DP with ID 0x2BA01477
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    Cortex-M4 identified.
    Downloading file [/home/user/sandpit/st_micro/stm32f1_work/Project/IOToggle/main.hex]...
    O.K.

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

  • Hi,

    Thank you for your inquiry.
    Are you programming an eval board or custom hardware?
    You are not following the instructions on the web page as written.
    First you need to select the exact STM32F407 device that you are using.
    In the output you provided you are simply choosing a generic "CORTEX-M4" device.
    This way flash download will not work as J-Link does not know where the flash is located for that device.
    Pass the commander the exact device name and you should be good to go.

    One more thing that looks suspicious. The Commander outputs a VTref of 4.9 V.
    This seems rather high for this particular target device (typically 3.3 V). Make sure that the board you are using is capable of handling the ~5 V.
    Because this voltage will be applied to the SWD pins and if there is no buffer stage on your board between J-Link and the STM32F407 your target device will most likely be damaged.

    Best regards,
    Nino
    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 Nino
    typing "device ?" should give a list of devices but it doesn't
    so I had to rely on the segger webpage which gave me generic devices,
    i have now found another page with the specific devices
    using device = stm32f407vg works fine.
    thanks for your help
    Chris