[SOLVED] Ozone hanging when loading code into external flash

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

  • [SOLVED] Ozone hanging when loading code into external flash

    Hi

    I'm attempting to create an Ozone project which permits the debugging of some code that lives in an external flash bank. There is also a bootloader which runs in the internal flash of the K60.

    After some guidance on this forum, I have the process running until the bootloader hits a terminating break point. At this point, I load the elf of the external flash code, after which I anticipate having to adjust the target PC and SP accordingly.

    At the point of loading the file into external flash, Ozone hangs (LED off on JLINK and blue circle displayed after 4-5 mins). I'm wondering whether I should need to perform manual configuration of the K60's FlexBus before attempting to write to external flash (as I am doing when using JFLASH), but that's one of the functions that the bootloader is performing, so I don't think it should be necessary.

    Is there some other consideration I need to be aware of here?

    Many thanks

    David
  • Hello David,

    Thank you for your inquiry.
    How is the external Flash connected to the K60?
    The general J-Link support for the K60 series supports only the internal Flash and a parallel CFI NOR Flash:
    segger.com/downloads/supported-devices.php

    For other Flash types a Flashloader must be written using our open Flash loader interface:
    wiki.segger.com/Open_Flashloader

    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

    Thank you for your reply

    The external flash is connected via the K60's FlexBus interface. It's a Spansion/Cypress device (S29GL128S), and although not listed in your 'supported devices', we're able to read and write to it using JLINK via JFLASH (see attached). Is this likely to be the case of the issue?

    Regards
    David
    Images
    • Image 4.png

      10.81 kB, 276×455, viewed 298 times
  • Hi David,

    I assume the FlexBus init is done in that bootloader of yours? Please note that in that case J-Link essentially treats such memory areas that are added behind its back as "RAM" and all read/writes are handled completely on target side. The correct init is then completely user responsibility.
    If everything is set up correctly this will obviously work. But here it sounds like the init is not fitting to what you are looking to do.
    Please understand that we can't provide support for chip specific issues. In that case we recommend to contact the silicon vendors support.

    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

    That's correct, the FlexBus init is done in the bootloader. I don't believe we have a chip-specific issue since when we're using JFLASH, we have to add the same init steps to the *.jflash project, and that's all working fine.

    I'm unsure from your reply whether this means that, once the bootloader has finished performing the FlexBus init and I'm at the breakpoint ready to upload the code into ext. Flash, is there anything more that needs to be done within the *.jdebug script before File.Load()? i.e. Do I need to repeat the FlexBus init, or will the bootloader's prior setting of the interface registers remain valid (assuming it's been done correctly)?


    *** Update - At the bootloader end breakpoint, I find that I am seemingly able to read and modify expected values within Ext Flash (e.g using Target.ReadU32 and Target.Write32 in Ozone's 'input' window). However, when I subsequently read the flash device with JFLASH, its contents are unchanged. I feel I'm missing something obvious here...

    Your assistance is much appreciated-

    Kind regards

    David

    The post was edited 2 times, last by dnfuss ().

  • Hello David,

    Being able to download to a memory address and being able to execute code from a memory location are two completely separate things.
    So only if it works for J-Flash still does not mean you can execute or debug from that memory area.
    As said before, if everything is set up correctly you will be able to debug with Ozone.
    You could try and see if the application downloaded with J-Flash at least executes stand alone. If not the Flash does not allow execution. If it does, the questions is why the debugger is not allowed to access it during debug.

    dnfuss wrote:

    Do I need to repeat the FlexBus init, or will the bootloader's prior setting of the interface registers remain valid (assuming it's been done correctly)?
    We do not provide target specific support. Most likely a second init would not be needed, bur rather a correct one.
    For target specific questions we suggest to contact the silicon vendor or consult the targets reference manual.

    From J-Link perspective we only support the the memory areas listed in the supported devices list I linked in my first post.
    Anything other than that is user responsibility to initialize and is not supported by us.

    Please understand that we are not allowed to spend more time with this inquiry. If you run into any issues that are related to J-Link or our software and you have a J-Link that is still in valid support period (1 year after purchase), feel free to open a support inquiry as explained in my signature.

    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

    If it does, the questions is why the debugger is not allowed to access it during debug.



    This is exactly the question- Execution runs perfectly in external flash when programmed with JFLASH, so I have raised a support ticket as you suggest.

    Many thanks
    David

  • Hello David,


    Exactly, and it will most likely have nothing to do with how J-Link is implemented as we have thousands of customers running similar setups without any issues.
    As you have opened an inquiry in our support system this thread will be closed now to make sure no information is lost between separate channels.

    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.