[SOLVED] Open Flashloader + interrupts

  • Is it possible to have interrupts in a open flashloader?
    Can jlink automagically "see" CMSIS-like interrupt handlers?
    Does jlink depend on some vector table present or can I just overwrite SCB->VTOR?

    Thank you

  • Hello,

    Thank you for your inquiry.
    Interrupts are disabled by default for open Flashloader and can't be used.
    What target device are you writing a flash loader for if I may ask?
    Usually there would be no need for interrupts in a flash loader.

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • Hi Nino,

    It's for an STM32L5xx, thank you for confirming. I would suggest adding that to the existing documentation. Another question, is there a limit on the section size? I am having to split my flash size into 1MB sections.

    Cheers,
    Daniel

  • Hi Daniel,

    Could you elaborate what you would need interrupts for? To our knowledge the L5 series do not need interrupts for operating the Flash controller.

    Another question, is there a limit on the section size?

    What exactly do you mean with section size? Size of the RAMCode? Or section size of the Flash chip?

    If you are looking to use a third party library from ST to create the Flash loader we strongly suggest not to use it as such libraries usually use code parts which are not suitable for RAMCode and usually create follow up issues.
    Our recommendation is to do all target specific inits bare metal. This will keep code size small and the flash loader efficient.

    Generally we try to add external Flash support for all new devices. The STM32L5 series is also on that list and should be officially supported in a few weeks as well.
    Until when would you need external Flash support?
    Which interface are you looking to use? OSPI, FMC? The external Flash, is it a NOR Flash?
    Should you need the flash loader quickly we also can offer to prioritize the STM32L5 series over others. In that case NREs would apply. Would that be of interest for you?

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • What exactly do you mean with section size? Size of the RAMCode? Or section size of the Flash chip?

    I mean in the FlashDevice config struct:

    C
    //
      // Flash sector layout definition
      //
      0x00100000, 0x00000000,   // 1MB
      0x00100000, 0x00100000,   // 1MB
      0x00100000, 0x00200000,   // 1MB
      0x00100000, 0x00300000,   // 1MB
      0xFFFFFFFF, 0xFFFFFFFF    // Indicates the end of the flash sector layout. Must be present.
    };

    Could you elaborate what you would need interrupts for? To our knowledge the L5 series do not need interrupts for operating the Flash controller.

    No it does not need, but I was adapting existing ST HAL code which depends on having a Systick available for the timeout function.

    Until when would you need external Flash support?

    Asap.

    Which interface are you looking to use? OSPI, FMC? The external Flash, is it a NOR Flash?

    OSPI external NOR flash.

    Should you need the flash loader quickly we also can offer to prioritize the STM32L5 series over others. In that case NREs would apply. Would that be of interest for you?

    NREs? (I am guessing cost, and in that case I cannot answer sorry).


    Thank you,
    Daniel

  • Hello,


    I mean in the FlashDevice config struct:

    In that case see here:
    https://wiki.segger.com/Open_Flashloader#SectorInfo


    No it does not need, but I was adapting existing ST HAL code which depends on having a Systick available for the timeout function.

    A timeout function should not be necessary for a standalone flash loader so we recommend not using Systick here. Also generally as stated before using the ST HAL is not recommended as this can lead to many unwanted follow up issues related to the third party library.


    NREs? (I am guessing cost, and in that case I cannot answer sorry).

    Correct, NRE = Non Recurring Engineering fee.
    Should that become an option feel free to contact our official support channel.
    For more info see my signature.


    Also the project templates found in wiki.segger.com/Open_Flashloader have 2 bugs that prevent any case sensitive OS like Linux/BSD from building it:

    Nice find. Should be fixed now.

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • Hi Nino,

    I have found another bug. JFlash (maybe JLink as well) uses the loader incorrectly. The BlankCheck function which should be a READ operation is preceded by an Init() with argument Func=1 (i.e. Erase), either the documentation is wrong or this is a bug (Func should be 3). This was tested on Windows 10 with JFlash V6.46c by pressing F2.

    Best regards,
    Daniel

    ps: UnInit is also called with Func=1

    Edited 3 times, last by tdl7rt (June 19, 2019 at 3:11 PM).

  • Hello,


    This seem to be the BlankCheck called before an Erase

    Correct. As per documentation the open flash loader implementation blank check is called in erase context which is why Init() shows Func=1.
    https://wiki.segger.com/Open_Flashload…Erase_Procedure
    BlanCheck itself is only an optional function.

    We will see if we can improve open flash loader here further in future so it is more intuitive.

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!