This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Stop mode issues

Hello, I'm trying to use stop mode on my MCBSTM32E eval board (MCU STM32F103ZE). I've found examples in Keil installation folders. It seems to work til I enable the Systick timer. Indeed, in this case the stop mode is ignored and the systick interrupt happens as usual without any effect. In the example, the Systick is disabled before entering stop mode and re-enable after. Why do we need to do so because in the Reference Manual (RM0008) page 52 (table10) it is said that the instruction is ignored if flags are not reset, but it is not the case here. I thought that by activating stop mode it would stop clocks and so the systick timer. Does anyone have this kind of trouble ?
Thanks in advance.

Parents Reply Children
  • Hello Gary,
    Thank you very much for the link. I've found the example. I will try and run it. Indeed, You will hear from me if there is any success!
    Thank you again!
    T.T.

  • Hello Gary,
    Unfortunately, my finding is the same as yours. As soon as I ran the code in ULINK Cortex Debugger mode, the system went strange and jumped back to normal mode. Now I cannot even down load any program. As soon as I hit the "Start/Stop Debug session", it came up with "cannot enter Debug Mode" and then "Error: Flash download failed-Target DLL has been cancelled". How did you work around it? I tried to unplug the jumpers for Boot0 and Boot1, it still has the same problem!
    Thank you for your help!
    T.T.

  • Hello Terri,
    It is good to see that I am not the only one in this case. I am still struggling to make it work. I've found that the example nearly works, look at the leds you'll see that the RTC happens. But I saw that the time in the debugger is not right, when the RTC really happens after x seconds, in the debugger it is shown a larger x seconds. I can now download my code whenever I want cause I added the command DBGMCU_Config(DBGMCU_STOP |DBGMCU_SLEEP,ENABLE) which normally allows to debug during stop or sleep. But again, the time in the debugger is not right.
    However, as my application is not like the example I tried to start from that latter, remove what I dont need and then add my functions. But by removing the EXTI line 9 it did not work anymore. So I debugged once again and I saw that the GPIO_Init does not work as I thought because just by adding line_9 on my GPIO structure, the RTC works again. I saw that it comes from the stack, as I put the line 9 in the structure, it erases some data an permits to make it work. So I'm looking for the source code of ST function although I think of re-do all my code without the ST library cause I'm sure the matter comes from that. I'm not sure that what I wrote is clear, I even pretty sure it isnt but it is hard to explain all the tests/observations I've done. I'll contact ST Team to have more information. I will let you know.
    Regards

  • Hello Terri,

    I know now what was wrong in my code. In fact, as I did not use the general EXTI line 9 I removed it from the ST example. By doing that, the structure of the EXTI line 17 was not full as two parts of it was initialize in the previous EXTI. It means that the structure has value which were in the stack before the EXTI initialization. My code now works normally.
    However, I can now say that the Keil debugger does not work well with the stop mode. Indeed, I know my code works cause once I download it into my board, I can see my leds toggle every 3seconds as I want, but if I start the debugger, it does not work anymore. I tried to find what was going wrong and I saw that the DIVL register of the RTC was weird. In fact it changes continuously which is not wishable. I hope this will help those who wants to use the debugger but I also hope that someone knows what it is possible to do in order to fix that.
    Best regards

  • I have a similar problem with STR750.
    If I enter stop mode while debugging with ULINK2, it refuses to communicate. Strangely thou, ULINK does work.

    Best regards