Access to the DWT peripheral for the `CYCCNT` register needs to happen before `main()`. The code needs to be called after the setup of the system clocks, so the right place is between the `premain()` and `main()` function of the STM32 Arduino core. This patch moves the DWT access code to a new function, which is then placed between `premain()` and `main()`.
|
|
||
78 |
|
78 |
|
79 |
|
79 |
|
80 |
|
80 |
|
81 |
|
|
|
82 |
|
|
|
83 |
|
81 |
|
84 |
|
|
|
85 |
|
|
|
|
82 |
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
86 |
|
89 |
|
87 |
|
|
|
|
90 |
|
|
|
91 |
|
|
88 |
|
92 |
|
|
93 |
|
|
|
94 |
|
|
89 |
|
95 |
|
90 |
|
96 |
|
91 |
|
97 |
|