[SOLVED] Programming external Macronix MX25 flash with J-Flash?

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

  • [SOLVED] Programming external Macronix MX25 flash with J-Flash?

    I have a situation wherein I need to flash a specific image to a Macronix MX25 flash that is already on my boards. So far, I have been using custom programs with assets converted to C binary blobs and compiled in (yes, seriously), to then be flashed to the external flash upon execution.
    It would be great if I could use J-Flash to accomplish this, especially as it gets more complex.

    Looking through the J-Flash manual, it looks like there is some support for tasks like this. But it looks like it is mainly focused on QSPI, whereas we as just using single SPI.

    Is there already support for the MX25 command set and layout in J-Flash at some level? The exact part is MX25L12835F.
    The only that I found to MX25 on the wiki was for an imx7 CPU, which I can only guess has a more standard dedicated QSPI interface, since there is no specification of the pinout or chip setup, and I see no section for that in the J-Flash manual.

    Also, per the datasheet, the MX25 is not CFI compliant, but rather it provides "The Serial Flash Discoverable Parameter (SFDP) standard", JESD216B.


    Is this going to take a custom RAMcode to accomplish? If so, are there examples available?
  • Hello,


    Thank you for your inquiry.
    What exactly is your setup? Do you want to program the device through an MCU with a flash loader?
    Or do you want to connect the SPI flash directly with J-Link and flash it that way?

    We offer solutions for both options.
    For the first one you would need to write a new flash loader for the MCU you are going to use if it is not supported already: wiki.segger.com/Adding_Support_for_New_Devices

    For the second option you can simply use JFlashSPI. A list with supported SPI Flashes can be found here: segger.com/products/debug-prob…pported-cpus-and-devices/
    There you will also see a little info graphic on how the SPI Flash needs to be connected to the J-Link.

    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.
  • The use case is to flash the SPI flash via the existing microcontroller. The SPI bus isn't sufficiently available on the board (without building a flying probe system, which I don't know how to do) to use JFlashSPI.

    The micro is an ST Cortex M4, so should be well supported.
    Since I saw at least one mention of the MX25 on the wiki, the hope was that the flashing command set or RAMCode already existed somewhere in the JLink libraries.

    I am still not quite certain what the setup should look like to get this working with the external flash. Even the template seems to be set up for an internal flash somewhere on the address bus (e.g. a _FLASH_BASE_ADDR is specified).
    But I'll go through the documentation and have a deeper look at the template.
  • Hello,

    The micro is an ST Cortex M4, so should be well supported.
    Since I saw at least one mention of the MX25 on the wiki, the hope was that the flashing command set or RAMCode already existed somewhere in the JLink libraries.

    Yes that setup should work without issues. Unfortunately the flash loaders for the MX25 devices that we have in the J-Link Libraries are not compatible to the open flash loader as open flash loader depends highly on the MCU that you are going to use so the generic code from our library will not help.

    I am still not quite certain what the setup should look like to get this working with the external flash. Even the template seems to be set up for an internal flash somewhere on the address bus (e.g. a _FLASH_BASE_ADDR is specified).


    The main.c is only for testing the flash loader. So the base address is the memory address that the QSPI module Flash area on the MCU is mapped to. If your target device does not have a QSPI module with memory mapped access, then you can use any memory area that is not used our out of bounds for the MCU memory map.

    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.