Skip to main content
William chang
Associate III
March 4, 2018
Question

STM32 CUBEMX SYS Debug Settings

  • March 4, 2018
  • 2 replies
  • 5128 views
Posted on March 04, 2018 at 07:11

Here is the SYS debug settings Here is what CubeMX did. My questions is: 0690X00000609uHQAQ.png 0690X00000609oyQAA.png

I use Serial Wire and Trace Synchro Sw (4 bits) most.

Here is the SYS debug settings Here is what CubeMX did. My questions is:

Here is the SYS debug settings Here is what CubeMX did. My questions is:

In Serial Wire mode IS: INTrace Synchro Sw (4 bits)IS:

__HAL_RCC_AFIO_CLK_ENABLE();

__HAL_AFIO_REMAP_SWJ_NOJTAG();

__HAL_RCC_GPIOA_CLK_ENABLE();

In Serial Wire mode IS: INTrace Synchro Sw (4 bits)IS:

__HAL_RCC_AFIO_CLK_ENABLE();

__HAL_AFIO_REMAP_SWJ_NOJTAG();

__HAL_RCC_GPIOA_CLK_ENABLE();

__HAL_RCC_GPIOE_CLK_ENABLE();

Here is the SYS debug settings Here is what CubeMX did. My questions is:

It's necessary to do those job in main() ?

I think the right way is to set up configuration before the program is running.

0690X00000609ozQAA.png

and I right ?

Note: this post was migrated and contained many threaded conversations, some content may be missing.
    This topic has been closed for replies.

    2 replies

    Bogdan Golab
    Lead
    March 4, 2018
    Posted on March 04, 2018 at 09:09

    I wonder what is the underlying problem here. You cannot debug the app before entering the main() code?

    You shown that the app is ran from RAM - does it matter here?

    William chang
    Associate III
    March 4, 2018
    Posted on March 04, 2018 at 09:37

    It doesn't matter about run in flash or ram. it is not in the case

    I was thinking.

    Our debugger can function correctly before we run into mian().

    and we debug the first beginning place is  reset handler

    0690X00000609uWQAQ.png

    but CUBEMX initialize the debug access port  in the main() function.

    I don't understand why to do that.

    Bogdan Golab
    Lead
    March 4, 2018
    Posted on March 04, 2018 at 09:43

    I guess they initialise pins in the unified way  - the same way as the do for regular non-SWD pins.

    Right, whatever is done before main() cannot be accessed through the debugger.

    William chang
    Associate III
    March 5, 2018
    Posted on March 06, 2018 at 00:48

    0690X00000609wDQAQ.png

    uVision debugger take control of these register. I don't know why CUBEMX doing its configuration it the main(), they can just change the pin color to green and not doing anythingin the mian(). It also freeze me with my trace configuration. Please refer to my tracing with stm32 question.

    https://community.st.com/0D50X00009XkXxbSAF

    Thanks for your attention.