ARM GAS /tmp/cctnTl5L.s page 1 1 .cpu cortex-m4 2 .arch armv7e-m 3 .fpu fpv4-sp-d16 4 .eabi_attribute 27, 1 5 .eabi_attribute 28, 1 6 .eabi_attribute 20, 1 7 .eabi_attribute 21, 1 8 .eabi_attribute 23, 3 9 .eabi_attribute 24, 1 10 .eabi_attribute 25, 1 11 .eabi_attribute 26, 1 12 .eabi_attribute 30, 6 13 .eabi_attribute 34, 1 14 .eabi_attribute 18, 4 15 .file "PWM_control.c" 16 .text 17 .Ltext0: 18 .cfi_sections .debug_frame 19 .file 1 "Core/Src/PWM_control.c" 20 .global powerground 21 .section .bss.powerground,"aw",%nobits 22 .align 2 25 powerground: 26 0000 00000000 .space 4 27 .global battery_cooling 28 .section .bss.battery_cooling,"aw",%nobits 29 .align 2 32 battery_cooling: 33 0000 00000000 .space 4 34 .global esc_cooling 35 .section .bss.esc_cooling,"aw",%nobits 36 .align 2 39 esc_cooling: 40 0000 00000000 .space 4 41 .section .text.PWM_control_init,"ax",%progbits 42 .align 1 43 .global PWM_control_init 44 .syntax unified 45 .thumb 46 .thumb_func 48 PWM_control_init: 49 .LFB130: 1:Core/Src/PWM_control.c **** /* 2:Core/Src/PWM_control.c **** * PWM_control.h 3:Core/Src/PWM_control.c **** * 4:Core/Src/PWM_control.c **** * Created on: 07.07.2024 5:Core/Src/PWM_control.c **** * Author: Hamza 6:Core/Src/PWM_control.c **** */ 7:Core/Src/PWM_control.c **** 8:Core/Src/PWM_control.c **** #include "PWM_control.h" 9:Core/Src/PWM_control.c **** 10:Core/Src/PWM_control.c **** //uint32_t powerground1_CCR, powerground2_CCR, battery_cooling_CCR; 11:Core/Src/PWM_control.c **** 12:Core/Src/PWM_control.c **** TIM_HandleTypeDef *powerground, *battery_cooling, *esc_cooling; 13:Core/Src/PWM_control.c **** 14:Core/Src/PWM_control.c **** /* 15:Core/Src/PWM_control.c **** Pulse width modulation mode allows for generating a signal with a frequency determined by ARM GAS /tmp/cctnTl5L.s page 2 16:Core/Src/PWM_control.c **** the value of the TIMx_ARR register and a duty cycle determined by the value of the TIMx_CCRx regi 17:Core/Src/PWM_control.c **** */ 18:Core/Src/PWM_control.c **** 19:Core/Src/PWM_control.c **** void PWM_control_init(TIM_HandleTypeDef* pg, TIM_HandleTypeDef* bat_cool, TIM_HandleTypeDef* esc_co 50 .loc 1 19 103 51 .cfi_startproc 52 @ args = 0, pretend = 0, frame = 16 53 @ frame_needed = 1, uses_anonymous_args = 0 54 0000 80B5 push {r7, lr} 55 .cfi_def_cfa_offset 8 56 .cfi_offset 7, -8 57 .cfi_offset 14, -4 58 0002 84B0 sub sp, sp, #16 59 .cfi_def_cfa_offset 24 60 0004 00AF add r7, sp, #0 61 .cfi_def_cfa_register 7 62 0006 F860 str r0, [r7, #12] 63 0008 B960 str r1, [r7, #8] 64 000a 7A60 str r2, [r7, #4] 20:Core/Src/PWM_control.c **** current_powerground_status = 0; 65 .loc 1 20 30 66 000c 144B ldr r3, .L2 67 000e 0022 movs r2, #0 68 0010 1A70 strb r2, [r3] 21:Core/Src/PWM_control.c **** target_powerground_status = 0; 69 .loc 1 21 29 70 0012 144B ldr r3, .L2+4 71 0014 0022 movs r2, #0 72 0016 1A70 strb r2, [r3] 22:Core/Src/PWM_control.c **** 23:Core/Src/PWM_control.c **** //battery_cooling_status = 0; 24:Core/Src/PWM_control.c **** 25:Core/Src/PWM_control.c **** powerground = pg; 73 .loc 1 25 15 74 0018 134A ldr r2, .L2+8 75 001a FB68 ldr r3, [r7, #12] 76 001c 1360 str r3, [r2] 26:Core/Src/PWM_control.c **** battery_cooling = bat_cool; 77 .loc 1 26 19 78 001e 134A ldr r2, .L2+12 79 0020 BB68 ldr r3, [r7, #8] 80 0022 1360 str r3, [r2] 27:Core/Src/PWM_control.c **** esc_cooling = esc_cool; 81 .loc 1 27 15 82 0024 124A ldr r2, .L2+16 83 0026 7B68 ldr r3, [r7, #4] 84 0028 1360 str r3, [r2] 28:Core/Src/PWM_control.c **** 29:Core/Src/PWM_control.c **** // htim2 CH3,4 BAT_COOLING_PWM,ENABLE 30:Core/Src/PWM_control.c **** // htim3 CH3,4 ESC_L_PWM,R_PWM 31:Core/Src/PWM_control.c **** // htim4 CH1,2,3 LED R,G,B 32:Core/Src/PWM_control.c **** // htim15 CH1,2 ESC_COOLING_ENABLE,PWM 33:Core/Src/PWM_control.c **** 34:Core/Src/PWM_control.c **** HAL_TIM_PWM_Start(powerground, TIM_CHANNEL_3); //TIM3CH3 85 .loc 1 34 3 86 002a 0F4B ldr r3, .L2+8 87 002c 1B68 ldr r3, [r3] ARM GAS /tmp/cctnTl5L.s page 3 88 002e 0821 movs r1, #8 89 0030 1846 mov r0, r3 90 0032 FFF7FEFF bl HAL_TIM_PWM_Start 35:Core/Src/PWM_control.c **** HAL_TIM_PWM_Start(powerground, TIM_CHANNEL_4); //TIM3CH4 91 .loc 1 35 3 92 0036 0C4B ldr r3, .L2+8 93 0038 1B68 ldr r3, [r3] 94 003a 0C21 movs r1, #12 95 003c 1846 mov r0, r3 96 003e FFF7FEFF bl HAL_TIM_PWM_Start 36:Core/Src/PWM_control.c **** //HAL_TIM_PWM_Start(bat_cool, TIM_CHANNEL_3); //TIM1CH3 37:Core/Src/PWM_control.c **** 38:Core/Src/PWM_control.c **** __HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_1, 0); 97 .loc 1 38 3 98 0042 094B ldr r3, .L2+8 99 0044 1B68 ldr r3, [r3] 100 0046 1B68 ldr r3, [r3] 101 0048 0022 movs r2, #0 102 004a 5A63 str r2, [r3, #52] 39:Core/Src/PWM_control.c **** __HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_2, 0); 103 .loc 1 39 3 104 004c 064B ldr r3, .L2+8 105 004e 1B68 ldr r3, [r3] 106 0050 1B68 ldr r3, [r3] 107 0052 0022 movs r2, #0 108 0054 9A63 str r2, [r3, #56] 40:Core/Src/PWM_control.c **** 41:Core/Src/PWM_control.c **** //PWM_powerground_control(0); 42:Core/Src/PWM_control.c **** //__HAL_TIM_SET_COMPARE(battery_cooling, TIM_CHANNEL_3, 2000); 43:Core/Src/PWM_control.c **** } 109 .loc 1 43 1 110 0056 00BF nop 111 0058 1037 adds r7, r7, #16 112 .cfi_def_cfa_offset 8 113 005a BD46 mov sp, r7 114 .cfi_def_cfa_register 13 115 @ sp needed 116 005c 80BD pop {r7, pc} 117 .L3: 118 005e 00BF .align 2 119 .L2: 120 0060 00000000 .word current_powerground_status 121 0064 00000000 .word target_powerground_status 122 0068 00000000 .word powerground 123 006c 00000000 .word battery_cooling 124 0070 00000000 .word esc_cooling 125 .cfi_endproc 126 .LFE130: 128 .section .text.PWM_powerground_control,"ax",%progbits 129 .align 1 130 .global PWM_powerground_control 131 .syntax unified 132 .thumb 133 .thumb_func 135 PWM_powerground_control: 136 .LFB131: 44:Core/Src/PWM_control.c **** ARM GAS /tmp/cctnTl5L.s page 4 45:Core/Src/PWM_control.c **** /* 46:Core/Src/PWM_control.c **** controls the duty cycle of the fans by setting the CCR of the channel 47:Core/Src/PWM_control.c **** 6+percent/100 = x/ARR 48:Core/Src/PWM_control.c **** DUTYCYCLE = 40000 * X/100 49:Core/Src/PWM_control.c **** */ 50:Core/Src/PWM_control.c **** void PWM_powerground_control(uint8_t percent){ 137 .loc 1 50 46 138 .cfi_startproc 139 @ args = 0, pretend = 0, frame = 16 140 @ frame_needed = 1, uses_anonymous_args = 0 141 @ link register save eliminated. 142 0000 80B4 push {r7} 143 .cfi_def_cfa_offset 4 144 .cfi_offset 7, -4 145 0002 85B0 sub sp, sp, #20 146 .cfi_def_cfa_offset 24 147 0004 00AF add r7, sp, #0 148 .cfi_def_cfa_register 7 149 0006 0346 mov r3, r0 150 0008 FB71 strb r3, [r7, #7] 51:Core/Src/PWM_control.c **** if (percent > 100){ //something went wrong 151 .loc 1 51 6 152 000a FB79 ldrb r3, [r7, #7] @ zero_extendqisi2 153 000c 642B cmp r3, #100 154 000e 11D9 bls .L5 52:Core/Src/PWM_control.c **** __HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_3, 0); 155 .loc 1 52 5 156 0010 174B ldr r3, .L7 157 0012 1B68 ldr r3, [r3] 158 0014 1B68 ldr r3, [r3] 159 0016 0022 movs r2, #0 160 0018 DA63 str r2, [r3, #60] 53:Core/Src/PWM_control.c **** __HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_4, 0); 161 .loc 1 53 5 162 001a 154B ldr r3, .L7 163 001c 1B68 ldr r3, [r3] 164 001e 1B68 ldr r3, [r3] 165 0020 0022 movs r2, #0 166 0022 1A64 str r2, [r3, #64] 54:Core/Src/PWM_control.c **** current_powerground_status = target_powerground_status = 0; 167 .loc 1 54 62 168 0024 134B ldr r3, .L7+4 169 0026 0022 movs r2, #0 170 0028 1A70 strb r2, [r3] 171 .loc 1 54 34 172 002a 124B ldr r3, .L7+4 173 002c 1A78 ldrb r2, [r3] @ zero_extendqisi2 174 002e 124B ldr r3, .L7+8 175 0030 1A70 strb r2, [r3] 55:Core/Src/PWM_control.c **** return; 176 .loc 1 55 5 177 0032 18E0 b .L4 178 .L5: 56:Core/Src/PWM_control.c **** } 57:Core/Src/PWM_control.c **** current_powerground_status = target_powerground_status = percent; 179 .loc 1 57 58 180 0034 0F4A ldr r2, .L7+4 ARM GAS /tmp/cctnTl5L.s page 5 181 0036 FB79 ldrb r3, [r7, #7] 182 0038 1370 strb r3, [r2] 183 .loc 1 57 30 184 003a 0E4B ldr r3, .L7+4 185 003c 1A78 ldrb r2, [r3] @ zero_extendqisi2 186 003e 0E4B ldr r3, .L7+8 187 0040 1A70 strb r2, [r3] 58:Core/Src/PWM_control.c **** 59:Core/Src/PWM_control.c **** int ccr = 2000 + (20 * percent); 188 .loc 1 59 24 189 0042 FA79 ldrb r2, [r7, #7] @ zero_extendqisi2 190 0044 1346 mov r3, r2 191 0046 9B00 lsls r3, r3, #2 192 0048 1344 add r3, r3, r2 193 004a 9B00 lsls r3, r3, #2 194 .loc 1 59 7 195 004c 03F5FA63 add r3, r3, #2000 196 0050 FB60 str r3, [r7, #12] 60:Core/Src/PWM_control.c **** __HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_3, ccr); 197 .loc 1 60 3 198 0052 074B ldr r3, .L7 199 0054 1B68 ldr r3, [r3] 200 0056 1B68 ldr r3, [r3] 201 0058 FA68 ldr r2, [r7, #12] 202 005a DA63 str r2, [r3, #60] 61:Core/Src/PWM_control.c **** __HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_4, ccr); 203 .loc 1 61 3 204 005c 044B ldr r3, .L7 205 005e 1B68 ldr r3, [r3] 206 0060 1B68 ldr r3, [r3] 207 0062 FA68 ldr r2, [r7, #12] 208 0064 1A64 str r2, [r3, #64] 209 .L4: 62:Core/Src/PWM_control.c **** } 210 .loc 1 62 1 211 0066 1437 adds r7, r7, #20 212 .cfi_def_cfa_offset 4 213 0068 BD46 mov sp, r7 214 .cfi_def_cfa_register 13 215 @ sp needed 216 006a 5DF8047B ldr r7, [sp], #4 217 .cfi_restore 7 218 .cfi_def_cfa_offset 0 219 006e 7047 bx lr 220 .L8: 221 .align 2 222 .L7: 223 0070 00000000 .word powerground 224 0074 00000000 .word target_powerground_status 225 0078 00000000 .word current_powerground_status 226 .cfi_endproc 227 .LFE131: 229 .section .text.PWM_powerground_softcontrol,"ax",%progbits 230 .align 1 231 .global PWM_powerground_softcontrol 232 .syntax unified 233 .thumb ARM GAS /tmp/cctnTl5L.s page 6 234 .thumb_func 236 PWM_powerground_softcontrol: 237 .LFB132: 63:Core/Src/PWM_control.c **** 64:Core/Src/PWM_control.c **** void PWM_powerground_softcontrol(){ 238 .loc 1 64 35 239 .cfi_startproc 240 @ args = 0, pretend = 0, frame = 8 241 @ frame_needed = 1, uses_anonymous_args = 0 242 @ link register save eliminated. 243 0000 80B4 push {r7} 244 .cfi_def_cfa_offset 4 245 .cfi_offset 7, -4 246 0002 83B0 sub sp, sp, #12 247 .cfi_def_cfa_offset 16 248 0004 00AF add r7, sp, #0 249 .cfi_def_cfa_register 7 65:Core/Src/PWM_control.c **** int ccr = 2000 + (20 * current_powerground_status); 250 .loc 1 65 24 251 0006 0D4B ldr r3, .L10 252 0008 1B78 ldrb r3, [r3] @ zero_extendqisi2 253 000a 1A46 mov r2, r3 254 000c 1346 mov r3, r2 255 000e 9B00 lsls r3, r3, #2 256 0010 1344 add r3, r3, r2 257 0012 9B00 lsls r3, r3, #2 258 .loc 1 65 7 259 0014 03F5FA63 add r3, r3, #2000 260 0018 7B60 str r3, [r7, #4] 66:Core/Src/PWM_control.c **** __HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_3, ccr); 261 .loc 1 66 3 262 001a 094B ldr r3, .L10+4 263 001c 1B68 ldr r3, [r3] 264 001e 1B68 ldr r3, [r3] 265 0020 7A68 ldr r2, [r7, #4] 266 0022 DA63 str r2, [r3, #60] 67:Core/Src/PWM_control.c **** __HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_4, ccr); 267 .loc 1 67 3 268 0024 064B ldr r3, .L10+4 269 0026 1B68 ldr r3, [r3] 270 0028 1B68 ldr r3, [r3] 271 002a 7A68 ldr r2, [r7, #4] 272 002c 1A64 str r2, [r3, #64] 68:Core/Src/PWM_control.c **** } 273 .loc 1 68 1 274 002e 00BF nop 275 0030 0C37 adds r7, r7, #12 276 .cfi_def_cfa_offset 4 277 0032 BD46 mov sp, r7 278 .cfi_def_cfa_register 13 279 @ sp needed 280 0034 5DF8047B ldr r7, [sp], #4 281 .cfi_restore 7 282 .cfi_def_cfa_offset 0 283 0038 7047 bx lr 284 .L11: 285 003a 00BF .align 2 ARM GAS /tmp/cctnTl5L.s page 7 286 .L10: 287 003c 00000000 .word current_powerground_status 288 0040 00000000 .word powerground 289 .cfi_endproc 290 .LFE132: 292 .section .text.PWM_battery_cooling_control,"ax",%progbits 293 .align 1 294 .global PWM_battery_cooling_control 295 .syntax unified 296 .thumb 297 .thumb_func 299 PWM_battery_cooling_control: 300 .LFB133: 69:Core/Src/PWM_control.c **** 70:Core/Src/PWM_control.c **** void PWM_battery_cooling_control(uint8_t percent){} 301 .loc 1 70 50 302 .cfi_startproc 303 @ args = 0, pretend = 0, frame = 8 304 @ frame_needed = 1, uses_anonymous_args = 0 305 @ link register save eliminated. 306 0000 80B4 push {r7} 307 .cfi_def_cfa_offset 4 308 .cfi_offset 7, -4 309 0002 83B0 sub sp, sp, #12 310 .cfi_def_cfa_offset 16 311 0004 00AF add r7, sp, #0 312 .cfi_def_cfa_register 7 313 0006 0346 mov r3, r0 314 0008 FB71 strb r3, [r7, #7] 315 .loc 1 70 51 316 000a 00BF nop 317 000c 0C37 adds r7, r7, #12 318 .cfi_def_cfa_offset 4 319 000e BD46 mov sp, r7 320 .cfi_def_cfa_register 13 321 @ sp needed 322 0010 5DF8047B ldr r7, [sp], #4 323 .cfi_restore 7 324 .cfi_def_cfa_offset 0 325 0014 7047 bx lr 326 .cfi_endproc 327 .LFE133: 329 .section .text.PWM_esc_cooling,"ax",%progbits 330 .align 1 331 .global PWM_esc_cooling 332 .syntax unified 333 .thumb 334 .thumb_func 336 PWM_esc_cooling: 337 .LFB134: 71:Core/Src/PWM_control.c **** void PWM_esc_cooling(uint8_t percent){} 338 .loc 1 71 38 339 .cfi_startproc 340 @ args = 0, pretend = 0, frame = 8 341 @ frame_needed = 1, uses_anonymous_args = 0 342 @ link register save eliminated. 343 0000 80B4 push {r7} ARM GAS /tmp/cctnTl5L.s page 8 344 .cfi_def_cfa_offset 4 345 .cfi_offset 7, -4 346 0002 83B0 sub sp, sp, #12 347 .cfi_def_cfa_offset 16 348 0004 00AF add r7, sp, #0 349 .cfi_def_cfa_register 7 350 0006 0346 mov r3, r0 351 0008 FB71 strb r3, [r7, #7] 352 .loc 1 71 39 353 000a 00BF nop 354 000c 0C37 adds r7, r7, #12 355 .cfi_def_cfa_offset 4 356 000e BD46 mov sp, r7 357 .cfi_def_cfa_register 13 358 @ sp needed 359 0010 5DF8047B ldr r7, [sp], #4 360 .cfi_restore 7 361 .cfi_def_cfa_offset 0 362 0014 7047 bx lr 363 .cfi_endproc 364 .LFE134: 366 .text 367 .Letext0: 368 .file 2 "/nix/store/p8vkamc9b2vlibs9aw76vnasdbifhcbm-gcc-arm-embedded-13.2.rel1/arm-none-eabi/incl 369 .file 3 "/nix/store/p8vkamc9b2vlibs9aw76vnasdbifhcbm-gcc-arm-embedded-13.2.rel1/arm-none-eabi/incl 370 .file 4 "Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f302xc.h" 371 .file 5 "Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h" 372 .file 6 "Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h" 373 .file 7 "Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h" 374 .file 8 "Core/Inc/PWM_control.h" ARM GAS /tmp/cctnTl5L.s page 9 DEFINED SYMBOLS *ABS*:00000000 PWM_control.c /tmp/cctnTl5L.s:25 .bss.powerground:00000000 powerground /tmp/cctnTl5L.s:22 .bss.powerground:00000000 $d /tmp/cctnTl5L.s:32 .bss.battery_cooling:00000000 battery_cooling /tmp/cctnTl5L.s:29 .bss.battery_cooling:00000000 $d /tmp/cctnTl5L.s:39 .bss.esc_cooling:00000000 esc_cooling /tmp/cctnTl5L.s:36 .bss.esc_cooling:00000000 $d /tmp/cctnTl5L.s:42 .text.PWM_control_init:00000000 $t /tmp/cctnTl5L.s:48 .text.PWM_control_init:00000000 PWM_control_init /tmp/cctnTl5L.s:120 .text.PWM_control_init:00000060 $d /tmp/cctnTl5L.s:129 .text.PWM_powerground_control:00000000 $t /tmp/cctnTl5L.s:135 .text.PWM_powerground_control:00000000 PWM_powerground_control /tmp/cctnTl5L.s:223 .text.PWM_powerground_control:00000070 $d /tmp/cctnTl5L.s:230 .text.PWM_powerground_softcontrol:00000000 $t /tmp/cctnTl5L.s:236 .text.PWM_powerground_softcontrol:00000000 PWM_powerground_softcontrol /tmp/cctnTl5L.s:287 .text.PWM_powerground_softcontrol:0000003c $d /tmp/cctnTl5L.s:293 .text.PWM_battery_cooling_control:00000000 $t /tmp/cctnTl5L.s:299 .text.PWM_battery_cooling_control:00000000 PWM_battery_cooling_control /tmp/cctnTl5L.s:330 .text.PWM_esc_cooling:00000000 $t /tmp/cctnTl5L.s:336 .text.PWM_esc_cooling:00000000 PWM_esc_cooling UNDEFINED SYMBOLS HAL_TIM_PWM_Start current_powerground_status target_powerground_status