Programming external NOR Flash on STM32F429

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

  • Programming external NOR Flash on STM32F429

    We have a STM32F429ZIT6 with a Spansion S29GL256S10 external NOR Flash.
    When we run J-Link debugger it seems to recognise the Flash but fails to program it.
    (the same happens within IAR IDE and using JFlash).
    J-Link init script is the same as Segger example for '407. Although the 407 uses FSMC and 429 uses FMC they are compatible for NOR Flash setup.
    Flash WP and RESET are both pulled high by resistors and not connected anywhere else.
    Any thoughts?
  • Hi,

    We gave it a quick try here using a STM324x9I-Eval (STM32F429 device on it) + IAR EWARM V6.40.5 (using J-Link DLL V4.96) and everything works just fine.
    The test project contains a function which is linked into the external CFI NOR flash. The main application is linked to the user flash.
    After starting the debug session, both the internal user flash and the external CFI NOR flash have been programmed succesfully.
    Please find the used test project attached to this post. Can you please check for any differences.

    If you still see the behavior (reading works but programming not), please make sure that the nWP pin of the flash is HIGH.

    - Erik
    Files
    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 Erik,
    I've finally had time to look at this again..
    Unfortunately it still fails with the same error.
    I've compared the hardware design of 'my' board with the STM324x91 Eval board.
    The main difference is the Flash chip itself - Eval uses Micron MT48LCM32 'mine' uses
    Spansion S29GL256S.
    To recap, my code can program the Flash. I can read the array correctly in JFlash (which also verifies the ID) and erase the entire chip without problem.
    But any attempt to program individual bytes causes an error (same error I get when running your example).
    I avoided the bottom/top sectors to rule out WP causing an issue (but according to the datasheet if WP was low then a chip erase would fail).
    All I can think of is that there is some problem reading the status back?
    It's very confusing!
    Vic
  • Hi Vic,

    I can read the array correctly in JFlash (which also verifies the ID) and erase the entire chip without problem.
    Does the flash contain data before triggering erase? If not, erase is skipped as the sector are already empty and J-Flash would "erase - successful" but did not erase anything.
    To recap, my code can program the Flash.
    What code? Do you mean the target application running on the device or an application running on the PC?
    The main difference is the Flash chip itself - Eval uses Micron MT48LCM32 'mine' uses
    Spansion S29GL256S.
    Did you make sure that the pins are compatible and configured, correctly?

    This still sounds like a issue regarding protection as read / identify in general seems to work fine.
    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 Erik,
    1. Yes, the chip contains a pattern that I program from my own code - this pattern reads back correctly with JFlash then after an erase it reads back as all FF.
    2. The target application has a Flash test - this just programs the pattern as mentioned above (about 100 bytes) and reads it back to verify.
    3. I checked the pin programming that your code does (via the macro) and it seems fine - but I will check it again!
    According to the data sheet the protection would prevent ease as well as programming - 1. rules this out, as it definitely can be erased by JFlash.
    Also, I tried a sector in the middle of the address range - the protection only applies to first and last sectors - and that had the same problem.
    Vic