You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

352 lines
19 KiB
Plaintext

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

0x080015e0 in main () at Core/Src/main.c:128
128 HAL_UART_Receive_IT(&huart1, &huart1_rxc, 1);
### Assembly ########################################################################################################
0x080015d4 main+112 bl 0x8003f84 <UART_Start_Receive_IT+20>
0x080015d8 main+116 movs r4, #0
0x080015da main+118 ldr r3, [pc, #72] ; (0x8001624 <main+192>)
0x080015dc main+120 ldrb r3, [r3, #0]
0x080015de main+122 cmp r3, #0
0x080015e0 main+124 beq.n 0x80015da <main+118>
0x080015e2 main+126 ldr r3, [pc, #64] ; (0x8001624 <main+192>)
0x080015e4 main+128 movs r2, #0
0x080015e6 main+130 strb r2, [r3, #0]
0x080015e8 main+132 adds r3, r4, #1
### Breakpoints #####################################################################################################
### Expressions #####################################################################################################
### History #########################################################################################################
### Memory ##########################################################################################################
### Registers #######################################################################################################
r0 0x00000000 r5 0x20000ae8 r10 0x00000000 pc 0x080015e0 primask 0x00
r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00
r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x20000010 faultmask 0x00
r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04
r4 0x0000004f r9 0x00000000 lr 0x08002029 psp 0x00000000
### Source ##########################################################################################################
118 setPWM(&htim2, TIM_CHANNEL_2, 50);
119 setPWM(&htim2, TIM_CHANNEL_4, 25);
120
121 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1);
122 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1);
123
124 mc_init(&htim2);
125 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1);
126 HAL_TIM_Base_Start_IT(&htim6);
127
128 HAL_UART_Receive_IT(&huart1, &huart1_rxc, 1);
129 uint16_t motor_degrees = 0;
130 /* USER CODE END 2 */
131
132 /* Infinite loop */
133 /* USER CODE BEGIN WHILE */
134 while (1)
135 {
136 if (b_timer_struck)
137 {
### Stack ###########################################################################################################
[0] from 0x080015e0 in main+124 at Core/Src/main.c:128
### Threads #########################################################################################################
[1] id 0 from 0x080015e0 in main+124 at Core/Src/main.c:128
### Variables #######################################################################################################
loc motor_degrees = <optimized out>
#####################################################################################################################
Loading section .isr_vector, size 0x190 lma 0x8000000
Loading section .text, size 0xa9a8 lma 0x80001c0
Loading section .rodata, size 0x648 lma 0x800ab68
Loading section .ARM, size 0x8 lma 0x800b1b0
Loading section .init_array, size 0x8 lma 0x800b1b8
Loading section .fini_array, size 0x8 lma 0x800b1c0
Loading section .data, size 0x9a8 lma 0x800b1c8
Start address 0x08004288, load size 47936
Transfer rate: 30 KB/sec, 5326 bytes/write.
Unable to match requested speed 500 kHz, using 480 kHz
Unable to match requested speed 500 kHz, using 480 kHz
A debugging session is active.
Inferior 1 [Remote target] will be detached.
Quit anyway? (y or n) [answered Y; input not from terminal]
[Inferior 1 (Remote target) detached]
0x080015ea in HAL_TIM_PWM_MspInit (htim_pwm=0x0) at Core/Src/stm32l4xx_hal_msp.c:95
95 __HAL_RCC_TIM2_CLK_ENABLE();
### Assembly ##########################################################################################################
0x080015de HAL_TIM_PWM_MspInit+6 ldr r1, [pc, #88] ; (0x8001638 <HAL_TIM_Base_MspInit+56>)
0x080015e0 HAL_TIM_PWM_MspInit+8 mov r0, r6
0x080015e2 HAL_TIM_PWM_MspInit+10 bl 0x8004048 <HAL_RS485Ex_Init+136>
0x080015e6 HAL_TIM_PWM_MspInit+14 movs r4, #0
0x080015e8 HAL_TIM_PWM_MspInit+16 ldr r3, [pc, #80] ; (0x800163c <HAL_TIM_Base_MspInit+60>)
0x080015ea HAL_TIM_PWM_MspInit+18 ldrb r3, [r3, #0]
0x080015ec HAL_TIM_PWM_MspInit+20 cmp r3, #0
0x080015ee HAL_TIM_PWM_MspInit+22 beq.n 0x80015e8 <HAL_TIM_PWM_MspInit+16>
0x080015f0 HAL_TIM_PWM_MspInit+24 ldr r3, [pc, #72] ; (0x800163c <HAL_TIM_Base_MspInit+60>)
0x080015f2 HAL_TIM_PWM_MspInit+26 movs r2, #0
### Breakpoints #######################################################################################################
### Expressions #######################################################################################################
### History ###########################################################################################################
### Memory ############################################################################################################
### Registers #########################################################################################################
r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080015ea primask 0x00
r1 0x00000000 r6 0x20000a60 r11 0x00000000 xPSR 0x61000000 basepri 0x00
r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x20000010 faultmask 0x00
r3 0x200009c4 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04
r4 0x00000154 r9 0x00000000 lr 0x08002041 psp 0x00000000
### Source ############################################################################################################
85 * @retval None
86 */
87 void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* htim_pwm)
88 {
89 if(htim_pwm->Instance==TIM2)
90 {
91 /* USER CODE BEGIN TIM2_MspInit 0 */
92
93 /* USER CODE END TIM2_MspInit 0 */
94 /* Peripheral clock enable */
95 __HAL_RCC_TIM2_CLK_ENABLE();
96 /* USER CODE BEGIN TIM2_MspInit 1 */
97
98 /* USER CODE END TIM2_MspInit 1 */
99 }
100
101 }
102
103 /**
104 * @brief TIM_Base MSP Initialization
### Stack #############################################################################################################
[0] from 0x080015ea in HAL_TIM_PWM_MspInit+18 at Core/Src/stm32l4xx_hal_msp.c:95
[1] from 0x08002040 in HAL_TIM_PWM_Stop+72 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c:1533
[2] from 0x00000000
### Threads ###########################################################################################################
[1] id 0 from 0x080015ea in HAL_TIM_PWM_MspInit+18 at Core/Src/stm32l4xx_hal_msp.c:95
### Variables #########################################################################################################
arg htim_pwm = 0x0: {Instance = 0x20010000,Init = {Prescaler = 134234761,CounterMode = 134223429,Period = …
loc tmpreg = 0
#######################################################################################################################
Loading section .isr_vector, size 0x190 lma 0x8000000
Loading section .text, size 0x9678 lma 0x80001c0
Loading section .rodata, size 0x4d8 lma 0x8009838
Loading section .ARM, size 0x8 lma 0x8009d10
Loading section .init_array, size 0x8 lma 0x8009d18
Loading section .fini_array, size 0x8 lma 0x8009d20
Loading section .data, size 0x9a8 lma 0x8009d28
Start address 0x080042d4, load size 42656
Transfer rate: 29 KB/sec, 4739 bytes/write.
Unable to match requested speed 500 kHz, using 480 kHz
Unable to match requested speed 500 kHz, using 480 kHz
A debugging session is active.
Inferior 1 [Remote target] will be detached.
Quit anyway? (y or n) [answered Y; input not from terminal]
[Inferior 1 (Remote target) detached]
0x0800151c in main () at Core/Src/main.c:144
144 if ((pkt = p_serial_mgr_service()) != NULL)
### Assembly ##################################################################
0x0800150e main+154 movs r1, #0
0x08001510 main+156 mov r0, r4
0x08001512 main+158 bl 0x8004370 <memset>
0x08001516 main+162 bl 0x8004298 <p_serial_mgr_service>
0x0800151a main+166 mov r4, r0
0x0800151c main+168 cmp r0, #0
0x0800151e main+170 beq.n 0x8001516 <main+162>
0x08001520 main+172 ldrb r2, [r0, #1]
0x08001522 main+174 ldrb r1, [r0, #0]
0x08001524 main+176 ldr r0, [pc, #48] ; (0x8001558 <main+228>)
### Breakpoints ###############################################################
### Expressions ###############################################################
### History ###################################################################
### Memory ####################################################################
### Registers #################################################################
r0 0x00000000 r8 0x00000000 xPSR 0x61000000
r1 0x00000000 r9 0x00000000 fpscr 0x00000010
r2 0x00000000 r10 0x00000000 msp 0x2000fff0
r3 0x00000000 r11 0x00000000 psp 0x00000000
r4 0x00000000 r12 0x00001000 primask 0x00
r5 0x200009c8 sp 0x2000fff0 basepri 0x00
r6 0x00000000 lr 0x0800151b faultmask 0x00
r7 0x00000000 pc 0x0800151c control 0x04
### Source ####################################################################
134 while (1)
135 {
136 // if (b_timer_struck)
137 // {
138 // // PDEBUG("%d\n", sys_time);
139 // b_timer_struck = false;
140 // motor_degrees = (motor_degrees + 1) % 360;
141 // mc_service(motor_degrees, 50);
142 // }
143 serial_pkt_t *pkt = NULL;
144 if ((pkt = p_serial_mgr_service()) != NULL)
145 {
146 PDEBUG("Source: %02x\n"
147 "Destination: %02x\n",
148 pkt->src_addr, pkt->dest_addr);
149 PDEBUG("Frame Data: \n");
150 for (int ind = 0; ind < pkt->len; pkt++)
151 {
152 if (ind % 8 == 0)
153 {
### Stack #####################################################################
[0] from 0x0800151c in main+168 at Core/Src/main.c:144
### Threads ###################################################################
[1] id 0 from 0x0800151c in main+168 at Core/Src/main.c:144
### Variables #################################################################
loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234837,frame_data = "a\025\000\bc\0…
###############################################################################
Unable to match requested speed 500 kHz, using 480 kHz
Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080042d4 msp: 0x20010000
Loading section .isr_vector, size 0x190 lma 0x8000000
Loading section .text, size 0x9678 lma 0x80001c0
Loading section .rodata, size 0x4d8 lma 0x8009838
Loading section .ARM, size 0x8 lma 0x8009d10
Loading section .init_array, size 0x8 lma 0x8009d18
Loading section .fini_array, size 0x8 lma 0x8009d20
Loading section .data, size 0x9a8 lma 0x8009d28
Start address 0x080042d4, load size 42656
Transfer rate: 29 KB/sec, 4739 bytes/write.
Breakpoint 1 at 0x8001168: file Core/Src/main.c, line 412.
Note: automatically using hardware breakpoints for read-only addresses.
Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf
### Output/messages ###########################################################
Breakpoint 1, UART2_RxCpltCallback (huart=0x20000b14 <huart2>) at Core/Src/main.c:412
412 {
### Assembly ##################################################################
~
~
~
~
~
!0x08001168 UART2_RxCpltCallback+0 push {r4, lr}
0x0800116a UART2_RxCpltCallback+2 ldr r4, [pc, #24] ; (0x8001184 <UART2_RxCpltCallback+28>)
0x0800116c UART2_RxCpltCallback+4 movs r3, #100 ; 0x64
0x0800116e UART2_RxCpltCallback+6 movs r2, #1
0x08001170 UART2_RxCpltCallback+8 mov r1, r4
### Breakpoints ###############################################################
[1] break at 0x08001168 in Core/Src/main.c:412 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:411 hit 1 time
### Expressions ###############################################################
### History ###################################################################
### Memory ####################################################################
### Registers #################################################################
r0 0x20000b14 r8 0x00000000 xPSR 0x81000036
r1 0x00000000 r9 0x00000000 fpscr 0x00000010
r2 0x40004408 r10 0x00000000 msp 0x2000ff68
r3 0x08001169 r11 0x00000000 psp 0x00000000
r4 0x20000b14 r12 0x00001000 primask 0x00
r5 0x00000001 sp 0x2000ff68 basepri 0x00
r6 0x00000000 lr 0x0800348b faultmask 0x00
r7 0x00000000 pc 0x08001168 control 0x00
### Source ####################################################################
402 GPIO_InitStruct.Pin = m1_dir_Pin | m2_dir_Pin;
403 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
404 GPIO_InitStruct.Pull = GPIO_NOPULL;
405 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
406 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
407 }
408
409 /* USER CODE BEGIN 4 */
410
411 void UART2_RxCpltCallback(UART_HandleTypeDef *huart)
!412 {
413 HAL_UART_Transmit(&huart1, &huart2_rxc, 1, 100);
414 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1);
415 }
416 // void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
417 // {
418 // else if (huart == &huart2)
419 // {
420 // }
421 // }
### Stack #####################################################################
[0] from 0x08001168 in UART2_RxCpltCallback+0 at Core/Src/main.c:412
[1] from 0x0800348a in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430
[2] from 0x080035dc in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347
[3] from 0x08001590 in USART2_IRQHandler+8 at Core/Src/stm32l4xx_it.c:225
[4] from 0xffffffe9
[5] from 0x080042a2 in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:143
[6] from 0x0800151a in main+166 at Core/Src/main.c:144
### Threads ###################################################################
[1] id 0 from 0x08001168 in UART2_RxCpltCallback+0 at Core/Src/main.c:412
### Variables #################################################################
arg huart = 0x20000b14 <huart2>: {Instance = 0x40004400,Init = {BaudRate = 115200,WordLength = 0,StopBi…
###############################################################################
Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target
[Inferior 1 (Remote target) detached]
UART2_RxCpltCallback (huart=0x20000b14 <huart2>) at Core/Src/main.c:412
412 {
### Assembly ##################################################################
~
~
~
~
~
0x08001168 UART2_RxCpltCallback+0 push {r4, lr}
0x0800116a UART2_RxCpltCallback+2 ldr r4, [pc, #24] ; (0x8001184 <UART2_RxCpltCallback+28>)
0x0800116c UART2_RxCpltCallback+4 movs r3, #100 ; 0x64
0x0800116e UART2_RxCpltCallback+6 movs r2, #1
0x08001170 UART2_RxCpltCallback+8 mov r1, r4
### Breakpoints ###############################################################
### Expressions ###############################################################
### History ###################################################################
### Memory ####################################################################
### Registers #################################################################
r0 0x20000b14 r8 0x00000000 xPSR 0x81000036
r1 0x00000000 r9 0x00000000 fpscr 0x00000010
r2 0x40004408 r10 0x00000000 msp 0x2000ff68
r3 0x08001169 r11 0x00000000 psp 0x00000000
r4 0x20000b14 r12 0x00001000 primask 0x00
r5 0x00000001 sp 0x2000ff68 basepri 0x00
r6 0x00000000 lr 0x0800348b faultmask 0x00
r7 0x00000000 pc 0x08001168 control 0x00
### Source ####################################################################
402 GPIO_InitStruct.Pin = m1_dir_Pin | m2_dir_Pin;
403 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
404 GPIO_InitStruct.Pull = GPIO_NOPULL;
405 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
406 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
407 }
408
409 /* USER CODE BEGIN 4 */
410
411 void UART2_RxCpltCallback(UART_HandleTypeDef *huart)
412 {
413 HAL_UART_Transmit(&huart1, &huart2_rxc, 1, 100);
414 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1);
415 }
416 // void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
417 // {
418 // else if (huart == &huart2)
419 // {
420 // }
421 // }
### Stack #####################################################################
[0] from 0x08001168 in UART2_RxCpltCallback+0 at Core/Src/main.c:412
[1] from 0x0800348a in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430
[2] from 0x080035dc in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347
[3] from 0x08001590 in USART2_IRQHandler+8 at Core/Src/stm32l4xx_it.c:225
[4] from 0xffffffe9
[5] from 0x080042a2 in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:143
[6] from 0x0800151a in main+166 at Core/Src/main.c:144
### Threads ###################################################################
[1] id 0 from 0x08001168 in UART2_RxCpltCallback+0 at Core/Src/main.c:412
### Variables #################################################################
arg huart = 0x20000b14 <huart2>: {Instance = 0x40004400,Init = {BaudRate = 115200,WordLength = 0,StopBi…
###############################################################################
Loading section .isr_vector, size 0x190 lma 0x8000000
Loading section .text, size 0x9678 lma 0x80001c0
Loading section .rodata, size 0x4d8 lma 0x8009838
Loading section .ARM, size 0x8 lma 0x8009d10
Loading section .init_array, size 0x8 lma 0x8009d18
Loading section .fini_array, size 0x8 lma 0x8009d20
Loading section .data, size 0x9a8 lma 0x8009d28
Start address 0x080042d4, load size 42656
Transfer rate: 29 KB/sec, 4739 bytes/write.
Unable to match requested speed 500 kHz, using 480 kHz
Unable to match requested speed 500 kHz, using 480 kHz
A debugging session is active.
Inferior 1 [Remote target] will be detached.
Quit anyway? (y or n) [answered Y; input not from terminal]
[Inferior 1 (Remote target) detached]