[SOLVED] SEGGER_OPEN_Read function from Open Flash Loader is not called

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

  • [SOLVED] SEGGER_OPEN_Read function from Open Flash Loader is not called

    Hello!
    I'm using custom flash loader to read/write external flash/eeprom for my target device. The Flash loader is implemented according to wiki page: wiki.segger.com/Open_Flashloader
    It works fine for read/write/erase operation if I use JFlash.exe application. So I can be sure, my custom loader is OK.

    But for automation goals I use custom scripts to communicate with j-link through DLL:

    To write data I use following sequence of DLL calls:
    ________________________________________________
    SEGGER-Fabian Redacted:
    J-Link SDK topics are not to be discussed in public.
    If you are in valid support period for the SDK, please open a support ticket:
    segger.com/support/technical-support/

    ________________________________________________
    It works fine and I can confirm the expected data is stored to external flash.

    To read data I use following sequence of DLL calls:
    ________________________________________________
    SEGGER-Fabian Redacted:
    J-Link SDK topics are not to be discussed in public.
    If you are in valid support period for the SDK, please open a support ticket:
    segger.com/support/technical-support/

    ________________________________________________
    The *snip* function returns me data from internal storage of MCU and I can see my `SEGGER_OPEN_Read` function is not called.

    The question is:
    What is correct sequence of DLL calls to read memory back using custom flash loader?
  • Hi Sir,

    Do you mind sharing the emProject suffix file with me please?
    It's in the root of the source code of open flash loader.
    I'm not encouter JFlash loading flash algo elf failed after do the elf size optimization.
    Thank you for your kindness.
  • shawnbai wrote:

    Hi Sir,

    Do you mind sharing the emProject suffix file with me please?
    It's in the root of the source code of open flash loader.
    I'm not encouter JFlash loading flash algo elf failed after do the elf size optimization.
    Thank you for your kindness.
    Hi,

    I'm using default settings for project from wiki.segger.com/Open_Flashloader
    I don't think my problem caused by optimization or other project settings.
    The JFlash.exe application works correctly with my .elf files.
    Definitely, the problem is in incorrect sequence of DLL calls for read-back operation in my script

    The post was edited 1 time, last by stephan.razin ().

  • Hi,

    Yes, I see what you post previously.
    Actually, I'm recently working on flash loader customization, and some elf size optimization issues are encountered.
    with you mentioned you're using default settings in mind. It seems I maybe make some mistake unconsciously.

    Do you mind share your elf and map with me if you're in convenience please?
    Thank you.
  • shawnbai wrote:

    Hi,

    Yes, I see what you post previously.
    Actually, I'm recently working on flash loader customization, and some elf size optimization issues are encountered.
    with you mentioned you're using default settings in mind. It seems I maybe make some mistake unconsciously.

    Do you mind share your elf and map with me if you're in convenience please?
    Thank you.
    See the attachment
  • shawnbai wrote:

    Hi Stephan,

    I've now have made flash algo work.
    But it seems we need to erase manually in JFlash before every time programming external NorFlash.

    Do you have the same issue?

    Thank you.
    Hi,

    No, I have not faced such problem. I guess, JFlash calls `erase` or `blank check` internally before programming.

    Glad to you solve your problems, but unfortunately there is no comments from SEGGER to solve my :(
  • Hi Stephan,

    Since Segger said that for any operations, a Init() and Uninit() pair will be called.

    So for your question, do you find even an Init() is called before the SEGGER_Open_read()?


    For my question, I have already suggested that before programming external NorFlash, they need to erase manually.
  • shawnbai wrote:

    Hi Stephan,

    Since Segger said that for any operations, a Init() and Uninit() pair will be called.

    So for your question, do you find even an Init() is called before the SEGGER_Open_read()?


    For my question, I have already suggested that before programming external NorFlash, they need to erase manually.
    Hi,

    Looks like, for my case a RAM-code is not loaded at all for read operation.
  • Hi,

    shawnbai wrote:

    In my opinion, flash algo elf will be loaded when trying to connect your board by jlink.
    No, connection does not start a uploading of elf process. It should be special functions in DLL API. For programming operation it's JLINKARM_BeginDownload()/JLINKARM_EndDownload().
    I guess, for read-back operations it's other functions, or other sequence of function calls.

    shawnbai wrote:

    So I wonder with your forementioned, if jlink connected with your board successfully or not.
    Yes, jlink is connected successfully, but reads the internal memory instead of use RAM-code. Please, see my first post with all details.
  • Hi,
    Please understand that the Open Flashloader support is not given by SEGGER.
    Also it appears that J-Link SDK API was discussed in this thread, which is not allowed (please refer to your first post for more information).

    All information required for the creation of an Open Flashloader is provided here:
    wiki.segger.com/Open_Flashloader
    This is the same information we use to create our Flashloaders.

    Since SDK API was discussed in this thread we will close it to prevent further discussion about it.

    Best regards,
    Fabian
    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.