SES Simulator - POP {pc} uses wrong stack pointer?

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

  • SES Simulator - POP {pc} uses wrong stack pointer?

    Hi.

    I'm using SES in 3.22 Version, simulated cpu is STM32F427ZG - Cortex M4F.

    What happen:

    cpu is in Handler mode - SYSTICK occured and is handled.
    Register values:
    ICSR = 0x0000000F
    PSP = 0x20000328
    MSP = 0x2002FBFC
    CONTROL[1] =SP_main
    *0x2002FBFC = 0xFFFFFFFD

    next instruction is : pop.w {pc}

    This is return to thread mode so I expect that after execute this instruction registers value should be:

    ICSR = 0x00000000
    PSP = 0x20000328
    MSP = 0x2002FC00
    CONTROL[1] =SP_process

    but i have:

    ICSR = 0x0000000F
    PSP = 0x2002FC00
    MSP = 0x2002FBFC
    CONTROL[1] =SP_process

    In conclusion : "pop" instruction get stack pointer from MSP but after incrementation value is stored into PSP.
    This is fault in simulator?
    Next question is that ICSR should not be changed to 0 after return to thread mode?

    BR
    Ryszard
  • Hello Ryszard ,

    Thank you for your inquiry.
    Sorry for the delay in response.
    Would it be possible for you to provide us with a example project where this issue is reproducible?
    Next question is that ICSR should not be changed to 0 after return to thread mode?

    That is correct and will be forwarded to our development team. Thank you for pointing that out.

    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.