Commit a438bb0
stm32: Add STM32H723 520MHz support (#800)
* stm32: Add optimized stm32h7_gpio.c
Add optimized gpio functions for stm32h7 - caching the ODR register
can notably improve the performance of the gpio_out_toggle() code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* docs: Update benchmarks for stm32h7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Introduce new helper to facilitate queuing of gcode requests
* servo: Use GCodeRequestQueue to queue updates
* output_pin: Improve GCodeRequestQueue timing on duplicate requests
The GCodeRequestQueue code handles duplicate requests by detecting a
repeat of the last command. If a duplicate is found, no scheduling is
performed. However, in this case, the flush_notification() code
should continue looking for requests to schedule.
Update the GCodeRequestQueue code to use "discard" and "delay"
actions to indicate what steps the _flush_notification() callback
should take. This simplifies the code and allows for future uses.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Add send_async_request() support to GCodeRequestQueue
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Use GCodeRequestQueue to queue updates
This is similar to 7940a6a, but using gcrq.send_async_request() for
requests that could be asynchronous.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Wait full kick_start_time even if request is for full speed
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Add new min_schedule_time() and max_nominal_duration() helpers
Add a function that returns the minimum amount of time the host needs
to reserve for messages to be sent from host to micro-controller.
Add a function that returns the maximum amount of time (in seconds)
that all micro-controllers should be able to schedule future timers
at.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Use mcu.min_schedule_time() and mcu.max_nominal_duration()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pwm_cycle_time: Use mcu.min_schedule_time() and mcu.max_nominal_duration()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* led: Use mcu.min_schedule_time() and mcu.max_nominal_duration()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pwm_tool: Use mcu.min_schedule_time() and mcu.max_nominal_duration()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heaters: Confirm heater setting in mcu every 3 seconds instead of 5
Increase the confirmation rate of heater enable settings. This allows
the mcu to utilize faster internal speeds.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Decrease mcu.max_nominal_duration() to 3 seconds from 5
This allows the mcu to utilize faster internal speeds.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32h7: Always clear AHB1ENR at startup on stm32h7
* stm32: Use enable_pclock() in stm32h7 clock_setup()
* stm32: Avoid read-modify-write register updates in stm32h7 clock_setup()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Set the PLL frequency equal to CONFIG_CLOCK_FREQ on stm32h723
* stm32: Don't try to set incorrect PWR->CR3 register on stm32h7
* stm32: Enable VOS0 power mode on stm32h723 if frequency above 400Mhz
* stm32: Use CONFIG_STM32_CLOCK_REF_25M for pll_base in stm32g4.c
Update stm32g4.c to use the same Kconfig-based approach as stm32h7.c
for determining pll_base, replacing the compile-time preprocessor check.
This maintains 25MHz crystal support from Kalico #623 while using the
cleaner upstream approach from #6909.
Signed-off-by: Rogério Gonçalves <rogerlz@gmail.com>
* stm32: Use 12Mhz nominal internal clock in stm32f0_i2c.c
* stm32: Support over 400Mhz main clock in stm32h7_adc.c
* stm32: Run stm32h723 at 520Mhz
* docs: Update stm32h723 benchmarks now that it runs at 520Mhz
* MCU: Fail early if clock speed is too high to support max nominal duration (#7122)
This adds a dedicated check for that case to be able to
find the root cause of a misconfiguration earlier.
Also, replace occurrences of hardcoded max tick count.
Signed-off-by: Pascal Pieper <accounts@pascalpieper.de>
* heaters: Increase time before clearing the temperature of an inactive heater
The get_temp() code will stop reporting the last temperature of the
heater if there hasn't been any recent temperature updates. However,
on a full mcu communication loss this can cause the verify_heater code
to report a heating error prior to the mcu code reporting the
communication failure. Increase the heater timeout from 5 to 7
seconds to make it more likely the mcu failure is reported first.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heaters: Reduce next_pwm_time window
* timer_irq: Remove TIMER_IDLE_REPEAT_TICKS special case
* armcm_timer: Use a static instruction count for TIMER_MIN_TRY_TICKS
* serialqueue: Tune MIN_REQTIME_DELTA timing
* reactor: Prevent update_timer() from running a single timer multiple times
* display: Check for redraw_request_pending at end of screen_update_event()
* mcu: Fix incorrect reqclock during endstop homing
For correct operation the trsync system must be programmed prior to
the start of endstop checking. This means the desired "reqclock" for
the trsync configuration messages need to use the same "clock" that
the endstop start message uses - even though the actual deadline for
these messages is later.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 8e6e467ebc16f93ab01ed63c55d24af52b020b54)
* serialqueue: Make 31-bit clock overflow check a little more robust
Allow reqclock to be slightly less than the transmitted messages's
deadline. That is, delay messages with a reqclock far in the future
to slightly past (1<<31) ticks from its deadline. Use (3<<29)
instead, which gives an additional (1<<29) grace period to avoid clock
overflow issues.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 867d73f0b8988a8df79abb3223018132c11448ab)
* led: Generalize template evaluation so it is not dependent on LEDs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Move template evaluation code from led.py to output_pin.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Support setting a TEMPLATE on SET_PIN commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Support calling set_speed() without a print_time
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan_generic: Support setting a TEMPLATE on SET_FAN_SPEED commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan_generic: fixes missing logging import
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
* output_pin: Fix handling of template rendering errors
Make sure to assign 'value' on a rendering error to avoid an internal
error.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan_generic: Fix handling of template rendering errors
Make sure to assign 'value' on a rendering error to avoid an internal
error.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
---------
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Rogério Gonçalves <rogerlz@gmail.com>
Signed-off-by: Pascal Pieper <accounts@pascalpieper.de>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Co-authored-by: Kevin O'Connor <kevin@koconnor.net>
Co-authored-by: Pascal <accounts@pascalpieper.de>
Co-authored-by: Pedro Lamas <pedrolamas@gmail.com>1 parent b42dd20 commit a438bb0
35 files changed
Lines changed: 729 additions & 418 deletions
File tree
- docs
- klippy
- chelper
- extras
- display
- src
- avr
- generic
- stm32
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
258 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
264 | | - | |
| 262 | + | |
| 263 | + | |
265 | 264 | | |
266 | | - | |
| 265 | + | |
267 | 266 | | |
268 | | - | |
269 | | - | |
| 267 | + | |
| 268 | + | |
270 | 269 | | |
271 | 270 | | |
272 | 271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| |||
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
50 | 68 | | |
51 | 69 | | |
52 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
623 | 637 | | |
624 | 638 | | |
625 | 639 | | |
| |||
1131 | 1145 | | |
1132 | 1146 | | |
1133 | 1147 | | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1134 | 1162 | | |
1135 | 1163 | | |
1136 | 1164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
796 | | - | |
| 796 | + | |
797 | 797 | | |
798 | | - | |
| 798 | + | |
| 799 | + | |
799 | 800 | | |
800 | 801 | | |
801 | 802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
292 | 294 | | |
293 | 295 | | |
294 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
15 | | - | |
| 12 | + | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
| |||
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | | - | |
| 96 | + | |
95 | 97 | | |
96 | | - | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
104 | | - | |
105 | | - | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | | - | |
120 | | - | |
| 123 | + | |
| 124 | + | |
121 | 125 | | |
122 | | - | |
123 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | | - | |
| 135 | + | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
29 | 42 | | |
30 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
31 | 51 | | |
32 | 52 | | |
33 | 53 | | |
| |||
0 commit comments