2018-03-03 10:11 PM
Here is the SYS debug settings Here is what CubeMX did. My questions is:
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.
and I right ?
Note: this post was migrated and contained many threaded conversations, some content may be missing.2018-03-04 12:09 AM
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?
2018-03-04 01:37 AM
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
but CUBEMX initialize the debug access port in the main() function.
I don't understand why to do that.
2018-03-04 01:43 AM
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.
2018-03-04 02:04 AM
No, we can debug before main()! even though none of the clock (AFIO or GPIOA) is disabled.
Maybe all is handle by KEIL under hook.
2018-03-04 02:18 AM
Taken from F1 Reference Guide.
Bits 26:24 SWJ_CFG[2:0]: Serial wire JTAG configuration
These bits are write-only (when read, the value is undefined). They are used to configure the SWJ and trace alternate function I/Os. The SWJ (Serial Wire JTAG) supports JTAG or SWD access to the Cortex® debug port. The default state after reset is SWJ ON without trace. This allows JTAG or SW mode to be enabled by sending a specific sequence on the JTMS / JTCK pin.2018-03-04 02:47 AM
This was not the answer.
Why CUBEMX enable the GPIOA Clock and AFIO Clock. the Serial Debug can work without none to those clocks are enabled.
something under control by keil debugger. I need to dig in more
2018-03-04 10:55 AM
>
Why CUBEMX enable the GPIOA Clock and AFIO Clock. the Serial Debug can work without none to those clocks are enabled.
It enables these clocks not for debugger, but because GPIOA pins and alt. functions are needed for something else.
-- pa
2018-03-04 03:56 PM
For what?
2018-03-05 03:48 PM
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.