Issue with getting interrupts for FLASH_ALGO_TYPE_CMSIS flash loader

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

    • Issue with getting interrupts for FLASH_ALGO_TYPE_CMSIS flash loader

      HW used
      J-Trace Pro
      Custom microcontroller with M33 connected to QSPI Flash

      SW used
      J-Flash

      Background
      I am working on flash loader FLM file for loading code to an external QSPI Flash.
      The chip on which FLM is loaded is custom with M33 processor.

      .*FLM + Data -> J-Flash (on PC) -> J-Trace Pro -> Custom microcontroller with M33 -> QSPI Flash

      Aim
      Use flash driver with interrupts within the FLM. The reason being that the flash driver has gone through substantial testing, and we want to keep the same code base for all the applications.

      Issue
      Interrupts invoked as part of flash loader functions are not reaching and executing interrupt handler.

      Things Tried
      1. Enabled interrupts via setting the PRIMASK as part of the Init() FLM function (Algorithm Functions).
      2. VTOR is set up with the vector table as part of Init() FLM function. Vector table is created as part of FLM. The thinking was that when an interrupt is created, the interrupt would query the vector table and jump to the correct interrupt handler. Although, the interrupt was still not executed.


      Queries
      I referenced the previous posts that are related, I have already read them. Could someone please help with the problem in hand, rather than suggesting to not use interrupts. Thank you :)

      1. What are the intricacies of setting up interrupts as part of FLM? (Currently, we are working in dark because of the Segger code setting registers, stack and calling FLM functions)
      2. Curious, how does Segger set up the stack for running the FLM? Does Segger set up the MSP?
        I am trying to figure out the relation with Segger setting up the stack and stack used for interrupt context switch and interrupt itself.



      Related Posts Read
    • I am also working on polling method of the flash driver, and I am facing an interesting issue.

      I have a global structure variable whose members are all initialised. During run-time I can see that the members of the structure variable are not initialised. Any clues why this might be happening?
    • I can see the following section in the object file:

      Source Code

      1. Relocation section '.rel.init_array' at offset 0x2f6c contains 1 entry:
      2. Offset Info Type Sym. Value Symbol's Name
      3. 00000000 00000a26 R_ARM_TARGET1 00000135 _GLOBAL__sub_I_my_driver.c

      And following is included in the linked executable file:

      Source Code

      1. 336: 0000170d 28 FUNC GLOBAL HIDDEN 1 __cpp_initialize__aeabi_
      I have checked that the compilation is happening for C, not sure why c++ constructor style static init is being included in the compilation and linking.

      This is the reason structure variable is not initialised. I am looking into why C++ code is being included :)
    • The buffer submitted as part of the FLM APIs e.g. Verify, Program, and MSP set by debugger are overlapping the R/W data of the executable.

      How is the address of buffer and MSP deduced by the debugger? Why would MSP overlapping the R/W data section?