From 4bc852b44aacc99d40708301834a92fb76a0f325 Mon Sep 17 00:00:00 2001 From: Penguin Date: Mon, 11 Apr 2022 18:59:08 -0500 Subject: [PATCH] weird behavior... message handling not working currently --- .clang-format | 2 +- .gdb_history | 126 + Core/Src/main.c | 2 + gdb.txt | 5213 +++++++++++++++++++++++++++++++++ shared/drivers/p_serial_mgr.c | 27 +- shared/drivers/p_serial_mgr.h | 6 +- shared/util/PCircularBuffer.c | 4 + 7 files changed, 5370 insertions(+), 10 deletions(-) diff --git a/.clang-format b/.clang-format index 2ca2b48..bfbb9f5 100644 --- a/.clang-format +++ b/.clang-format @@ -20,7 +20,7 @@ AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: None AllowShortLambdasOnASingleLine: All AllowShortIfStatementsOnASingleLine: Never -AllowShortLoopsOnASingleLine: true +AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false diff --git a/.gdb_history b/.gdb_history index 3fc4d99..35bd910 100644 --- a/.gdb_history +++ b/.gdb_history @@ -104,3 +104,129 @@ q b 411 r q +b 145 +r +s +n +q +b 146 +q +b 146 +b main.c:146 +r +q +b main.c:146 +r +s +del +b main.c:147 +r +q +b main.c:147 +r +b p_serial_mgr.c:43 +r +p rxc +p/c rxc +p/x rxc +c +c +n +r +p rxc +del +b p_serial_mgr.c:113 +r +b p_serial_mgr.c:68 +r +q +b p_serial_mgr.c:68 +r +p rxc +c +q +b p_serial_mgr.c:113 +r +q +q +b p_serial_mgr.c:119 +r +q +b p_serial_mgr.c:87 +r +p serial_pkt_cb.buffer[serial_pkt_cb.head] +q +b p_serial_mgr.c:87 +r +b p_serial_mgr.c:122 +r +q +q +b p_serial_mgr.c:100 if frame_index_tracker > 5 +r +b p_serial_mgr.c:100 if frame_index_tracker > 0 +r +q +b p_serial_mgr.c:79 +r +b p_serial_mgr.c:100 if frame_index_tracker > 5 +r +r +b p_serial_mgr.c:110 if frame_index_tracker > 5 +r +del +b p_serial_mgr.c:79 +r +del +b p_serial_mgr.c:86 +r +p rxc +p serial_pkt_cb.buffer[serial_pkt_cb.head] +p serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data +p/x serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data +q +b p_serial_mgr.c:86 +r +p rxc +p serial_pkt_cb.buffer[serial_pkt_cb.head] +p/x serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data +q +b p_serial_mgr.c:86 +r +p/x serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data +p/x serial_pkt_cb.buffer +p\ serial_pkt_cb.buffer +p\ serial_pkt_cb.buffer +p\serial_pkt_cb.buffer +pserial_pkt_cb.buffer +p serial_pkt_cb.buffer +p serial_pkt_cb.buffer[0] +p/x serial_pkt_cb.buffer[0] +q +b p_serial_mgr.c:44 +r +p serial_pkt_cb.head +p serial_pkt_cb.buffer[serial_pkt_cb.head] +p/x serial_pkt_cb.buffer[serial_pkt_cb.head] +p sizeof(serial_pkt_t) +q +b p_serial_mgr.c:44 +r +p sizeof(serial_pkt_t) +c +c +r +make +r +c +r +p sizeof(serial_pkt_t) +p/x serial_pkt_cb.buffer[serial_pkt_cb.head] +make +r +p/x serial_pkt_cb.buffer[serial_pkt_cb.head] +c +r +c +del +q diff --git a/Core/Src/main.c b/Core/Src/main.c index 373f872..753b5ef 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -126,6 +126,8 @@ int main(void) HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); HAL_TIM_Base_Start_IT(&htim6); + p_serial_mgr_start(); + uint16_t motor_degrees = 0; /* USER CODE END 2 */ diff --git a/gdb.txt b/gdb.txt index 1401362..ab4db24 100644 --- a/gdb.txt +++ b/gdb.txt @@ -349,3 +349,5216 @@ A debugging session is active. Quit anyway? (y or n) [answered Y; input not from terminal] [Inferior 1 (Remote target) detached] +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ +~ +~ +~ + 0x08004298 p_serial_mgr_service+0 movs r3, #0 + 0x0800429a p_serial_mgr_service+2 b.n 0x800429e + 0x0800429c p_serial_mgr_service+4 adds r3, #1 + 0x0800429e p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x80042c4 ) + 0x080042a0 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### 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 0x08004298 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x08004298 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151a in main+166 at Core/Src/main.c:144 +### Threads ################################################################### +[1] id 0 from 0x08004298 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 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] +0x080042a2 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## + 0x08004298 p_serial_mgr_service+0 movs r3, #0 + 0x0800429a p_serial_mgr_service+2 b.n 0x800429e + 0x0800429c p_serial_mgr_service+4 adds r3, #1 + 0x0800429e p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x80042c4 ) + 0x080042a0 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042a2 p_serial_mgr_service+10 cmp r2, r3 + 0x080042a4 p_serial_mgr_service+12 ble.n 0x80042be + 0x080042a6 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x80042c4 ) + 0x080042a8 p_serial_mgr_service+16 ldr r2, [r2, #0] + 0x080042aa p_serial_mgr_service+18 mov.w r1, #268 ; 0x10c +### 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 0x080042a2 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x080042a2 in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151a in main+166 at Core/Src/main.c:144 +### Threads ################################################################### +[1] id 0 from 0x080042a2 in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 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 + 0x08001516 main+162 bl 0x8004298 + 0x0800151a main+166 mov r4, r0 + 0x0800151c main+168 cmp r0, #0 + 0x0800151e main+170 beq.n 0x8001516 + 0x08001520 main+172 ldrb r2, [r0, #1] + 0x08001522 main+174 ldrb r1, [r0, #0] + 0x08001524 main+176 ldr r0, [pc, #48] ; (0x8001558 ) +### 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 0x8001520: file Core/Src/main.c, line 146. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042be in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:150 +150 return NULL; +### Assembly ################################################################## + 0x080042b2 p_serial_mgr_service+26 ldrb.w r2, [r2, #265] ; 0x109 + 0x080042b6 p_serial_mgr_service+30 cmp r2, #0 + 0x080042b8 p_serial_mgr_service+32 beq.n 0x800429c + 0x080042ba p_serial_mgr_service+34 ldr r0, [pc, #8] ; (0x80042c4 ) + 0x080042bc p_serial_mgr_service+36 bx lr + 0x080042be p_serial_mgr_service+38 movs r0, #0 + 0x080042c0 p_serial_mgr_service+40 bx lr + 0x080042c2 p_serial_mgr_service+42 nop + 0x080042c4 p_serial_mgr_service+44 asrs r4, r3, #25 + 0x080042c6 p_serial_mgr_service+46 movs r0, #0 +### Breakpoints ############################################################### +[1] break at 0x08001520 in Core/Src/main.c:146 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:145 +### 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 0x080042be control 0x04 +### Source #################################################################### + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer; + 148 } + 149 } + 150 return NULL; + 151 } + 152 + 153 void p_serial_mgr_start() + 154 { + 155 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 156 } +~ +~ +~ +### Stack ##################################################################### +[0] from 0x080042be in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:150 +[1] from 0x0800151a in main+166 at Core/Src/main.c:144 +### Threads ################################################################### +[1] id 0 from 0x080042be in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:150 +### Variables ################################################################# +############################################################################### +### Output/messages ########################################################### +halted: PC: 0x080042c0 +halted: PC: 0x0800151a +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ +~ +~ +~ + 0x08004298 p_serial_mgr_service+0 movs r3, #0 + 0x0800429a p_serial_mgr_service+2 b.n 0x800429e + 0x0800429c p_serial_mgr_service+4 adds r3, #1 + 0x0800429e p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x80042c4 ) + 0x080042a0 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ############################################################### +[1] break at 0x08001520 in Core/Src/main.c:146 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:145 +### 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 0x08004298 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x08004298 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151a in main+166 at Core/Src/main.c:144 +### Threads ################################################################### +[1] id 0 from 0x08004298 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +### Output/messages ########################################################### +halted: PC: 0x0800429a +halted: PC: 0x0800429e +halted: PC: 0x080042a0 +halted: PC: 0x080042a2 +halted: PC: 0x080042a4 +halted: PC: 0x080042be +halted: PC: 0x080042c0 +halted: PC: 0x0800151a +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +halted: PC: 0x0800151c +halted: PC: 0x0800151e +halted: PC: 0x08001516 +halted: PC: 0x08004298 +halted: PC: 0x0800151c + +Program received signal SIGINT, Interrupt. +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 + 0x08001516 main+162 bl 0x8004298 + 0x0800151a main+166 mov r4, r0 + 0x0800151c main+168 cmp r0, #0 + 0x0800151e main+170 beq.n 0x8001516 +!0x08001520 main+172 ldrb r2, [r0, #1] + 0x08001522 main+174 ldrb r1, [r0, #0] + 0x08001524 main+176 ldr r0, [pc, #48] ; (0x8001558 ) +### Breakpoints ############################################################### +[1] break at 0x08001520 in Core/Src/main.c:146 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:145 +### 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… +############################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[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 + 0x08001516 main+162 bl 0x8004298 + 0x0800151a main+166 mov r4, r0 + 0x0800151c main+168 cmp r0, #0 + 0x0800151e main+170 beq.n 0x8001516 + 0x08001520 main+172 ldrb r2, [r0, #1] + 0x08001522 main+174 ldrb r1, [r0, #0] + 0x08001524 main+176 ldr r0, [pc, #48] ; (0x8001558 ) +### 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 0x8001520: file Core/Src/main.c, line 146. +Note: automatically using hardware breakpoints for read-only addresses. +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +Reset_Handler () at startup_stm32l432xx.s:65 +65 bl SystemInit +### Assembly ################################################################## + 0x080042d4 ? ldr.w sp, [pc, #52] ; 0x800430c + 0x080042d8 ? bl 0x8004060 + 0x080042dc ? ldr r0, [pc, #48] ; (0x8004310 ) + 0x080042de ? ldr r1, [pc, #52] ; (0x8004314 ) + 0x080042e0 ? ldr r2, [pc, #52] ; (0x8004318 ) + 0x080042e2 ? movs r3, #0 + 0x080042e4 ? b.n 0x80042ec + 0x080042e6 ? ldr r4, [r2, r3] + 0x080042e8 ? str r4, [r0, r3] + 0x080042ea ? adds r3, #4 +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x00000000 r8 0x00000000 xPSR 0x01000000 + r1 0x00000000 r9 0x00000000 fpscr 0x00000000 + r2 0x00000000 r10 0x00000000 msp 0x20010000 + r3 0x00000000 r11 0x00000000 psp 0x00000000 + r4 0x00000000 r12 0x00000000 primask 0x00 + r5 0x00000000 sp 0x20010000 basepri 0x00 + r6 0x00000000 lr 0xffffffff faultmask 0x00 + r7 0x00000000 pc 0x080042d4 control 0x00 +### Source #################################################################### + 55 * @retval : None + 56 */ + 57 + 58 .section .text.Reset_Handler + 59 .weak Reset_Handler + 60 .type Reset_Handler, %function + 61 Reset_Handler: + 62 ldr sp, =_estack /* Set stack pointer */ + 63 + 64 /* Call the clock system initialization function.*/ + 65 bl SystemInit + 66 + 67 /* Copy the data segment initializers from flash to SRAM */ + 68 ldr r0, =_sdata + 69 ldr r1, =_edata + 70 ldr r2, =_sidata + 71 movs r3, #0 + 72 b LoopCopyDataInit + 73 + 74 CopyDataInit: +### Stack ##################################################################### +[0] from 0x080042d4 in Reset_Handler at startup_stm32l432xx.s:65 +### Threads ################################################################### +[1] id 0 from 0x080042d4 in Reset_Handler at startup_stm32l432xx.s:65 +### Variables ################################################################# +############################################################################### +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 0x080042d0, 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] +0x080042bc in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:150 +150 return NULL; +### Assembly ################################################################## + 0x080042ae p_serial_mgr_service+22 mla r0, r2, r3, r0 + 0x080042b2 p_serial_mgr_service+26 ldrb.w r2, [r0, #265] ; 0x109 + 0x080042b6 p_serial_mgr_service+30 cmp r2, #0 + 0x080042b8 p_serial_mgr_service+32 beq.n 0x800429c + 0x080042ba p_serial_mgr_service+34 b.n 0x80042be + 0x080042bc p_serial_mgr_service+36 movs r0, #0 + 0x080042be p_serial_mgr_service+38 bx lr + 0x080042c0 p_serial_mgr_service+40 asrs r4, r3, #25 + 0x080042c2 p_serial_mgr_service+42 movs r0, #0 +~ +### 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 0x080042bc control 0x04 +### Source #################################################################### + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 + 153 void p_serial_mgr_start() + 154 { + 155 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 156 } +~ +~ +~ +### Stack ##################################################################### +[0] from 0x080042bc in p_serial_mgr_service+36 at shared/drivers/p_serial_mgr.c:150 +[1] from 0x0800151a in main+166 at Core/Src/main.c:144 +### Threads ################################################################### +[1] id 0 from 0x080042bc in p_serial_mgr_service+36 at shared/drivers/p_serial_mgr.c:150 +### Variables ################################################################# +############################################################################### +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: 0x080042d0 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 0x080042d0, load size 42656 +Transfer rate: 29 KB/sec, 4739 bytes/write. +No line 146 in the current file. +Quit +Breakpoint 1 at 0x8001520: file Core/Src/main.c, line 146. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042a0 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ + 0x08004298 p_serial_mgr_service+0 movs r3, #0 + 0x0800429a p_serial_mgr_service+2 b.n 0x800429e + 0x0800429c p_serial_mgr_service+4 adds r3, #1 + 0x0800429e p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042c0 ) + 0x080042a0 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042a2 p_serial_mgr_service+10 cmp r2, r3 + 0x080042a4 p_serial_mgr_service+12 ble.n 0x80042bc + 0x080042a6 p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042c0 ) + 0x080042a8 p_serial_mgr_service+16 ldr r0, [r2, #0] +### Breakpoints ############################################################### +[1] break at 0x08001520 in Core/Src/main.c:146 for main.c:146 +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x00000000 r8 0x00000000 xPSR 0x61000000 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x2000165c 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 0x080042a0 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x080042a0 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151a in main+166 at Core/Src/main.c:144 +### Threads ################################################################### +[1] id 0 from 0x080042a0 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x080042a0 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ +~ + 0x0800429c p_serial_mgr_service+0 adds r3, #1 + 0x0800429e p_serial_mgr_service+2 ldr r2, [pc, #32] ; (0x80042c0 ) + 0x080042a0 p_serial_mgr_service+4 ldrh r2, [r2, #6] + 0x080042a2 p_serial_mgr_service+6 cmp r2, r3 + 0x080042a4 p_serial_mgr_service+8 ble.n 0x80042bc + 0x080042a6 p_serial_mgr_service+10 ldr r2, [pc, #24] ; (0x80042c0 ) + 0x080042a8 p_serial_mgr_service+12 ldr r0, [r2, #0] +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x00000000 r8 0x00000000 xPSR 0x61000000 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x2000165c 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 0x080042a0 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x080042a0 in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151a in main+166 at Core/Src/main.c:161 +### Threads ################################################################### +[1] id 0 from 0x080042a0 in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9690 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009850 +Loading section .ARM, size 0x8 lma 0x8009d28 +Loading section .init_array, size 0x8 lma 0x8009d30 +Loading section .fini_array, size 0x8 lma 0x8009d38 +Loading section .data, size 0x9a8 lma 0x8009d40 +Start address 0x080042ec, load size 42680 +Transfer rate: 29 KB/sec, 4742 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] +0x080042a2 in p_serial_mgr_init (huart=) at shared/drivers/p_serial_mgr.c:139 +139 } +### Assembly ################################################################## + 0x08004298 p_serial_mgr_init+20 asrs r4, r3, #25 + 0x0800429a p_serial_mgr_init+22 movs r0, #0 + 0x0800429c p_serial_mgr_init+24 movs r3, #0 + 0x0800429e p_serial_mgr_init+26 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_init+28 adds r3, #1 + 0x080042a2 p_serial_mgr_init+30 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_init+32 ldrh r2, [r2, #6] + 0x080042a6 p_serial_mgr_init+34 cmp r2, r3 + 0x080042a8 p_serial_mgr_init+36 ble.n 0x80042c0 + 0x080042aa p_serial_mgr_init+38 ldr r2, [pc, #24] ; (0x80042c4 ) +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042a2 control 0x04 +### Source #################################################################### + 129 // HAL_UART_Transmit(&huart2, &huart2_rxc, 1, 500); + 130 // HAL_UART_Receive_IT(&huart1, &huart1_rxc, 1); + 131 // HAL_GPIO_WritePin(USART1_DE_GPIO_Port, USART1_DE_Pin, 0); + 132 } + 133 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 134 { + 135 _serial_huart_inst = huart; + 136 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 137 + 138 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 139 } + 140 + 141 serial_pkt_t *p_serial_mgr_service(void) + 142 { + 143 // this will be less garbage when i switch to a queue + 144 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 145 { + 146 if (serial_pkt_cb.buffer[ind].b_ready) + 147 { + 148 return &serial_pkt_cb.buffer[ind]; +### Stack ##################################################################### +[0] from 0x080042a2 in p_serial_mgr_init+30 at shared/drivers/p_serial_mgr.c:139 +[1] from 0x200016b4 in heap_end +### Threads ################################################################### +[1] id 0 from 0x080042a2 in p_serial_mgr_init+30 at shared/drivers/p_serial_mgr.c:139 +### Variables ################################################################# +arg huart = +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96a0 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009860 +Loading section .ARM, size 0x8 lma 0x8009d40 +Loading section .init_array, size 0x8 lma 0x8009d48 +Loading section .fini_array, size 0x8 lma 0x8009d50 +Loading section .data, size 0x9a8 lma 0x8009d58 +Start address 0x080042fc, load size 42704 +Transfer rate: 29 KB/sec, 4744 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] +0x080042b2 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:145 +145 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ################################################################## + 0x080042a8 p_serial_mgr_service+12 asrs r4, r3, #25 + 0x080042aa p_serial_mgr_service+14 movs r0, #0 + 0x080042ac p_serial_mgr_service+16 movs r3, #0 + 0x080042ae p_serial_mgr_service+18 b.n 0x80042b2 + 0x080042b0 p_serial_mgr_service+20 adds r3, #1 + 0x080042b2 p_serial_mgr_service+22 ldr r2, [pc, #32] ; (0x80042d4 ) + 0x080042b4 p_serial_mgr_service+24 ldrh r2, [r2, #6] + 0x080042b6 p_serial_mgr_service+26 cmp r2, r3 + 0x080042b8 p_serial_mgr_service+28 ble.n 0x80042d0 + 0x080042ba p_serial_mgr_service+30 ldr r2, [pc, #24] ; (0x80042d4 ) +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042b2 control 0x04 +### Source #################################################################### + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 + 153 void p_serial_mgr_start() + 154 { +### Stack ##################################################################### +[0] from 0x080042b2 in p_serial_mgr_service+22 at shared/drivers/p_serial_mgr.c:145 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042b2 in p_serial_mgr_service+22 at shared/drivers/p_serial_mgr.c:145 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9690 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009850 +Loading section .ARM, size 0x8 lma 0x8009d28 +Loading section .init_array, size 0x8 lma 0x8009d30 +Loading section .fini_array, size 0x8 lma 0x8009d38 +Loading section .data, size 0x9a8 lma 0x8009d40 +Start address 0x080042ec, load size 42680 +Transfer rate: 29 KB/sec, 4742 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] +0x080042a4 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ + 0x0800429c p_serial_mgr_service+0 movs r3, #0 + 0x0800429e p_serial_mgr_service+2 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_service+4 adds r3, #1 + 0x080042a2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042a6 p_serial_mgr_service+10 cmp r2, r3 + 0x080042a8 p_serial_mgr_service+12 ble.n 0x80042c0 + 0x080042aa p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042c4 ) + 0x080042ac p_serial_mgr_service+16 ldr r0, [r2, #0] +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x00000000 r8 0x00000000 xPSR 0x61000000 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x2000165c 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042a4 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x080042a4 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042a4 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 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: 0x080042ec msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9690 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009850 +Loading section .ARM, size 0x8 lma 0x8009d28 +Loading section .init_array, size 0x8 lma 0x8009d30 +Loading section .fini_array, size 0x8 lma 0x8009d38 +Loading section .data, size 0x9a8 lma 0x8009d40 +Start address 0x080042ec, load size 42680 +Transfer rate: 29 KB/sec, 4742 bytes/write. +Breakpoint 1 at 0x800151a: file Core/Src/main.c, line 146. +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, main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ################################################################## + 0x0800150a main+150 bl 0x8004078 + 0x0800150e main+154 mov.w r2, #268 ; 0x10c + 0x08001512 main+158 movs r1, #0 + 0x08001514 main+160 mov r0, r4 + 0x08001516 main+162 bl 0x8004388 +!0x0800151a main+166 bl 0x800429c + 0x0800151e main+170 mov r4, r0 + 0x08001520 main+172 cmp r0, #0 + 0x08001522 main+174 beq.n 0x800151a + 0x08001524 main+176 ldrb r2, [r0, #1] +### Breakpoints ############################################################### +[1] break at 0x0800151a in Core/Src/main.c:146 for main.c:146 hit 1 time +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x00000000 r8 0x00000000 xPSR 0x61000000 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013800 r10 0x00000000 msp 0x2000fff0 + r3 0x40001000 r11 0x00000000 psp 0x00000000 + r4 0x20000b14 r12 0x00001000 primask 0x00 + r5 0x200009c8 sp 0x2000fff0 basepri 0x00 + r6 0x00000000 lr 0x08003fad faultmask 0x00 + r7 0x00000000 pc 0x0800151a control 0x04 +### Source #################################################################### + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; +!146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ##################################################################### +[0] from 0x0800151a in main+166 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800151a in main+166 at Core/Src/main.c:146 +### Variables ################################################################# +loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234861,frame_data = "e\025\000\bg\0… +############################################################################### +### Output/messages ########################################################### +halted: PC: 0x0800429c +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ +~ +~ +~ + 0x0800429c p_serial_mgr_service+0 movs r3, #0 + 0x0800429e p_serial_mgr_service+2 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_service+4 adds r3, #1 + 0x080042a2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ############################################################### +[1] break at 0x0800151a in Core/Src/main.c:146 for main.c:146 hit 1 time +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x00000000 r8 0x00000000 xPSR 0x61000000 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013800 r10 0x00000000 msp 0x2000fff0 + r3 0x40001000 r11 0x00000000 psp 0x00000000 + r4 0x20000b14 r12 0x00001000 primask 0x00 + r5 0x200009c8 sp 0x2000fff0 basepri 0x00 + r6 0x00000000 lr 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x0800429c control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x0800429c in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800429c in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Breakpoint 2 at 0x8001524: file Core/Src/main.c, line 148. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042a8 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## + 0x0800429e p_serial_mgr_service+2 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_service+4 adds r3, #1 + 0x080042a2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042a6 p_serial_mgr_service+10 cmp r2, r3 + 0x080042a8 p_serial_mgr_service+12 ble.n 0x80042c0 + 0x080042aa p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042c4 ) + 0x080042ac p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080042ae p_serial_mgr_service+18 mov.w r2, #268 ; 0x10c + 0x080042b2 p_serial_mgr_service+22 mla r0, r2, r3, r0 +### Breakpoints ############################################################### +[2] break at 0x08001524 in Core/Src/main.c:148 for main.c:147 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042a8 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x080042a8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042a8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x080042a8 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## + 0x0800429e p_serial_mgr_service+2 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_service+4 adds r3, #1 + 0x080042a2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042a6 p_serial_mgr_service+10 cmp r2, r3 + 0x080042a8 p_serial_mgr_service+12 ble.n 0x80042c0 + 0x080042aa p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042c4 ) + 0x080042ac p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080042ae p_serial_mgr_service+18 mov.w r2, #268 ; 0x10c + 0x080042b2 p_serial_mgr_service+22 mla r0, r2, r3, r0 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042a8 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x080042a8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042a8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9690 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009850 +Loading section .ARM, size 0x8 lma 0x8009d28 +Loading section .init_array, size 0x8 lma 0x8009d30 +Loading section .fini_array, size 0x8 lma 0x8009d38 +Loading section .data, size 0x9a8 lma 0x8009d40 +Start address 0x080042ec, load size 42680 +Transfer rate: 29 KB/sec, 4742 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] +0x080042c2 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:151 +151 } +### Assembly ################################################################## + 0x080042b6 p_serial_mgr_service+26 ldrb.w r2, [r0, #265] ; 0x109 + 0x080042ba p_serial_mgr_service+30 cmp r2, #0 + 0x080042bc p_serial_mgr_service+32 beq.n 0x80042a0 + 0x080042be p_serial_mgr_service+34 b.n 0x80042c2 + 0x080042c0 p_serial_mgr_service+36 movs r0, #0 + 0x080042c2 p_serial_mgr_service+38 bx lr + 0x080042c4 p_serial_mgr_service+40 asrs r4, r3, #25 + 0x080042c6 p_serial_mgr_service+42 movs r0, #0 +~ +~ +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042c2 control 0x04 +### Source #################################################################### + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 + 153 void p_serial_mgr_start() + 154 { + 155 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 156 } +~ +~ +~ +~ +### Stack ##################################################################### +[0] from 0x080042c2 in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:151 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042c2 in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:151 +### Variables ################################################################# +############################################################################### +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: 0x080042ec msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9690 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009850 +Loading section .ARM, size 0x8 lma 0x8009d28 +Loading section .init_array, size 0x8 lma 0x8009d30 +Loading section .fini_array, size 0x8 lma 0x8009d38 +Loading section .data, size 0x9a8 lma 0x8009d40 +Start address 0x080042ec, load size 42680 +Transfer rate: 29 KB/sec, 4742 bytes/write. +Breakpoint 1 at 0x8001524: file Core/Src/main.c, line 148. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042a6 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## + 0x0800429c p_serial_mgr_service+0 movs r3, #0 + 0x0800429e p_serial_mgr_service+2 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_service+4 adds r3, #1 + 0x080042a2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042a6 p_serial_mgr_service+10 cmp r2, r3 + 0x080042a8 p_serial_mgr_service+12 ble.n 0x80042c0 + 0x080042aa p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042c4 ) + 0x080042ac p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080042ae p_serial_mgr_service+18 mov.w r2, #268 ; 0x10c +### Breakpoints ############################################################### +[1] break at 0x08001524 in Core/Src/main.c:148 for main.c:147 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042a6 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x080042a6 in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042a6 in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Breakpoint 2 at 0x8004122: file shared/drivers/p_serial_mgr.c, line 46. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Breakpoint 2, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:46 +46 if (rxc == 0x7E) +### Assembly ################################################################## + 0x08004114 UART1_RxCpltCallback+8 bhi.w 0x8004250 + 0x08004118 UART1_RxCpltCallback+12 tbb [pc, r3] + 0x0800411c UART1_RxCpltCallback+16 lsrs r3, r0, #16 + 0x0800411e UART1_RxCpltCallback+18 str r4, [r7, #0] + 0x08004120 UART1_RxCpltCallback+20 lsls r6, r7, #1 +!0x08004122 UART1_RxCpltCallback+22 ldr r3, [pc, #312] ; (0x800425c ) + 0x08004124 UART1_RxCpltCallback+24 ldrb r3, [r3, #0] + 0x08004126 UART1_RxCpltCallback+26 cmp r3, #126 ; 0x7e + 0x08004128 UART1_RxCpltCallback+28 bne.w 0x8004242 + 0x0800412c UART1_RxCpltCallback+32 ldr r3, [pc, #296] ; (0x8004258 ) +### Breakpoints ############################################################### +[1] break at 0x08001524 in Core/Src/main.c:148 for main.c:147 +[2] break at 0x08004122 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:43 hit 1 time +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000000 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x08004122 control 0x00 +### Source #################################################################### + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { +!46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; + 52 case SS_START: + 53 { + 54 switch (start_index_tracker) + 55 { +### Stack ##################################################################### +[0] from 0x08004122 in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x08004122 in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +$1 = 126 '~' +$2 = 126 '~' +$3 = 0x7e +Continuing. +### Output/messages ########################################################### +halted: PC: 0x08004124 + +Program received signal SIGINT, Interrupt. +0x080042a2 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ + 0x0800429c p_serial_mgr_service+0 movs r3, #0 + 0x0800429e p_serial_mgr_service+2 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_service+4 adds r3, #1 + 0x080042a2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042a6 p_serial_mgr_service+10 cmp r2, r3 + 0x080042a8 p_serial_mgr_service+12 ble.n 0x80042c0 + 0x080042aa p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042c4 ) +### Breakpoints ############################################################### +[1] break at 0x08001524 in Core/Src/main.c:148 for main.c:147 +[2] break at 0x08004122 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:43 hit 1 time +### Expressions ############################################################### +### History ################################################################### +$$2 = 126 '~' +$$1 = 126 '~' +$$0 = 126 '~' +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042a2 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x080042a2 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042a2 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Continuing. +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042c0 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:150 +150 return NULL; +### Assembly ################################################################## + 0x080042b2 p_serial_mgr_service+22 mla r0, r2, r3, r0 + 0x080042b6 p_serial_mgr_service+26 ldrb.w r2, [r0, #265] ; 0x109 + 0x080042ba p_serial_mgr_service+30 cmp r2, #0 + 0x080042bc p_serial_mgr_service+32 beq.n 0x80042a0 + 0x080042be p_serial_mgr_service+34 b.n 0x80042c2 + 0x080042c0 p_serial_mgr_service+36 movs r0, #0 + 0x080042c2 p_serial_mgr_service+38 bx lr + 0x080042c4 p_serial_mgr_service+40 asrs r4, r3, #25 + 0x080042c6 p_serial_mgr_service+42 movs r0, #0 +~ +### Breakpoints ############################################################### +[1] break at 0x08001524 in Core/Src/main.c:148 for main.c:147 +[2] break at 0x08004122 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:43 hit 1 time +### Expressions ############################################################### +### History ################################################################### +$$2 = 126 '~' +$$1 = 126 '~' +$$0 = 126 '~' +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042c0 control 0x04 +### Source #################################################################### + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 + 153 void p_serial_mgr_start() + 154 { + 155 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 156 } +~ +~ +~ +### Stack ##################################################################### +[0] from 0x080042c0 in p_serial_mgr_service+36 at shared/drivers/p_serial_mgr.c:150 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042c0 in p_serial_mgr_service+36 at shared/drivers/p_serial_mgr.c:150 +### Variables ################################################################# +############################################################################### +### Output/messages ########################################################### +halted: PC: 0x080042c2 +halted: PC: 0x0800151e +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c +halted: PC: 0x08001520 +halted: PC: 0x08001522 +halted: PC: 0x0800151a +halted: PC: 0x0800429c + +Program received signal SIGINT, Interrupt. +0x0800151e in main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ################################################################## + 0x0800150e main+154 mov.w r2, #268 ; 0x10c + 0x08001512 main+158 movs r1, #0 + 0x08001514 main+160 mov r0, r4 + 0x08001516 main+162 bl 0x8004388 + 0x0800151a main+166 bl 0x800429c + 0x0800151e main+170 mov r4, r0 + 0x08001520 main+172 cmp r0, #0 + 0x08001522 main+174 beq.n 0x800151a +!0x08001524 main+176 ldrb r2, [r0, #1] + 0x08001526 main+178 ldrb r1, [r0, #0] +### Breakpoints ############################################################### +[1] break at 0x08001524 in Core/Src/main.c:148 for main.c:147 +[2] break at 0x08004122 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:43 hit 1 time +### Expressions ############################################################### +### History ################################################################### +$$2 = 126 '~' +$$1 = 126 '~' +$$0 = 126 '~' +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x0800151e control 0x04 +### Source #################################################################### + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { +!148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ##################################################################### +[0] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800151e in main+170 at Core/Src/main.c:146 +### Variables ################################################################# +loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234861,frame_data = "e\025\000\bg\0… +############################################################################### +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Breakpoint 2, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:46 +46 if (rxc == 0x7E) +### Assembly ################################################################## + 0x08004114 UART1_RxCpltCallback+8 bhi.w 0x8004250 + 0x08004118 UART1_RxCpltCallback+12 tbb [pc, r3] + 0x0800411c UART1_RxCpltCallback+16 lsrs r3, r0, #16 + 0x0800411e UART1_RxCpltCallback+18 str r4, [r7, #0] + 0x08004120 UART1_RxCpltCallback+20 lsls r6, r7, #1 +!0x08004122 UART1_RxCpltCallback+22 ldr r3, [pc, #312] ; (0x800425c ) + 0x08004124 UART1_RxCpltCallback+24 ldrb r3, [r3, #0] + 0x08004126 UART1_RxCpltCallback+26 cmp r3, #126 ; 0x7e + 0x08004128 UART1_RxCpltCallback+28 bne.w 0x8004242 + 0x0800412c UART1_RxCpltCallback+32 ldr r3, [pc, #296] ; (0x8004258 ) +### Breakpoints ############################################################### +[1] break at 0x08001524 in Core/Src/main.c:148 for main.c:147 +[2] break at 0x08004122 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:43 hit 1 time +### Expressions ############################################################### +### History ################################################################### +$$2 = 126 '~' +$$1 = 126 '~' +$$0 = 126 '~' +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000000 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x08004122 control 0x00 +### Source #################################################################### + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { +!46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; + 52 case SS_START: + 53 { + 54 switch (start_index_tracker) + 55 { +### Stack ##################################################################### +[0] from 0x08004122 in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x0800151a in main+166 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x08004122 in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +$4 = 126 '~' +Breakpoint 3 at 0x8004218: file shared/drivers/p_serial_mgr.c, line 113. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042a2 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ + 0x0800429c p_serial_mgr_service+0 movs r3, #0 + 0x0800429e p_serial_mgr_service+2 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_service+4 adds r3, #1 + 0x080042a2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042a6 p_serial_mgr_service+10 cmp r2, r3 + 0x080042a8 p_serial_mgr_service+12 ble.n 0x80042c0 + 0x080042aa p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042c4 ) +### Breakpoints ############################################################### +[3] break at 0x08004218 in shared/drivers/p_serial_mgr.c:113 for p_serial_mgr.c:113 +### Expressions ############################################################### +### History ################################################################### +$$2 = 126 '~' +$$1 = 126 '~' +$$0 = 126 '~' +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042a2 control 0x04 +### Source #################################################################### + 133 { + 134 _serial_huart_inst = huart; + 135 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 136 + 137 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 138 } + 139 + 140 serial_pkt_t *p_serial_mgr_service(void) + 141 { + 142 // this will be less garbage when i switch to a queue + 143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 144 { + 145 if (serial_pkt_cb.buffer[ind].b_ready) + 146 { + 147 return &serial_pkt_cb.buffer[ind]; + 148 } + 149 } + 150 return NULL; + 151 } + 152 +### Stack ##################################################################### +[0] from 0x080042a2 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042a2 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Breakpoint 4 at 0x8004172: file shared/drivers/p_serial_mgr.c, line 68. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042a8 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:143 +143 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## + 0x0800429e p_serial_mgr_service+2 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_service+4 adds r3, #1 + 0x080042a2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042a6 p_serial_mgr_service+10 cmp r2, r3 + 0x080042a8 p_serial_mgr_service+12 ble.n 0x80042c0 + 0x080042aa p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042c4 ) + 0x080042ac p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080042ae p_serial_mgr_service+18 mov.w r2, #268 ; 0x10c + 0x080042b2 p_serial_mgr_service+22 mla r0, r2, r3, r0 +### Breakpoints ############################################################### +[3] break at 0x08004218 in shared/drivers/p_serial_mgr.c:113 for p_serial_mgr.c:113 +[4] break at 0x08004172 in shared/drivers/p_serial_mgr.c:68 for p_serial_mgr.c:68 +### Expressions ############################################################### +### History ################################################################### +$$2 = 126 '~' +$$1 = 126 '~' +$$0 = 126 '~' +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042a8 control 0x04 +### Source #################################################################### + 133 } + 134 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 135 { + 136 _serial_huart_inst = huart; + 137 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 138 + 139 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 140 } + 141 + 142 serial_pkt_t *p_serial_mgr_service(void) + 143 { + 144 // this will be less garbage when i switch to a queue + 145 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 146 { + 147 if (serial_pkt_cb.buffer[ind].b_ready) + 148 { + 149 return &serial_pkt_cb.buffer[ind]; + 150 } + 151 } + 152 return NULL; +### Stack ##################################################################### +[0] from 0x080042a8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:143 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042a8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:143 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x080042a8 in p_serial_mgr_init (huart=) at shared/drivers/p_serial_mgr.c:140 +140 } +### Assembly ################################################################## + 0x0800429e p_serial_mgr_init+22 b.n 0x80042a2 + 0x080042a0 p_serial_mgr_init+24 adds r3, #1 + 0x080042a2 p_serial_mgr_init+26 ldr r2, [pc, #32] ; (0x80042c4 ) + 0x080042a4 p_serial_mgr_init+28 ldrh r2, [r2, #6] + 0x080042a6 p_serial_mgr_init+30 cmp r2, r3 + 0x080042a8 p_serial_mgr_init+32 ble.n 0x80042c0 + 0x080042aa p_serial_mgr_init+34 ldr r2, [pc, #24] ; (0x80042c4 ) + 0x080042ac p_serial_mgr_init+36 ldr r0, [r2, #0] + 0x080042ae p_serial_mgr_init+38 mov.w r2, #268 ; 0x10c +~ +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042a8 control 0x04 +### Source #################################################################### + 130 // HAL_UART_Transmit(&huart2, &huart2_rxc, 1, 500); + 131 // HAL_UART_Receive_IT(&huart1, &huart1_rxc, 1); + 132 // HAL_GPIO_WritePin(USART1_DE_GPIO_Port, USART1_DE_Pin, 0); + 133 } + 134 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 135 { + 136 _serial_huart_inst = huart; + 137 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 138 + 139 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 140 } + 141 + 142 serial_pkt_t *p_serial_mgr_service(void) + 143 { + 144 // this will be less garbage when i switch to a queue + 145 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 146 { + 147 if (serial_pkt_cb.buffer[ind].b_ready) + 148 { + 149 return &serial_pkt_cb.buffer[ind]; +### Stack ##################################################################### +[0] from 0x080042a8 in p_serial_mgr_init+32 at shared/drivers/p_serial_mgr.c:140 +[1] from 0x200016b4 in heap_end +### Threads ################################################################### +[1] id 0 from 0x080042a8 in p_serial_mgr_init+32 at shared/drivers/p_serial_mgr.c:140 +### Variables ################################################################# +arg huart = +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96a8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009868 +Loading section .ARM, size 0x8 lma 0x8009d40 +Loading section .init_array, size 0x8 lma 0x8009d48 +Loading section .fini_array, size 0x8 lma 0x8009d50 +Loading section .data, size 0x9a8 lma 0x8009d58 +Start address 0x08004300, load size 42704 +Transfer rate: 29 KB/sec, 4744 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] +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:145 +145 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ +~ +~ +~ + 0x080042b0 p_serial_mgr_service+0 movs r3, #0 + 0x080042b2 p_serial_mgr_service+2 b.n 0x80042b6 + 0x080042b4 p_serial_mgr_service+4 adds r3, #1 + 0x080042b6 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042d8 ) + 0x080042b8 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042b0 control 0x04 +### Source #################################################################### + 135 { + 136 _serial_huart_inst = huart; + 137 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 138 + 139 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 140 } + 141 + 142 serial_pkt_t *p_serial_mgr_service(void) + 143 { + 144 // this will be less garbage when i switch to a queue + 145 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 146 { + 147 if (serial_pkt_cb.buffer[ind].b_ready) + 148 { + 149 return &serial_pkt_cb.buffer[ind]; + 150 } + 151 } + 152 return NULL; + 153 } + 154 +### Stack ##################################################################### +[0] from 0x080042b0 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:145 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042b0 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:145 +### Variables ################################################################# +loc ind = 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: 0x08004300 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96a8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009868 +Loading section .ARM, size 0x8 lma 0x8009d40 +Loading section .init_array, size 0x8 lma 0x8009d48 +Loading section .fini_array, size 0x8 lma 0x8009d50 +Loading section .data, size 0x9a8 lma 0x8009d58 +Start address 0x08004300, load size 42704 +Transfer rate: 29 KB/sec, 4744 bytes/write. +Breakpoint 1 at 0x8004186: file shared/drivers/p_serial_mgr.c, line 70. +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, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:70 +70 serial_pkt_cb.buffer[serial_pkt_cb.head].len = rxc; +### Assembly ################################################################## + 0x0800417c UART1_RxCpltCallback+112 ldrb r3, [r2, #0] + 0x0800417e UART1_RxCpltCallback+114 adds r3, #1 + 0x08004180 UART1_RxCpltCallback+116 uxtb r3, r3 + 0x08004182 UART1_RxCpltCallback+118 strb r3, [r2, #0] + 0x08004184 UART1_RxCpltCallback+120 b.n 0x8004256 +!0x08004186 UART1_RxCpltCallback+122 ldr r2, [pc, #240] ; (0x8004278 ) + 0x08004188 UART1_RxCpltCallback+124 ldr r3, [r2, #0] + 0x0800418a UART1_RxCpltCallback+126 ldrh r2, [r2, #4] + 0x0800418c UART1_RxCpltCallback+128 mov.w r1, #268 ; 0x10c + 0x08004190 UART1_RxCpltCallback+132 mla r3, r1, r2, r3 +### Breakpoints ############################################################### +[1] break at 0x08004186 in shared/drivers/p_serial_mgr.c:70 for p_serial_mgr.c:68 hit 1 time +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x61000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000002 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x08004186 control 0x00 +### Source #################################################################### + 60 } + 61 break; + 62 case 1: + 63 { + 64 serial_pkt_cb.buffer[serial_pkt_cb.head].dest_addr = rxc; + 65 start_index_tracker++; + 66 } + 67 break; + 68 case 2: + 69 { +!70 serial_pkt_cb.buffer[serial_pkt_cb.head].len = rxc; + 71 frame_index_tracker = 0; + 72 sstate = SS_FRAME; + 73 } + 74 break; + 75 default: + 76 { + 77 // shouldnt get here + 78 for (;;) {} + 79 } +### Stack ##################################################################### +[0] from 0x08004186 in UART1_RxCpltCallback+122 at shared/drivers/p_serial_mgr.c:70 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x08004186 in UART1_RxCpltCallback+122 at shared/drivers/p_serial_mgr.c:70 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +$1 = 15 '\017' +Continuing. +### Output/messages ########################################################### +halted: PC: 0x08004188 + +Program received signal SIGINT, Interrupt. +0x0800151e in main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +Traceback (most recent call last): + File "", line 430, in on_stop + File "", line 543, in render + File "", line 1334, in lines + File "", line 1529, in fetch_asm + File "", line 224, in process + File "/usr/lib/python3.9/site-packages/pygments/__init__.py", line 82, in highlight + return format(lex(code, lexer), formatter, outfile) + File "/usr/lib/python3.9/site-packages/pygments/__init__.py", line 61, in format + formatter.format(tokens, realoutfile) + File "/usr/lib/python3.9/site-packages/pygments/formatters/terminal256.py", line 250, in format + return Formatter.format(self, tokensource, outfile) + File "/usr/lib/python3.9/site-packages/pygments/formatter.py", line 94, in format + return self.format_unencoded(tokensource, outfile) + File "/usr/lib/python3.9/site-packages/pygments/formatters/terminal256.py", line 266, in format_unencoded + for line in spl[:-1]: +KeyboardInterrupt +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x0800151e in main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ################################################################## + 0x0800150e main+154 mov.w r2, #268 ; 0x10c + 0x08001512 main+158 movs r1, #0 + 0x08001514 main+160 mov r0, r4 + 0x08001516 main+162 bl 0x800439c + 0x0800151a main+166 bl 0x80042b0 + 0x0800151e main+170 mov r4, r0 + 0x08001520 main+172 cmp r0, #0 + 0x08001522 main+174 beq.n 0x800151a + 0x08001524 main+176 ldrb r2, [r0, #1] + 0x08001526 main+178 ldrb r1, [r0, #0] +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x0800151e control 0x04 +### Source #################################################################### + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ##################################################################### +[0] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800151e in main+170 at Core/Src/main.c:146 +### Variables ################################################################# +loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234881,frame_data = "e\025\000\bg\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: 0x08004300 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96a8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009868 +Loading section .ARM, size 0x8 lma 0x8009d40 +Loading section .init_array, size 0x8 lma 0x8009d48 +Loading section .fini_array, size 0x8 lma 0x8009d50 +Loading section .data, size 0x9a8 lma 0x8009d58 +Start address 0x08004300, load size 42704 +Transfer rate: 29 KB/sec, 4744 bytes/write. +Breakpoint 1 at 0x800422c: file shared/drivers/p_serial_mgr.c, line 115. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:145 +145 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ +~ +~ +~ + 0x080042b0 p_serial_mgr_service+0 movs r3, #0 + 0x080042b2 p_serial_mgr_service+2 b.n 0x80042b6 + 0x080042b4 p_serial_mgr_service+4 adds r3, #1 + 0x080042b6 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042d8 ) + 0x080042b8 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ############################################################### +[1] break at 0x0800422c in shared/drivers/p_serial_mgr.c:115 for p_serial_mgr.c:113 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042b0 control 0x04 +### Source #################################################################### + 135 { + 136 _serial_huart_inst = huart; + 137 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 138 + 139 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 140 } + 141 + 142 serial_pkt_t *p_serial_mgr_service(void) + 143 { + 144 // this will be less garbage when i switch to a queue + 145 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 146 { + 147 if (serial_pkt_cb.buffer[ind].b_ready) + 148 { + 149 return &serial_pkt_cb.buffer[ind]; + 150 } + 151 } + 152 return NULL; + 153 } + 154 +### Stack ##################################################################### +[0] from 0x080042b0 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:145 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042b0 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:145 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Quit +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:145 +warning: Source file is more recent than executable. +145 +### Assembly ################################################################## +~ +~ +~ +~ +~ + 0x080042b0 p_serial_mgr_service+0 movs r3, #0 + 0x080042b2 p_serial_mgr_service+2 b.n 0x80042b6 + 0x080042b4 p_serial_mgr_service+4 adds r3, #1 + 0x080042b6 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042d8 ) + 0x080042b8 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042b0 control 0x04 +### Source #################################################################### + 135 // HAL_UART_Receive_IT(&huart1, &huart1_rxc, 1); + 136 // HAL_GPIO_WritePin(USART1_DE_GPIO_Port, USART1_DE_Pin, 0); + 137 } + 138 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 139 { + 140 _serial_huart_inst = huart; + 141 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 142 + 143 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 144 } + 145 + 146 serial_pkt_t *p_serial_mgr_service(void) + 147 { + 148 // this will be less garbage when i switch to a queue + 149 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 150 { + 151 if (serial_pkt_cb.buffer[ind].b_ready) + 152 { + 153 return &serial_pkt_cb.buffer[ind]; + 154 } +### Stack ##################################################################### +[0] from 0x080042b0 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:145 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042b0 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:145 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +generic_push.gdb:7: Error in sourced command file: +Canceled the download +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x08004300 in mc_init (tim=0x0) at shared/devices/motor_controller.c:10 +10 } +### Assembly ################################################################## +~ +~ +~ +~ + 0x080042fc mc_init+0 ; instruction: 0xffffffff + 0x08004300 mc_init+4 ; instruction: 0xffffffff + 0x08004304 mc_init+8 ; instruction: 0xffffffff +~ +~ +~ +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x00000000 r8 0x00000000 xPSR 0x01000000 + r1 0x00000000 r9 0x00000000 fpscr 0x00000000 + r2 0x00000000 r10 0x00000000 msp 0x20010000 + r3 0x00000000 r11 0x00000000 psp 0x00000000 + r4 0x00000000 r12 0x00000000 primask 0x00 + r5 0x00000000 sp 0x20010000 basepri 0x00 + r6 0x00000000 lr 0xffffffff faultmask 0x00 + r7 0x00000000 pc 0x08004300 control 0x00 +### Source #################################################################### +~ + 1 #include "motor_controller.h" + 2 #include "putil.h" + 3 #include "stm32l4xx_hal_tim.h" + 4 #include + 5 + 6 static TIM_HandleTypeDef *_motor_timer = NULL; + 7 void mc_init(TIM_HandleTypeDef *tim) + 8 { + 9 _motor_timer = tim; + 10 } + 11 + 12 // degrees is anything from 0-359 + 13 // speed is anything from 0-99 + 14 void mc_service(uint16_t degrees, uint8_t speed) + 15 { + 16 float right_pwm = cos(((float)degrees * (3.1415 / 180.0f))); + 17 float left_pwm = right_pwm; + 18 // PDEBUG("| DEGREES | COS | SIN | \n"); + 19 // PDEBUG("| %7d | %-5.3f | %-5.3f | \n", +### Stack ##################################################################### +[0] from 0x08004300 in mc_init+4 at shared/devices/motor_controller.c:10 +[1] from 0xfffffffe +### Threads ################################################################### +[1] id 0 from 0x08004300 in mc_init+4 at shared/devices/motor_controller.c:10 +### Variables ################################################################# +arg tim = 0x0: {Instance = 0xffffffff,Init = {Prescaler = 4294967295,CounterMode = 4294967295,Period … +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96b0 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009870 +Loading section .ARM, size 0x8 lma 0x8009d48 +Loading section .init_array, size 0x8 lma 0x8009d50 +Loading section .fini_array, size 0x8 lma 0x8009d58 +Loading section .data, size 0x9a8 lma 0x8009d60 +Start address 0x08004308, load size 42712 +Transfer rate: 29 KB/sec, 4745 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] +main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ################################################################## + 0x0800150a main+150 bl 0x8004078 + 0x0800150e main+154 mov.w r2, #268 ; 0x10c + 0x08001512 main+158 movs r1, #0 + 0x08001514 main+160 mov r0, r4 + 0x08001516 main+162 bl 0x80043a4 + 0x0800151a main+166 bl 0x80042b8 + 0x0800151e main+170 mov r4, r0 + 0x08001520 main+172 cmp r0, #0 + 0x08001522 main+174 beq.n 0x800151a + 0x08001524 main+176 ldrb r2, [r0, #1] +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x0800151a control 0x04 +### Source #################################################################### + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ##################################################################### +[0] from 0x0800151a in main+166 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800151a in main+166 at Core/Src/main.c:146 +### Variables ################################################################# +loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234889,frame_data = "e\025\000\bg\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: 0x08004308 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96b0 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009870 +Loading section .ARM, size 0x8 lma 0x8009d48 +Loading section .init_array, size 0x8 lma 0x8009d50 +Loading section .fini_array, size 0x8 lma 0x8009d58 +Loading section .data, size 0x9a8 lma 0x8009d60 +Start address 0x08004308, load size 42712 +Transfer rate: 29 KB/sec, 4745 bytes/write. +Breakpoint 1 at 0x8004234: file shared/drivers/p_serial_mgr.c, line 119. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042c2 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:149 +149 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## + 0x080042b8 p_serial_mgr_service+0 movs r3, #0 + 0x080042ba p_serial_mgr_service+2 b.n 0x80042be + 0x080042bc p_serial_mgr_service+4 adds r3, #1 + 0x080042be p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042e0 ) + 0x080042c0 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042c2 p_serial_mgr_service+10 cmp r2, r3 + 0x080042c4 p_serial_mgr_service+12 ble.n 0x80042dc + 0x080042c6 p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042e0 ) + 0x080042c8 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080042ca p_serial_mgr_service+18 mov.w r2, #268 ; 0x10c +### Breakpoints ############################################################### +[1] break at 0x08004234 in shared/drivers/p_serial_mgr.c:119 for p_serial_mgr.c:119 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042c2 control 0x04 +### Source #################################################################### + 139 { + 140 _serial_huart_inst = huart; + 141 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 142 + 143 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 144 } + 145 + 146 serial_pkt_t *p_serial_mgr_service(void) + 147 { + 148 // this will be less garbage when i switch to a queue + 149 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 150 { + 151 if (serial_pkt_cb.buffer[ind].b_ready) + 152 { + 153 return &serial_pkt_cb.buffer[ind]; + 154 } + 155 } + 156 return NULL; + 157 } + 158 +### Stack ##################################################################### +[0] from 0x080042c2 in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:149 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042c2 in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:149 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Quit +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x080042c2 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:150 +150 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ + 0x080042bc p_serial_mgr_service+0 adds r3, #1 + 0x080042be p_serial_mgr_service+2 ldr r2, [pc, #32] ; (0x80042e0 ) + 0x080042c0 p_serial_mgr_service+4 ldrh r2, [r2, #6] + 0x080042c2 p_serial_mgr_service+6 cmp r2, r3 + 0x080042c4 p_serial_mgr_service+8 ble.n 0x80042dc + 0x080042c6 p_serial_mgr_service+10 ldr r2, [pc, #24] ; (0x80042e0 ) + 0x080042c8 p_serial_mgr_service+12 ldr r0, [r2, #0] + 0x080042ca p_serial_mgr_service+14 mov.w r2, #268 ; 0x10c +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042c2 control 0x04 +### Source #################################################################### + 140 { + 141 _serial_huart_inst = huart; + 142 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 143 + 144 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 145 } + 146 + 147 serial_pkt_t *p_serial_mgr_service(void) + 148 { + 149 // this will be less garbage when i switch to a queue + 150 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 151 { + 152 if (serial_pkt_cb.buffer[ind].b_ready) + 153 { + 154 return &serial_pkt_cb.buffer[ind]; + 155 } + 156 } + 157 return NULL; + 158 } + 159 +### Stack ##################################################################### +[0] from 0x080042c2 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:150 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042c2 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:150 +### Variables ################################################################# +loc ind = 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: 0x08004308 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96b0 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009870 +Loading section .ARM, size 0x8 lma 0x8009d48 +Loading section .init_array, size 0x8 lma 0x8009d50 +Loading section .fini_array, size 0x8 lma 0x8009d58 +Loading section .data, size 0x9a8 lma 0x8009d60 +Start address 0x0800430c, load size 42712 +Transfer rate: 29 KB/sec, 4745 bytes/write. +Breakpoint 1 at 0x80041e8: file shared/drivers/p_serial_mgr.c, line 87. +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, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:87 +87 asm volatile("nop"); +### Assembly ################################################################## + 0x080041de UART1_RxCpltCallback+210 bne.n 0x8004262 + 0x080041e0 UART1_RxCpltCallback+212 ldr r3, [pc, #148] ; (0x8004278 ) + 0x080041e2 UART1_RxCpltCallback+214 movs r2, #4 + 0x080041e4 UART1_RxCpltCallback+216 strb r2, [r3, #0] + 0x080041e6 UART1_RxCpltCallback+218 b.n 0x8004262 +!0x080041e8 UART1_RxCpltCallback+220 nop + 0x080041ea UART1_RxCpltCallback+222 b.n 0x8004262 + 0x080041ec UART1_RxCpltCallback+224 ldr r3, [pc, #136] ; (0x8004278 ) + 0x080041ee UART1_RxCpltCallback+226 movs r2, #3 + 0x080041f0 UART1_RxCpltCallback+228 strb r2, [r3, #0] +### Breakpoints ############################################################### +[1] break at 0x080041e8 in shared/drivers/p_serial_mgr.c:87 for p_serial_mgr.c:87 hit 1 time +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x61000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x0000007e r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x080041e8 control 0x00 +### Source #################################################################### + 77 // shouldnt get here + 78 for (;;) {} + 79 } + 80 }; + 81 } + 82 break; + 83 case SS_FRAME: + 84 { + 85 if (rxc == 0x7E) + 86 { +!87 asm volatile("nop"); + 88 // error occured. bail + 89 #pragma message(Reminder "add a safe escape routine for this") + 90 } + 91 else if (rxc == 0x7D) + 92 { + 93 sstate = SS_ESC; + 94 } + 95 else + 96 { +### Stack ##################################################################### +[0] from 0x080041e8 in UART1_RxCpltCallback+220 at shared/drivers/p_serial_mgr.c:87 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x080042e0 in p_serial_mgr_service+36 at shared/drivers/p_serial_mgr.c:157 +[6] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080041e8 in UART1_RxCpltCallback+220 at shared/drivers/p_serial_mgr.c:87 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +$1 = { + src_addr = 0 '\000', + dest_addr = 0 '\000', + len = 134234893, + frame_data = "e\025\000\bg\025\000\bi\025\000\bk\025\000\bm\025\000\b", '\000' , "o\025\000\bq\025\000\b\000\000\000\000s\025\000\bu\025\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b]C\000\b\000\000\000\000\000\000\000\000]C\000\b]C\000\b\000\000\000\000\000\000\000\000]C\000\b"..., + checksum = 0 '\000', + b_ready = false +} +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:87 +87 asm volatile("nop"); +### Assembly ################################################################## + 0x080041de UART1_RxCpltCallback+210 bne.n 0x8004262 + 0x080041e0 UART1_RxCpltCallback+212 ldr r3, [pc, #148] ; (0x8004278 ) + 0x080041e2 UART1_RxCpltCallback+214 movs r2, #4 + 0x080041e4 UART1_RxCpltCallback+216 strb r2, [r3, #0] + 0x080041e6 UART1_RxCpltCallback+218 b.n 0x8004262 + 0x080041e8 UART1_RxCpltCallback+220 nop + 0x080041ea UART1_RxCpltCallback+222 b.n 0x8004262 + 0x080041ec UART1_RxCpltCallback+224 ldr r3, [pc, #136] ; (0x8004278 ) + 0x080041ee UART1_RxCpltCallback+226 movs r2, #3 + 0x080041f0 UART1_RxCpltCallback+228 strb r2, [r3, #0] +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x61000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x0000007e r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x080041e8 control 0x00 +### Source #################################################################### + 77 // shouldnt get here + 78 for (;;) {} + 79 } + 80 }; + 81 } + 82 break; + 83 case SS_FRAME: + 84 { + 85 if (rxc == 0x7E) + 86 { + 87 asm volatile("nop"); + 88 // error occured. bail + 89 #pragma message(Reminder "add a safe escape routine for this") + 90 sstate = SS_START; + 91 } + 92 else if (rxc == 0x7D) + 93 { + 94 sstate = SS_ESC; + 95 } + 96 else +### Stack ##################################################################### +[0] from 0x080041e8 in UART1_RxCpltCallback+220 at shared/drivers/p_serial_mgr.c:87 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x080042e0 in p_serial_mgr_service+28 at shared/drivers/p_serial_mgr.c:153 +[6] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080041e8 in UART1_RxCpltCallback+220 at shared/drivers/p_serial_mgr.c:87 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96b8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009878 +Loading section .ARM, size 0x8 lma 0x8009d50 +Loading section .init_array, size 0x8 lma 0x8009d58 +Loading section .fini_array, size 0x8 lma 0x8009d60 +Loading section .data, size 0x9a8 lma 0x8009d68 +Start address 0x08004314, load size 42720 +Transfer rate: 29 KB/sec, 4746 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] +0x080042c6 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:151 +151 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ +~ +~ + 0x080042c4 p_serial_mgr_service+0 movs r3, #0 + 0x080042c6 p_serial_mgr_service+2 b.n 0x80042ca + 0x080042c8 p_serial_mgr_service+4 adds r3, #1 + 0x080042ca p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042ec ) + 0x080042cc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042ce p_serial_mgr_service+10 cmp r2, r3 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042c6 control 0x04 +### Source #################################################################### + 141 { + 142 _serial_huart_inst = huart; + 143 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 144 + 145 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 146 } + 147 + 148 serial_pkt_t *p_serial_mgr_service(void) + 149 { + 150 // this will be less garbage when i switch to a queue + 151 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 152 { + 153 if (serial_pkt_cb.buffer[ind].b_ready) + 154 { + 155 return &serial_pkt_cb.buffer[ind]; + 156 } + 157 } + 158 return NULL; + 159 } + 160 +### Stack ##################################################################### +[0] from 0x080042c6 in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:151 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042c6 in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:151 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96b8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009878 +Loading section .ARM, size 0x8 lma 0x8009d50 +Loading section .init_array, size 0x8 lma 0x8009d58 +Loading section .fini_array, size 0x8 lma 0x8009d60 +Loading section .data, size 0x9a8 lma 0x8009d68 +Start address 0x08004314, load size 42720 +Transfer rate: 29 KB/sec, 4746 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] +0x08001b12 in HAL_TIM_IRQHandler (htim=0x20000a14 ) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c:3978 +3978 if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK2) != RESET) +### Assembly ################################################################## + 0x08001b06 HAL_TIM_IRQHandler+222 ldr r2, [r3, #12] + 0x08001b08 HAL_TIM_IRQHandler+224 tst.w r2, #128 ; 0x80 + 0x08001b0c HAL_TIM_IRQHandler+228 bne.n 0x8001b8a + 0x08001b0e HAL_TIM_IRQHandler+230 ldr r3, [r4, #0] + 0x08001b10 HAL_TIM_IRQHandler+232 ldr r2, [r3, #16] + 0x08001b12 HAL_TIM_IRQHandler+234 tst.w r2, #256 ; 0x100 + 0x08001b16 HAL_TIM_IRQHandler+238 beq.n 0x8001b20 + 0x08001b18 HAL_TIM_IRQHandler+240 ldr r2, [r3, #12] + 0x08001b1a HAL_TIM_IRQHandler+242 tst.w r2, #128 ; 0x80 + 0x08001b1e HAL_TIM_IRQHandler+246 bne.n 0x8001b98 +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a14 r8 0x00000000 xPSR 0x41000046 + r1 0x000000fa r9 0x00000000 fpscr 0x00000010 + r2 0x00000000 r10 0x00000000 msp 0x2000ff78 + r3 0x40001000 r11 0x00000000 psp 0x00000000 + r4 0x20000a14 r12 0x00001000 primask 0x00 + r5 0x200009c8 sp 0x2000ff78 basepri 0x00 + r6 0x00000000 lr 0x08001b89 faultmask 0x00 + r7 0x00000000 pc 0x08001b12 control 0x00 +### Source #################################################################### + 3968 { + 3969 __HAL_TIM_CLEAR_IT(htim, TIM_IT_BREAK); + 3970 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + 3971 htim->BreakCallback(htim); + 3972 #else + 3973 HAL_TIMEx_BreakCallback(htim); + 3974 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + 3975 } + 3976 } + 3977 /* TIM Break2 input event */ + 3978 if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK2) != RESET) + 3979 { + 3980 if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_BREAK) != RESET) + 3981 { + 3982 __HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_BREAK2); + 3983 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + 3984 htim->Break2Callback(htim); + 3985 #else + 3986 HAL_TIMEx_Break2Callback(htim); + 3987 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +### Stack ##################################################################### +[0] from 0x08001b12 in HAL_TIM_IRQHandler+234 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c:3978 +[1] from 0x080015a4 in TIM6_DAC_IRQHandler+8 at Core/Src/stm32l4xx_it.c:239 +[2] from 0xffffffe9 +[3] from 0x080042cc in p_serial_mgr_init+32 at shared/drivers/p_serial_mgr.c:147 +[4] from 0x200016b4 in heap_end +### Threads ################################################################### +[1] id 0 from 0x08001b12 in HAL_TIM_IRQHandler+234 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c:3978 +### Variables ################################################################# +arg htim = 0x20000a14 : {Instance = 0x40001000,Init = {Prescaler = 127,CounterMode = 0,Period =… +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96c8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009888 +Loading section .ARM, size 0x8 lma 0x8009d60 +Loading section .init_array, size 0x8 lma 0x8009d68 +Loading section .fini_array, size 0x8 lma 0x8009d70 +Loading section .data, size 0x9a8 lma 0x8009d78 +Start address 0x08004324, load size 42736 +Transfer rate: 29 KB/sec, 4748 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] +0x0800151e in main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ################################################################## + 0x0800150e main+154 mov.w r2, #268 ; 0x10c + 0x08001512 main+158 movs r1, #0 + 0x08001514 main+160 mov r0, r4 + 0x08001516 main+162 bl 0x80043c0 + 0x0800151a main+166 bl 0x80042d4 + 0x0800151e main+170 mov r4, r0 + 0x08001520 main+172 cmp r0, #0 + 0x08001522 main+174 beq.n 0x800151a + 0x08001524 main+176 ldrb r2, [r0, #1] + 0x08001526 main+178 ldrb r1, [r0, #0] +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x0800151e control 0x04 +### Source #################################################################### + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ##################################################################### +[0] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800151e in main+170 at Core/Src/main.c:146 +### Variables ################################################################# +loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234917,frame_data = "e\025\000\bg\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: 0x08004324 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96c8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009888 +Loading section .ARM, size 0x8 lma 0x8009d60 +Loading section .init_array, size 0x8 lma 0x8009d68 +Loading section .fini_array, size 0x8 lma 0x8009d70 +Loading section .data, size 0x9a8 lma 0x8009d78 +Start address 0x08004324, load size 42736 +Transfer rate: 29 KB/sec, 4748 bytes/write. +Breakpoint 1 at 0x80041e8: file shared/drivers/p_serial_mgr.c, line 87. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:152 +152 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ +~ +~ +~ + 0x080042d4 p_serial_mgr_service+0 movs r3, #0 + 0x080042d6 p_serial_mgr_service+2 b.n 0x80042da + 0x080042d8 p_serial_mgr_service+4 adds r3, #1 + 0x080042da p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042fc ) + 0x080042dc p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ############################################################### +[1] break at 0x080041e8 in shared/drivers/p_serial_mgr.c:87 for p_serial_mgr.c:87 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042d4 control 0x04 +### Source #################################################################### + 142 { + 143 _serial_huart_inst = huart; + 144 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 145 + 146 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 147 } + 148 + 149 serial_pkt_t *p_serial_mgr_service(void) + 150 { + 151 // this will be less garbage when i switch to a queue + 152 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 153 { + 154 if (serial_pkt_cb.buffer[ind].b_ready) + 155 { + 156 return &serial_pkt_cb.buffer[ind]; + 157 } + 158 } + 159 return NULL; + 160 } + 161 +### Stack ##################################################################### +[0] from 0x080042d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:152 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:152 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Breakpoint 2 at 0x8004250: file shared/drivers/p_serial_mgr.c, line 122. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042da in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:152 +152 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ + 0x080042d4 p_serial_mgr_service+0 movs r3, #0 + 0x080042d6 p_serial_mgr_service+2 b.n 0x80042da + 0x080042d8 p_serial_mgr_service+4 adds r3, #1 + 0x080042da p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042fc ) + 0x080042dc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042de p_serial_mgr_service+10 cmp r2, r3 + 0x080042e0 p_serial_mgr_service+12 ble.n 0x80042f8 + 0x080042e2 p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042fc ) +### Breakpoints ############################################################### +[1] break at 0x080041e8 in shared/drivers/p_serial_mgr.c:87 for p_serial_mgr.c:87 +[2] break at 0x08004250 in shared/drivers/p_serial_mgr.c:122 for p_serial_mgr.c:122 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042da control 0x04 +### Source #################################################################### + 142 { + 143 _serial_huart_inst = huart; + 144 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 145 + 146 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 147 } + 148 + 149 serial_pkt_t *p_serial_mgr_service(void) + 150 { + 151 // this will be less garbage when i switch to a queue + 152 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 153 { + 154 if (serial_pkt_cb.buffer[ind].b_ready) + 155 { + 156 return &serial_pkt_cb.buffer[ind]; + 157 } + 158 } + 159 return NULL; + 160 } + 161 +### Stack ##################################################################### +[0] from 0x080042da in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:152 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042da in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:152 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Quit +Quit +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x080042da in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:152 +warning: Source file is more recent than executable. +152 // this will be less garbage when i switch to a queue +### Assembly ################################################################## +~ +~ + 0x080042d4 p_serial_mgr_service+0 movs r3, #0 + 0x080042d6 p_serial_mgr_service+2 b.n 0x80042da + 0x080042d8 p_serial_mgr_service+4 adds r3, #1 + 0x080042da p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x80042fc ) + 0x080042dc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042de p_serial_mgr_service+10 cmp r2, r3 + 0x080042e0 p_serial_mgr_service+12 ble.n 0x80042f8 + 0x080042e2 p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x80042fc ) +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042da control 0x04 +### Source #################################################################### + 142 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 143 { + 144 _serial_huart_inst = huart; + 145 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 146 + 147 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 148 } + 149 + 150 serial_pkt_t *p_serial_mgr_service(void) + 151 { + 152 // this will be less garbage when i switch to a queue + 153 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 154 { + 155 if (serial_pkt_cb.buffer[ind].b_ready) + 156 { + 157 return &serial_pkt_cb.buffer[ind]; + 158 } + 159 } + 160 return NULL; + 161 } +### Stack ##################################################################### +[0] from 0x080042da in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:152 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042da in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:152 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96c8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009888 +Loading section .ARM, size 0x8 lma 0x8009d60 +Loading section .init_array, size 0x8 lma 0x8009d68 +Loading section .fini_array, size 0x8 lma 0x8009d70 +Loading section .data, size 0x9a8 lma 0x8009d78 +Start address 0x08004324, load size 42736 +Transfer rate: 29 KB/sec, 4748 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] +0x080042fa in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:155 +155 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ################################################################## + 0x080042ee p_serial_mgr_service+18 ldrb.w r2, [r0, #265] ; 0x109 + 0x080042f2 p_serial_mgr_service+22 cmp r2, #0 + 0x080042f4 p_serial_mgr_service+24 beq.n 0x80042d8 + 0x080042f6 p_serial_mgr_service+26 b.n 0x80042fa + 0x080042f8 p_serial_mgr_service+28 movs r0, #0 + 0x080042fa p_serial_mgr_service+30 bx lr + 0x080042fc p_serial_mgr_service+32 asrs r4, r3, #25 + 0x080042fe p_serial_mgr_service+34 movs r0, #0 + 0x08004300 p_serial_mgr_service+36 push {r3, lr} + 0x08004302 p_serial_mgr_service+38 movs r2, #1 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042fa control 0x04 +### Source #################################################################### + 145 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 146 + 147 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 148 } + 149 + 150 serial_pkt_t *p_serial_mgr_service(void) + 151 { + 152 // this will be less garbage when i switch to a queue + 153 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 154 { + 155 if (serial_pkt_cb.buffer[ind].b_ready) + 156 { + 157 return &serial_pkt_cb.buffer[ind]; + 158 } + 159 } + 160 return NULL; + 161 } + 162 + 163 void p_serial_mgr_start() + 164 { +### Stack ##################################################################### +[0] from 0x080042fa in p_serial_mgr_service+30 at shared/drivers/p_serial_mgr.c:155 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042fa in p_serial_mgr_service+30 at shared/drivers/p_serial_mgr.c:155 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96d0 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009890 +Loading section .ARM, size 0x8 lma 0x8009d68 +Loading section .init_array, size 0x8 lma 0x8009d70 +Loading section .fini_array, size 0x8 lma 0x8009d78 +Loading section .data, size 0x9a8 lma 0x8009d80 +Start address 0x0800432c, load size 42744 +Transfer rate: 29 KB/sec, 4749 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] +0x080042e8 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:153 +153 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## + 0x080042de p_serial_mgr_service+2 b.n 0x80042e2 + 0x080042e0 p_serial_mgr_service+4 adds r3, #1 + 0x080042e2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x8004304 ) + 0x080042e4 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042e6 p_serial_mgr_service+10 cmp r2, r3 + 0x080042e8 p_serial_mgr_service+12 ble.n 0x8004300 + 0x080042ea p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x8004304 ) + 0x080042ec p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080042ee p_serial_mgr_service+18 mov.w r2, #268 ; 0x10c + 0x080042f2 p_serial_mgr_service+22 mla r0, r2, r3, r0 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042e8 control 0x04 +### Source #################################################################### + 143 { + 144 _serial_huart_inst = huart; + 145 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 146 + 147 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 148 } + 149 + 150 serial_pkt_t *p_serial_mgr_service(void) + 151 { + 152 // this will be less garbage when i switch to a queue + 153 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 154 { + 155 if (serial_pkt_cb.buffer[ind].b_ready) + 156 { + 157 return &serial_pkt_cb.buffer[ind]; + 158 } + 159 } + 160 return NULL; + 161 } + 162 +### Stack ##################################################################### +[0] from 0x080042e8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:153 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042e8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:153 +### Variables ################################################################# +loc ind = 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: 0x0800432c msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96d0 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009890 +Loading section .ARM, size 0x8 lma 0x8009d68 +Loading section .init_array, size 0x8 lma 0x8009d70 +Loading section .fini_array, size 0x8 lma 0x8009d78 +Loading section .data, size 0x9a8 lma 0x8009d80 +Start address 0x0800432c, load size 42744 +Transfer rate: 29 KB/sec, 4749 bytes/write. +Breakpoint 1 at 0x80041d6: file shared/drivers/p_serial_mgr.c, line 100. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x080042e8 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:153 +153 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## + 0x080042de p_serial_mgr_service+2 b.n 0x80042e2 + 0x080042e0 p_serial_mgr_service+4 adds r3, #1 + 0x080042e2 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x8004304 ) + 0x080042e4 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042e6 p_serial_mgr_service+10 cmp r2, r3 + 0x080042e8 p_serial_mgr_service+12 ble.n 0x8004300 + 0x080042ea p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x8004304 ) + 0x080042ec p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080042ee p_serial_mgr_service+18 mov.w r2, #268 ; 0x10c + 0x080042f2 p_serial_mgr_service+22 mla r0, r2, r3, r0 +### Breakpoints ############################################################### +[1] break at 0x080041d6 in shared/drivers/p_serial_mgr.c:100 for p_serial_mgr.c:100 if frame_index_tracker > 5 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042e8 control 0x04 +### Source #################################################################### + 143 { + 144 _serial_huart_inst = huart; + 145 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 146 + 147 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 148 } + 149 + 150 serial_pkt_t *p_serial_mgr_service(void) + 151 { + 152 // this will be less garbage when i switch to a queue + 153 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 154 { + 155 if (serial_pkt_cb.buffer[ind].b_ready) + 156 { + 157 return &serial_pkt_cb.buffer[ind]; + 158 } + 159 } + 160 return NULL; + 161 } + 162 +### Stack ##################################################################### +[0] from 0x080042e8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:153 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042e8 in p_serial_mgr_service+12 at shared/drivers/p_serial_mgr.c:153 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Note: breakpoint 1 also set at pc 0x80041d6. +Breakpoint 2 at 0x80041d6: file shared/drivers/p_serial_mgr.c, line 100. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ################################################################## + 0x0800150a main+150 bl 0x8004078 + 0x0800150e main+154 mov.w r2, #268 ; 0x10c + 0x08001512 main+158 movs r1, #0 + 0x08001514 main+160 mov r0, r4 + 0x08001516 main+162 bl 0x80043c8 + 0x0800151a main+166 bl 0x80042dc + 0x0800151e main+170 mov r4, r0 + 0x08001520 main+172 cmp r0, #0 + 0x08001522 main+174 beq.n 0x800151a + 0x08001524 main+176 ldrb r2, [r0, #1] +### Breakpoints ############################################################### +[1] break at 0x080041d6 in shared/drivers/p_serial_mgr.c:100 for p_serial_mgr.c:100 if frame_index_tracker > 5 +[2] break at 0x080041d6 in shared/drivers/p_serial_mgr.c:100 for p_serial_mgr.c:100 if frame_index_tracker > 0 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x0800151a control 0x04 +### Source #################################################################### + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ##################################################################### +[0] from 0x0800151a in main+166 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800151a in main+166 at Core/Src/main.c:146 +### Variables ################################################################# +loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234925,frame_data = "e\025\000\bg\0… +############################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ################################################################## + 0x0800150a main+150 bl 0x8004078 + 0x0800150e main+154 mov.w r2, #268 ; 0x10c + 0x08001512 main+158 movs r1, #0 + 0x08001514 main+160 mov r0, r4 + 0x08001516 main+162 bl 0x80043c8 <__libc_init_array+68> + 0x0800151a main+166 bl 0x80042dc + 0x0800151e main+170 mov r4, r0 + 0x08001520 main+172 cmp r0, #0 + 0x08001522 main+174 beq.n 0x800151a + 0x08001524 main+176 ldrb r2, [r0, #1] +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x0800151a control 0x04 +### Source #################################################################### + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ##################################################################### +[0] from 0x0800151a in main+166 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800151a in main+166 at Core/Src/main.c:146 +### Variables ################################################################# +loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234925,frame_data = "e\025\000\bg\0… +############################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96d8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009898 +Loading section .ARM, size 0x8 lma 0x8009d70 +Loading section .init_array, size 0x8 lma 0x8009d78 +Loading section .fini_array, size 0x8 lma 0x8009d80 +Loading section .data, size 0x9a8 lma 0x8009d88 +Start address 0x08004330, load size 42752 +Transfer rate: 29 KB/sec, 4750 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] +0x080042e8 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:154 +154 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ + 0x080042e0 p_serial_mgr_service+0 movs r3, #0 + 0x080042e2 p_serial_mgr_service+2 b.n 0x80042e6 + 0x080042e4 p_serial_mgr_service+4 adds r3, #1 + 0x080042e6 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x8004308 ) + 0x080042e8 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042ea p_serial_mgr_service+10 cmp r2, r3 + 0x080042ec p_serial_mgr_service+12 ble.n 0x8004304 + 0x080042ee p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x8004308 ) + 0x080042f0 p_serial_mgr_service+16 ldr r0, [r2, #0] +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x00000000 r8 0x00000000 xPSR 0x61000000 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x2000165c 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042e8 control 0x04 +### Source #################################################################### + 144 { + 145 _serial_huart_inst = huart; + 146 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 147 + 148 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 149 } + 150 + 151 serial_pkt_t *p_serial_mgr_service(void) + 152 { + 153 // this will be less garbage when i switch to a queue + 154 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 155 { + 156 if (serial_pkt_cb.buffer[ind].b_ready) + 157 { + 158 return &serial_pkt_cb.buffer[ind]; + 159 } + 160 } + 161 return NULL; + 162 } + 163 +### Stack ##################################################################### +[0] from 0x080042e8 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:154 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042e8 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:154 +### Variables ################################################################# +loc ind = 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: 0x08004330 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96d8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009898 +Loading section .ARM, size 0x8 lma 0x8009d70 +Loading section .init_array, size 0x8 lma 0x8009d78 +Loading section .fini_array, size 0x8 lma 0x8009d80 +Loading section .data, size 0x9a8 lma 0x8009d88 +Start address 0x08004330, load size 42752 +Transfer rate: 29 KB/sec, 4750 bytes/write. +Breakpoint 1 at 0x8004144: file shared/drivers/p_serial_mgr.c, line 79. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ################################################################## + 0x0800150a main+150 bl 0x8004078 + 0x0800150e main+154 mov.w r2, #268 ; 0x10c + 0x08001512 main+158 movs r1, #0 + 0x08001514 main+160 mov r0, r4 + 0x08001516 main+162 bl 0x80043cc + 0x0800151a main+166 bl 0x80042e0 + 0x0800151e main+170 mov r4, r0 + 0x08001520 main+172 cmp r0, #0 + 0x08001522 main+174 beq.n 0x800151a + 0x08001524 main+176 ldrb r2, [r0, #1] +### Breakpoints ############################################################### +[1] break at 0x08004144 in shared/drivers/p_serial_mgr.c:79 for p_serial_mgr.c:79 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x0800151a control 0x04 +### Source #################################################################### + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ##################################################################### +[0] from 0x0800151a in main+166 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800151a in main+166 at Core/Src/main.c:146 +### Variables ################################################################# +loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234929,frame_data = "e\025\000\bg\0… +############################################################################### +Breakpoint 2 at 0x80041b8: file shared/drivers/p_serial_mgr.c, line 100. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### +halted: PC: 0x080041ba +halted: PC: 0x080041ba + +Program received signal SIGINT, Interrupt. +0x080042e8 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:154 +154 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ + 0x080042e0 p_serial_mgr_service+0 movs r3, #0 + 0x080042e2 p_serial_mgr_service+2 b.n 0x80042e6 + 0x080042e4 p_serial_mgr_service+4 adds r3, #1 + 0x080042e6 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x8004308 ) + 0x080042e8 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042ea p_serial_mgr_service+10 cmp r2, r3 + 0x080042ec p_serial_mgr_service+12 ble.n 0x8004304 + 0x080042ee p_serial_mgr_service+14 ldr r2, [pc, #24] ; (0x8004308 ) + 0x080042f0 p_serial_mgr_service+16 ldr r0, [r2, #0] +### Breakpoints ############################################################### +[1] break at 0x08004144 in shared/drivers/p_serial_mgr.c:79 for p_serial_mgr.c:79 +[2] break at 0x080041b8 in shared/drivers/p_serial_mgr.c:100 for p_serial_mgr.c:100 if frame_index_tracker > 5 +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x00000000 r8 0x00000000 xPSR 0x61000000 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x2000165c 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042e8 control 0x04 +### Source #################################################################### + 144 { + 145 _serial_huart_inst = huart; + 146 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 147 + 148 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 149 } + 150 + 151 serial_pkt_t *p_serial_mgr_service(void) + 152 { + 153 // this will be less garbage when i switch to a queue + 154 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 155 { + 156 if (serial_pkt_cb.buffer[ind].b_ready) + 157 { + 158 return &serial_pkt_cb.buffer[ind]; + 159 } + 160 } + 161 return NULL; + 162 } + 163 +### Stack ##################################################################### +[0] from 0x080042e8 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:154 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042e8 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:154 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### +halted: PC: 0x080041ba +halted: PC: 0x080041ba + +Program received signal SIGINT, Interrupt. +0x080042e2 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:154 +154 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ################################################################## +~ +~ +~ +~ + 0x080042e0 p_serial_mgr_service+0 movs r3, #0 + 0x080042e2 p_serial_mgr_service+2 b.n 0x80042e6 + 0x080042e4 p_serial_mgr_service+4 adds r3, #1 + 0x080042e6 p_serial_mgr_service+6 ldr r2, [pc, #32] ; (0x8004308 ) + 0x080042e8 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080042ea p_serial_mgr_service+10 cmp r2, r3 +### Breakpoints ############################################################### +[1] break at 0x08004144 in shared/drivers/p_serial_mgr.c:79 for p_serial_mgr.c:79 +[2] break at 0x080041b8 in shared/drivers/p_serial_mgr.c:100 for p_serial_mgr.c:100 if frame_index_tracker > 5 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x080042e2 control 0x04 +### Source #################################################################### + 144 { + 145 _serial_huart_inst = huart; + 146 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 147 + 148 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 149 } + 150 + 151 serial_pkt_t *p_serial_mgr_service(void) + 152 { + 153 // this will be less garbage when i switch to a queue + 154 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 155 { + 156 if (serial_pkt_cb.buffer[ind].b_ready) + 157 { + 158 return &serial_pkt_cb.buffer[ind]; + 159 } + 160 } + 161 return NULL; + 162 } + 163 +### Stack ##################################################################### +[0] from 0x080042e2 in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:154 +[1] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080042e2 in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:154 +### Variables ################################################################# +loc ind = 0 +############################################################################### +Breakpoint 3 at 0x8004210: file shared/drivers/p_serial_mgr.c, line 110. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### +halted: PC: 0x080041ba +halted: PC: 0x080041ba +halted: PC: 0x080041ba +halted: PC: 0x080041ba +halted: PC: 0x080041ba + +Program received signal SIGINT, Interrupt. +0x080041ba in UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:100 +100 serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc; +### Assembly ################################################################## + 0x080041b0 UART1_RxCpltCallback+164 cmp r3, #126 ; 0x7e + 0x080041b2 UART1_RxCpltCallback+166 beq.n 0x80041ec + 0x080041b4 UART1_RxCpltCallback+168 cmp r3, #125 ; 0x7d + 0x080041b6 UART1_RxCpltCallback+170 beq.n 0x8004208 +!0x080041b8 UART1_RxCpltCallback+172 ldr r1, [pc, #236] ; (0x80042a8 ) + 0x080041ba UART1_RxCpltCallback+174 ldr r2, [r1, #0] + 0x080041bc UART1_RxCpltCallback+176 ldrh r1, [r1, #4] + 0x080041be UART1_RxCpltCallback+178 mov.w r0, #268 ; 0x10c + 0x080041c2 UART1_RxCpltCallback+182 mla r2, r0, r1, r2 + 0x080041c6 UART1_RxCpltCallback+186 ldr r0, [pc, #228] ; (0x80042ac ) +### Breakpoints ############################################################### +[1] break at 0x08004144 in shared/drivers/p_serial_mgr.c:79 for p_serial_mgr.c:79 +[2] break at 0x080041b8 in shared/drivers/p_serial_mgr.c:100 for p_serial_mgr.c:100 if frame_index_tracker > 5 +[3] break at 0x08004210 in shared/drivers/p_serial_mgr.c:110 for p_serial_mgr.c:110 if frame_index_tracker > 5 +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x2000165c r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000001 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x080041ba control 0x00 +### Source #################################################################### + 90 #pragma message(Reminder "add a safe escape routine for this") + 91 sstate = SS_IDLE; + 92 memset(&serial_pkt_cb.buffer[serial_pkt_cb.head], 0, sizeof(serial_pkt_t)); + 93 } + 94 else if (rxc == 0x7D) + 95 { + 96 sstate = SS_ESC; + 97 } + 98 else + 99 { +!100 serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc; + 101 if (frame_index_tracker >= serial_pkt_cb.buffer[serial_pkt_cb.head].len) + 102 { + 103 sstate = SS_CHECKSUM; + 104 } + 105 } + 106 } + 107 break; + 108 case SS_ESC: + 109 { +### Stack ##################################################################### +[0] from 0x080041ba in UART1_RxCpltCallback+174 at shared/drivers/p_serial_mgr.c:100 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080041ba in UART1_RxCpltCallback+174 at shared/drivers/p_serial_mgr.c:100 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +Quit +Breakpoint 4 at 0x8004144: file shared/drivers/p_serial_mgr.c, line 79. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Program received signal SIGINT, Interrupt. +0x0800151e in main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ################################################################## + 0x0800150e main+154 mov.w r2, #268 ; 0x10c + 0x08001512 main+158 movs r1, #0 + 0x08001514 main+160 mov r0, r4 + 0x08001516 main+162 bl 0x80043cc + 0x0800151a main+166 bl 0x80042e0 + 0x0800151e main+170 mov r4, r0 + 0x08001520 main+172 cmp r0, #0 + 0x08001522 main+174 beq.n 0x800151a + 0x08001524 main+176 ldrb r2, [r0, #1] + 0x08001526 main+178 ldrb r1, [r0, #0] +### Breakpoints ############################################################### +[4] break at 0x08004144 in shared/drivers/p_serial_mgr.c:79 for p_serial_mgr.c:79 +### 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 0x0800151f faultmask 0x00 + r7 0x00000000 pc 0x0800151e control 0x04 +### Source #################################################################### + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ##################################################################### +[0] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800151e in main+170 at Core/Src/main.c:146 +### Variables ################################################################# +loc pkt = 0x0: {src_addr = 0 '\000',dest_addr = 0 '\000',len = 134234929,frame_data = "e\025\000\bg\0… +############################################################################### +Breakpoint 5 at 0x80041ac: file shared/drivers/p_serial_mgr.c, line 86. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ########################################################### + +Breakpoint 5, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:86 +86 if (rxc == 0x7E) +### Assembly ################################################################## + 0x080041a2 UART1_RxCpltCallback+150 str r2, [r3, #4] + 0x080041a4 UART1_RxCpltCallback+152 ldr r3, [pc, #244] ; (0x800429c ) + 0x080041a6 UART1_RxCpltCallback+154 movs r2, #2 + 0x080041a8 UART1_RxCpltCallback+156 strb r2, [r3, #0] + 0x080041aa UART1_RxCpltCallback+158 b.n 0x8004284 +!0x080041ac UART1_RxCpltCallback+160 ldr r3, [pc, #240] ; (0x80042a0 ) + 0x080041ae UART1_RxCpltCallback+162 ldrb r3, [r3, #0] + 0x080041b0 UART1_RxCpltCallback+164 cmp r3, #126 ; 0x7e + 0x080041b2 UART1_RxCpltCallback+166 beq.n 0x80041ec + 0x080041b4 UART1_RxCpltCallback+168 cmp r3, #125 ; 0x7d +### Breakpoints ############################################################### +[5] break at 0x080041ac in shared/drivers/p_serial_mgr.c:86 for p_serial_mgr.c:86 hit 1 time +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000002 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x080041ac control 0x00 +### Source #################################################################### + 76 default: + 77 { + 78 // shouldnt get here + 79 asm volatile("nop"); + 80 } + 81 }; + 82 } + 83 break; + 84 case SS_FRAME: + 85 { +!86 if (rxc == 0x7E) + 87 { + 88 asm volatile("nop"); + 89 // error occured. bail + 90 #pragma message(Reminder "add a safe escape routine for this") + 91 sstate = SS_IDLE; + 92 memset(&serial_pkt_cb.buffer[serial_pkt_cb.head], 0, sizeof(serial_pkt_t)); + 93 } + 94 else if (rxc == 0x7D) + 95 { +### Stack ##################################################################### +[0] from 0x080041ac in UART1_RxCpltCallback+160 at shared/drivers/p_serial_mgr.c:86 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x080042e8 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:154 +[6] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080041ac in UART1_RxCpltCallback+160 at shared/drivers/p_serial_mgr.c:86 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +$1 = 1 '\001' +$2 = { + src_addr = 0 '\000', + dest_addr = 0 '\000', + len = 134234929, + frame_data = "e\025\000\bg\025\000\bi\025\000\bk\025\000\bm\025\000\b", '\000' , "o\025\000\bq\025\000\b\000\000\000\000s\025\000\bu\025\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\000\000\000\000\000\000\000\000\201C\000\b\201C\000\b\000\000\000\000\000\000\000\000\201C\000\b"..., + checksum = 0 '\000', + b_ready = false +} +$3 = "e\025\000\bg\025\000\bi\025\000\bk\025\000\bm\025\000\b", '\000' , "o\025\000\bq\025\000\b\000\000\000\000s\025\000\bu\025\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\201C\000\b\000\000\000\000\000\000\000\000\201C\000\b\201C\000\b\000\000\000\000\000\000\000\000\201C\000\b"... +$4 = {[0x0] = 0x65, [0x1] = 0x15, [0x2] = 0x0, [0x3] = 0x8, [0x4] = 0x67, [0x5] = 0x15, [0x6] = 0x0, [0x7] = 0x8, [0x8] = 0x69, [0x9] = 0x15, [0xa] = 0x0, [0xb] = 0x8, [0xc] = 0x6b, [0xd] = 0x15, [0xe] = 0x0, [0xf] = 0x8, [0x10] = 0x6d, [0x11] = 0x15, [0x12] = 0x0, [0x13] = 0x8, [0x14] = 0x0 , [0x24] = 0x6f, [0x25] = 0x15, [0x26] = 0x0, [0x27] = 0x8, [0x28] = 0x71, [0x29] = 0x15, [0x2a] = 0x0, [0x2b] = 0x8, [0x2c] = 0x0, [0x2d] = 0x0, [0x2e] = 0x0, [0x2f] = 0x0, [0x30] = 0x73, [0x31] = 0x15, [0x32] = 0x0, [0x33] = 0x8, [0x34] = 0x75, [0x35] = 0x15, [0x36] = 0x0, [0x37] = 0x8, [0x38] = 0x81, [0x39] = 0x43, [0x3a] = 0x0, [0x3b] = 0x8, [0x3c] = 0x81, [0x3d] = 0x43, [0x3e] = 0x0, [0x3f] = 0x8, [0x40] = 0x81, [0x41] = 0x43, [0x42] = 0x0, [0x43] = 0x8, [0x44] = 0x81, [0x45] = 0x43, [0x46] = 0x0, [0x47] = 0x8, [0x48] = 0x81, [0x49] = 0x43, [0x4a] = 0x0, [0x4b] = 0x8, [0x4c] = 0x81, [0x4d] = 0x43, [0x4e] = 0x0, [0x4f] = 0x8, [0x50] = 0x81, [0x51] = 0x43, [0x52] = 0x0, [0x53] = 0x8, [0x54] = 0x81, [0x55] = 0x43, [0x56] = 0x0, [0x57] = 0x8, [0x58] = 0x81, [0x59] = 0x43, [0x5a] = 0x0, [0x5b] = 0x8, [0x5c] = 0x81, [0x5d] = 0x43, [0x5e] = 0x0, [0x5f] = 0x8, [0x60] = 0x81, [0x61] = 0x43, [0x62] = 0x0, [0x63] = 0x8, [0x64] = 0x81, [0x65] = 0x43, [0x66] = 0x0, [0x67] = 0x8, [0x68] = 0x81, [0x69] = 0x43, [0x6a] = 0x0, [0x6b] = 0x8, [0x6c] = 0x81, [0x6d] = 0x43, [0x6e] = 0x0, [0x6f] = 0x8, [0x70] = 0x81, [0x71] = 0x43, [0x72] = 0x0, [0x73] = 0x8, [0x74] = 0x81, [0x75] = 0x43, [0x76] = 0x0, [0x77] = 0x8, [0x78] = 0x81, [0x79] = 0x43, [0x7a] = 0x0, [0x7b] = 0x8, [0x7c] = 0x81, [0x7d] = 0x43, [0x7e] = 0x0, [0x7f] = 0x8, [0x80] = 0x81, [0x81] = 0x43, [0x82] = 0x0, [0x83] = 0x8, [0x84] = 0x81, [0x85] = 0x43, [0x86] = 0x0, [0x87] = 0x8, [0x88] = 0x81, [0x89] = 0x43, [0x8a] = 0x0, [0x8b] = 0x8, [0x8c] = 0x81, [0x8d] = 0x43, [0x8e] = 0x0, [0x8f] = 0x8, [0x90] = 0x81, [0x91] = 0x43, [0x92] = 0x0, [0x93] = 0x8, [0x94] = 0x81, [0x95] = 0x43, [0x96] = 0x0, [0x97] = 0x8, [0x98] = 0x81, [0x99] = 0x43, [0x9a] = 0x0, [0x9b] = 0x8, [0x9c] = 0x81, [0x9d] = 0x43, [0x9e] = 0x0, [0x9f] = 0x8, [0xa0] = 0x81, [0xa1] = 0x43, [0xa2] = 0x0, [0xa3] = 0x8, [0xa4] = 0x81, [0xa5] = 0x43, [0xa6] = 0x0, [0xa7] = 0x8, [0xa8] = 0x81, [0xa9] = 0x43, [0xaa] = 0x0, [0xab] = 0x8, [0xac] = 0x0, [0xad] = 0x0, [0xae] = 0x0, [0xaf] = 0x0, [0xb0] = 0x0, [0xb1] = 0x0, [0xb2] = 0x0, [0xb3] = 0x0, [0xb4] = 0x81, [0xb5] = 0x43, [0xb6] = 0x0, [0xb7] = 0x8, [0xb8] = 0x81, [0xb9] = 0x43, [0xba] = 0x0, [0xbb] = 0x8, [0xbc] = 0x0, [0xbd] = 0x0, [0xbe] = 0x0, [0xbf] = 0x0, [0xc0] = 0x0, [0xc1] = 0x0, [0xc2] = 0x0, [0xc3] = 0x0, [0xc4] = 0x81, [0xc5] = 0x43, [0xc6] = 0x0, [0xc7] = 0x8, [0xc8] = 0x0, [0xc9] = 0x0, [0xca] = 0x0, [0xcb] = 0x0, [0xcc] = 0x7d, [0xcd] = 0x15...} +Quit +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:75 +75 break; +### Assembly ################################################################## + 0x080041a2 UART1_RxCpltCallback+150 str r2, [r3, #4] + 0x080041a4 UART1_RxCpltCallback+152 ldr r3, [pc, #244] ; (0x800429c ) + 0x080041a6 UART1_RxCpltCallback+154 movs r2, #2 + 0x080041a8 UART1_RxCpltCallback+156 strb r2, [r3, #0] + 0x080041aa UART1_RxCpltCallback+158 b.n 0x8004284 + 0x080041ac UART1_RxCpltCallback+160 ldr r3, [pc, #240] ; (0x80042a0 ) + 0x080041ae UART1_RxCpltCallback+162 ldrb r3, [r3, #0] + 0x080041b0 UART1_RxCpltCallback+164 cmp r3, #126 ; 0x7e + 0x080041b2 UART1_RxCpltCallback+166 beq.n 0x80041ec + 0x080041b4 UART1_RxCpltCallback+168 cmp r3, #125 ; 0x7d +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000002 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x080041ac control 0x00 +### Source #################################################################### + 65 start_index_tracker++; + 66 } + 67 break; + 68 case 2: + 69 { + 70 start_index_tracker = 0; + 71 frame_index_tracker = 0; + 72 serial_pkt_cb.buffer[serial_pkt_cb.head].len = rxc; + 73 sstate = SS_FRAME; + 74 } + 75 break; + 76 default: + 77 { + 78 // shouldnt get here + 79 asm volatile("nop"); + 80 } + 81 }; + 82 } + 83 break; + 84 case SS_FRAME: +### Stack ##################################################################### +[0] from 0x080041ac in UART1_RxCpltCallback+160 at shared/drivers/p_serial_mgr.c:75 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x080042e8 in p_serial_mgr_init+48 at shared/drivers/p_serial_mgr.c:150 +[6] from 0x200016b4 in heap_end +### Threads ################################################################### +[1] id 0 from 0x080041ac in UART1_RxCpltCallback+160 at shared/drivers/p_serial_mgr.c:75 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +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: 0x08004330 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96e8 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x80098a8 +Loading section .ARM, size 0x8 lma 0x8009d80 +Loading section .init_array, size 0x8 lma 0x8009d88 +Loading section .fini_array, size 0x8 lma 0x8009d90 +Loading section .data, size 0x9a8 lma 0x8009d98 +Start address 0x08004340, load size 42768 +Transfer rate: 29 KB/sec, 4752 bytes/write. +Breakpoint 1 at 0x80041ae: file shared/drivers/p_serial_mgr.c, line 86. +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, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:86 +86 if (rxc == 0x7E) +### Assembly ################################################################## + 0x080041a4 UART1_RxCpltCallback+152 ldr r3, [pc, #244] ; (0x800429c ) + 0x080041a6 UART1_RxCpltCallback+154 movs r2, #2 + 0x080041a8 UART1_RxCpltCallback+156 strb r2, [r3, #0] + 0x080041aa UART1_RxCpltCallback+158 b.n 0x8004284 + 0x080041ac UART1_RxCpltCallback+160 ldr r3, [pc, #240] ; (0x80042a0 ) +!0x080041ae UART1_RxCpltCallback+162 ldrb r3, [r3, #0] + 0x080041b0 UART1_RxCpltCallback+164 cmp r3, #126 ; 0x7e + 0x080041b2 UART1_RxCpltCallback+166 beq.n 0x80041ec + 0x080041b4 UART1_RxCpltCallback+168 cmp r3, #125 ; 0x7d + 0x080041b6 UART1_RxCpltCallback+170 beq.n 0x8004208 +### Breakpoints ############################################################### +[1] break at 0x080041ae in shared/drivers/p_serial_mgr.c:86 for p_serial_mgr.c:86 hit 1 time +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000002 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x080041ae control 0x00 +### Source #################################################################### + 76 default: + 77 { + 78 // shouldnt get here + 79 asm volatile("nop"); + 80 } + 81 }; + 82 } + 83 break; + 84 case SS_FRAME: + 85 { +!86 if (rxc == 0x7E) + 87 { + 88 asm volatile("nop"); + 89 // error occured. bail + 90 #pragma message(Reminder "add a safe escape routine for this") + 91 sstate = SS_IDLE; + 92 memset(&serial_pkt_cb.buffer[serial_pkt_cb.head], 0, sizeof(serial_pkt_t)); + 93 } + 94 else if (rxc == 0x7D) + 95 { +### Stack ##################################################################### +[0] from 0x080041ae in UART1_RxCpltCallback+162 at shared/drivers/p_serial_mgr.c:86 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x0800151a in main+166 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080041ae in UART1_RxCpltCallback+162 at shared/drivers/p_serial_mgr.c:86 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +$1 = 1 '\001' +$2 = { + src_addr = 0 '\000', + dest_addr = 0 '\000', + len = 134234945, + frame_data = "e\025\000\bg\025\000\bi\025\000\bk\025\000\bm\025\000\b", '\000' , "o\025\000\bq\025\000\b\000\000\000\000s\025\000\bu\025\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\221C\000\b\000\000\000\000\000\000\000\000\221C\000\b\221C\000\b\000\000\000\000\000\000\000\000\221C\000\b"..., + checksum = 0 '\000', + b_ready = false +} +$3 = {[0x0] = 0x65, [0x1] = 0x15, [0x2] = 0x0, [0x3] = 0x8, [0x4] = 0x67, [0x5] = 0x15, [0x6] = 0x0, [0x7] = 0x8, [0x8] = 0x69, [0x9] = 0x15, [0xa] = 0x0, [0xb] = 0x8, [0xc] = 0x6b, [0xd] = 0x15, [0xe] = 0x0, [0xf] = 0x8, [0x10] = 0x6d, [0x11] = 0x15, [0x12] = 0x0, [0x13] = 0x8, [0x14] = 0x0 , [0x24] = 0x6f, [0x25] = 0x15, [0x26] = 0x0, [0x27] = 0x8, [0x28] = 0x71, [0x29] = 0x15, [0x2a] = 0x0, [0x2b] = 0x8, [0x2c] = 0x0, [0x2d] = 0x0, [0x2e] = 0x0, [0x2f] = 0x0, [0x30] = 0x73, [0x31] = 0x15, [0x32] = 0x0, [0x33] = 0x8, [0x34] = 0x75, [0x35] = 0x15, [0x36] = 0x0, [0x37] = 0x8, [0x38] = 0x91, [0x39] = 0x43, [0x3a] = 0x0, [0x3b] = 0x8, [0x3c] = 0x91, [0x3d] = 0x43, [0x3e] = 0x0, [0x3f] = 0x8, [0x40] = 0x91, [0x41] = 0x43, [0x42] = 0x0, [0x43] = 0x8, [0x44] = 0x91, [0x45] = 0x43, [0x46] = 0x0, [0x47] = 0x8, [0x48] = 0x91, [0x49] = 0x43, [0x4a] = 0x0, [0x4b] = 0x8, [0x4c] = 0x91, [0x4d] = 0x43, [0x4e] = 0x0, [0x4f] = 0x8, [0x50] = 0x91, [0x51] = 0x43, [0x52] = 0x0, [0x53] = 0x8, [0x54] = 0x91, [0x55] = 0x43, [0x56] = 0x0, [0x57] = 0x8, [0x58] = 0x91, [0x59] = 0x43, [0x5a] = 0x0, [0x5b] = 0x8, [0x5c] = 0x91, [0x5d] = 0x43, [0x5e] = 0x0, [0x5f] = 0x8, [0x60] = 0x91, [0x61] = 0x43, [0x62] = 0x0, [0x63] = 0x8, [0x64] = 0x91, [0x65] = 0x43, [0x66] = 0x0, [0x67] = 0x8, [0x68] = 0x91, [0x69] = 0x43, [0x6a] = 0x0, [0x6b] = 0x8, [0x6c] = 0x91, [0x6d] = 0x43, [0x6e] = 0x0, [0x6f] = 0x8, [0x70] = 0x91, [0x71] = 0x43, [0x72] = 0x0, [0x73] = 0x8, [0x74] = 0x91, [0x75] = 0x43, [0x76] = 0x0, [0x77] = 0x8, [0x78] = 0x91, [0x79] = 0x43, [0x7a] = 0x0, [0x7b] = 0x8, [0x7c] = 0x91, [0x7d] = 0x43, [0x7e] = 0x0, [0x7f] = 0x8, [0x80] = 0x91, [0x81] = 0x43, [0x82] = 0x0, [0x83] = 0x8, [0x84] = 0x91, [0x85] = 0x43, [0x86] = 0x0, [0x87] = 0x8, [0x88] = 0x91, [0x89] = 0x43, [0x8a] = 0x0, [0x8b] = 0x8, [0x8c] = 0x91, [0x8d] = 0x43, [0x8e] = 0x0, [0x8f] = 0x8, [0x90] = 0x91, [0x91] = 0x43, [0x92] = 0x0, [0x93] = 0x8, [0x94] = 0x91, [0x95] = 0x43, [0x96] = 0x0, [0x97] = 0x8, [0x98] = 0x91, [0x99] = 0x43, [0x9a] = 0x0, [0x9b] = 0x8, [0x9c] = 0x91, [0x9d] = 0x43, [0x9e] = 0x0, [0x9f] = 0x8, [0xa0] = 0x91, [0xa1] = 0x43, [0xa2] = 0x0, [0xa3] = 0x8, [0xa4] = 0x91, [0xa5] = 0x43, [0xa6] = 0x0, [0xa7] = 0x8, [0xa8] = 0x91, [0xa9] = 0x43, [0xaa] = 0x0, [0xab] = 0x8, [0xac] = 0x0, [0xad] = 0x0, [0xae] = 0x0, [0xaf] = 0x0, [0xb0] = 0x0, [0xb1] = 0x0, [0xb2] = 0x0, [0xb3] = 0x0, [0xb4] = 0x91, [0xb5] = 0x43, [0xb6] = 0x0, [0xb7] = 0x8, [0xb8] = 0x91, [0xb9] = 0x43, [0xba] = 0x0, [0xbb] = 0x8, [0xbc] = 0x0, [0xbd] = 0x0, [0xbe] = 0x0, [0xbf] = 0x0, [0xc0] = 0x0, [0xc1] = 0x0, [0xc2] = 0x0, [0xc3] = 0x0, [0xc4] = 0x91, [0xc5] = 0x43, [0xc6] = 0x0, [0xc7] = 0x8, [0xc8] = 0x0, [0xc9] = 0x0, [0xca] = 0x0, [0xcb] = 0x0, [0xcc] = 0x7d, [0xcd] = 0x15...} +$4 = {[0x0] = 0x65, [0x1] = 0x15, [0x2] = 0x0, [0x3] = 0x8, [0x4] = 0x67, [0x5] = 0x15, [0x6] = 0x0, [0x7] = 0x8, [0x8] = 0x69, [0x9] = 0x15, [0xa] = 0x0, [0xb] = 0x8, [0xc] = 0x6b, [0xd] = 0x15, [0xe] = 0x0, [0xf] = 0x8, [0x10] = 0x6d, [0x11] = 0x15, [0x12] = 0x0, [0x13] = 0x8, [0x14] = 0x0 , [0x24] = 0x6f, [0x25] = 0x15, [0x26] = 0x0, [0x27] = 0x8, [0x28] = 0x71, [0x29] = 0x15, [0x2a] = 0x0, [0x2b] = 0x8, [0x2c] = 0x0, [0x2d] = 0x0, [0x2e] = 0x0, [0x2f] = 0x0, [0x30] = 0x73, [0x31] = 0x15, [0x32] = 0x0, [0x33] = 0x8, [0x34] = 0x75, [0x35] = 0x15, [0x36] = 0x0, [0x37] = 0x8, [0x38] = 0x91, [0x39] = 0x43, [0x3a] = 0x0, [0x3b] = 0x8, [0x3c] = 0x91, [0x3d] = 0x43, [0x3e] = 0x0, [0x3f] = 0x8, [0x40] = 0x91, [0x41] = 0x43, [0x42] = 0x0, [0x43] = 0x8, [0x44] = 0x91, [0x45] = 0x43, [0x46] = 0x0, [0x47] = 0x8, [0x48] = 0x91, [0x49] = 0x43, [0x4a] = 0x0, [0x4b] = 0x8, [0x4c] = 0x91, [0x4d] = 0x43, [0x4e] = 0x0, [0x4f] = 0x8, [0x50] = 0x91, [0x51] = 0x43, [0x52] = 0x0, [0x53] = 0x8, [0x54] = 0x91, [0x55] = 0x43, [0x56] = 0x0, [0x57] = 0x8, [0x58] = 0x91, [0x59] = 0x43, [0x5a] = 0x0, [0x5b] = 0x8, [0x5c] = 0x91, [0x5d] = 0x43, [0x5e] = 0x0, [0x5f] = 0x8, [0x60] = 0x91, [0x61] = 0x43, [0x62] = 0x0, [0x63] = 0x8, [0x64] = 0x91, [0x65] = 0x43, [0x66] = 0x0, [0x67] = 0x8, [0x68] = 0x91, [0x69] = 0x43, [0x6a] = 0x0, [0x6b] = 0x8, [0x6c] = 0x91, [0x6d] = 0x43, [0x6e] = 0x0, [0x6f] = 0x8, [0x70] = 0x91, [0x71] = 0x43, [0x72] = 0x0, [0x73] = 0x8, [0x74] = 0x91, [0x75] = 0x43, [0x76] = 0x0, [0x77] = 0x8, [0x78] = 0x91, [0x79] = 0x43, [0x7a] = 0x0, [0x7b] = 0x8, [0x7c] = 0x91, [0x7d] = 0x43, [0x7e] = 0x0, [0x7f] = 0x8, [0x80] = 0x91, [0x81] = 0x43, [0x82] = 0x0, [0x83] = 0x8, [0x84] = 0x91, [0x85] = 0x43, [0x86] = 0x0, [0x87] = 0x8, [0x88] = 0x91, [0x89] = 0x43, [0x8a] = 0x0, [0x8b] = 0x8, [0x8c] = 0x91, [0x8d] = 0x43, [0x8e] = 0x0, [0x8f] = 0x8, [0x90] = 0x91, [0x91] = 0x43, [0x92] = 0x0, [0x93] = 0x8, [0x94] = 0x91, [0x95] = 0x43, [0x96] = 0x0, [0x97] = 0x8, [0x98] = 0x91, [0x99] = 0x43, [0x9a] = 0x0, [0x9b] = 0x8, [0x9c] = 0x91, [0x9d] = 0x43, [0x9e] = 0x0, [0x9f] = 0x8, [0xa0] = 0x91, [0xa1] = 0x43, [0xa2] = 0x0, [0xa3] = 0x8, [0xa4] = 0x91, [0xa5] = 0x43, [0xa6] = 0x0, [0xa7] = 0x8, [0xa8] = 0x91, [0xa9] = 0x43, [0xaa] = 0x0, [0xab] = 0x8, [0xac] = 0x0, [0xad] = 0x0, [0xae] = 0x0, [0xaf] = 0x0, [0xb0] = 0x0, [0xb1] = 0x0, [0xb2] = 0x0, [0xb3] = 0x0, [0xb4] = 0x91, [0xb5] = 0x43, [0xb6] = 0x0, [0xb7] = 0x8, [0xb8] = 0x91, [0xb9] = 0x43, [0xba] = 0x0, [0xbb] = 0x8, [0xbc] = 0x0, [0xbd] = 0x0, [0xbe] = 0x0, [0xbf] = 0x0, [0xc0] = 0x0, [0xc1] = 0x0, [0xc2] = 0x0, [0xc3] = 0x0, [0xc4] = 0x91, [0xc5] = 0x43, [0xc6] = 0x0, [0xc7] = 0x8, [0xc8] = 0x0, [0xc9] = 0x0, [0xca] = 0x0, [0xcb] = 0x0, [0xcc] = 0x7d, [0xcd] = 0x15...} +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:67 +67 break; +### Assembly ################################################################## + 0x080041a4 UART1_RxCpltCallback+112 str r2, [r3, #4] + 0x080041a6 UART1_RxCpltCallback+114 ldr r3, [pc, #244] ; (0x800429c ) + 0x080041a8 UART1_RxCpltCallback+116 movs r2, #2 + 0x080041aa UART1_RxCpltCallback+118 strb r2, [r3, #0] + 0x080041ac UART1_RxCpltCallback+120 b.n 0x8004286 + 0x080041ae UART1_RxCpltCallback+122 ldr r3, [pc, #240] ; (0x80042a0 ) + 0x080041b0 UART1_RxCpltCallback+124 ldrb r3, [r3, #0] + 0x080041b2 UART1_RxCpltCallback+126 cmp r3, #126 ; 0x7e + 0x080041b4 UART1_RxCpltCallback+128 beq.n 0x80041ee + 0x080041b6 UART1_RxCpltCallback+130 cmp r3, #125 ; 0x7d +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000002 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x080041ae control 0x00 +### Source #################################################################### + 57 { + 58 serial_pkt_cb.buffer[serial_pkt_cb.head].src_addr = rxc; + 59 start_index_tracker++; + 60 } + 61 break; + 62 case 1: + 63 { + 64 serial_pkt_cb.buffer[serial_pkt_cb.head].dest_addr = rxc; + 65 start_index_tracker++; + 66 } + 67 break; + 68 case 2: + 69 { + 70 start_index_tracker = 0; + 71 frame_index_tracker = 0; + 72 serial_pkt_cb.buffer[serial_pkt_cb.head].len = rxc; + 73 sstate = SS_FRAME; + 74 } + 75 break; + 76 default: +### Stack ##################################################################### +[0] from 0x080041ae in UART1_RxCpltCallback+122 at shared/drivers/p_serial_mgr.c:67 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x0800151a in main+166 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080041ae in UART1_RxCpltCallback+122 at shared/drivers/p_serial_mgr.c:67 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +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: 0x08004340 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9710 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x80098d0 +Loading section .ARM, size 0x8 lma 0x8009da8 +Loading section .init_array, size 0x8 lma 0x8009db0 +Loading section .fini_array, size 0x8 lma 0x8009db8 +Loading section .data, size 0x9a8 lma 0x8009dc0 +Start address 0x08004368, load size 42808 +Transfer rate: 29 KB/sec, 4756 bytes/write. +Breakpoint 1 at 0x80041d6: file shared/drivers/p_serial_mgr.c, line 86. +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, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:86 +86 if (rxc == 0x7E) +### Assembly ################################################################## +!0x080041d6 UART1_RxCpltCallback+162 ldr r3, [pc, #240] ; (0x80042c8 ) + 0x080041d8 UART1_RxCpltCallback+164 ldrb r3, [r3, #0] + 0x080041da UART1_RxCpltCallback+166 cmp r3, #126 ; 0x7e + 0x080041dc UART1_RxCpltCallback+168 beq.n 0x8004216 + 0x080041de UART1_RxCpltCallback+170 cmp r3, #125 ; 0x7d + 0x080041e0 UART1_RxCpltCallback+172 beq.n 0x8004232 + 0x080041e2 UART1_RxCpltCallback+174 ldr r1, [pc, #236] ; (0x80042d0 ) + 0x080041e4 UART1_RxCpltCallback+176 ldr r2, [r1, #0] + 0x080041e6 UART1_RxCpltCallback+178 ldrh r1, [r1, #4] + 0x080041e8 UART1_RxCpltCallback+180 mov.w r0, #268 ; 0x10c +### Breakpoints ############################################################### +[1] break at 0x080041d6 in shared/drivers/p_serial_mgr.c:86 for p_serial_mgr.c:86 hit 1 time +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000002 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x080041d6 control 0x00 +### Source #################################################################### + 76 default: + 77 { + 78 // shouldnt get here + 79 asm volatile("nop"); + 80 } + 81 }; + 82 } + 83 break; + 84 case SS_FRAME: + 85 { +!86 if (rxc == 0x7E) + 87 { + 88 asm volatile("nop"); + 89 // error occured. bail + 90 #pragma message(Reminder "add a safe escape routine for this") + 91 sstate = SS_IDLE; + 92 memset(&serial_pkt_cb.buffer[serial_pkt_cb.head], 0, sizeof(serial_pkt_t)); + 93 } + 94 else if (rxc == 0x7D) + 95 { +### Stack ##################################################################### +[0] from 0x080041d6 in UART1_RxCpltCallback+162 at shared/drivers/p_serial_mgr.c:86 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x08004320 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:155 +[6] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080041d6 in UART1_RxCpltCallback+162 at shared/drivers/p_serial_mgr.c:86 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +$1 = {[0x0] = 0x65, [0x1] = 0x15, [0x2] = 0x0, [0x3] = 0x8, [0x4] = 0x67, [0x5] = 0x15, [0x6] = 0x0, [0x7] = 0x8, [0x8] = 0x69, [0x9] = 0x15, [0xa] = 0x0, [0xb] = 0x8, [0xc] = 0x6b, [0xd] = 0x15, [0xe] = 0x0, [0xf] = 0x8, [0x10] = 0x6d, [0x11] = 0x15, [0x12] = 0x0, [0x13] = 0x8, [0x14] = 0x0 , [0x24] = 0x6f, [0x25] = 0x15, [0x26] = 0x0, [0x27] = 0x8, [0x28] = 0x71, [0x29] = 0x15, [0x2a] = 0x0, [0x2b] = 0x8, [0x2c] = 0x0, [0x2d] = 0x0, [0x2e] = 0x0, [0x2f] = 0x0, [0x30] = 0x73, [0x31] = 0x15, [0x32] = 0x0, [0x33] = 0x8, [0x34] = 0x75, [0x35] = 0x15, [0x36] = 0x0, [0x37] = 0x8, [0x38] = 0xb9, [0x39] = 0x43, [0x3a] = 0x0, [0x3b] = 0x8, [0x3c] = 0xb9, [0x3d] = 0x43, [0x3e] = 0x0, [0x3f] = 0x8, [0x40] = 0xb9, [0x41] = 0x43, [0x42] = 0x0, [0x43] = 0x8, [0x44] = 0xb9, [0x45] = 0x43, [0x46] = 0x0, [0x47] = 0x8, [0x48] = 0xb9, [0x49] = 0x43, [0x4a] = 0x0, [0x4b] = 0x8, [0x4c] = 0xb9, [0x4d] = 0x43, [0x4e] = 0x0, [0x4f] = 0x8, [0x50] = 0xb9, [0x51] = 0x43, [0x52] = 0x0, [0x53] = 0x8, [0x54] = 0xb9, [0x55] = 0x43, [0x56] = 0x0, [0x57] = 0x8, [0x58] = 0xb9, [0x59] = 0x43, [0x5a] = 0x0, [0x5b] = 0x8, [0x5c] = 0xb9, [0x5d] = 0x43, [0x5e] = 0x0, [0x5f] = 0x8, [0x60] = 0xb9, [0x61] = 0x43, [0x62] = 0x0, [0x63] = 0x8, [0x64] = 0xb9, [0x65] = 0x43, [0x66] = 0x0, [0x67] = 0x8, [0x68] = 0xb9, [0x69] = 0x43, [0x6a] = 0x0, [0x6b] = 0x8, [0x6c] = 0xb9, [0x6d] = 0x43, [0x6e] = 0x0, [0x6f] = 0x8, [0x70] = 0xb9, [0x71] = 0x43, [0x72] = 0x0, [0x73] = 0x8, [0x74] = 0xb9, [0x75] = 0x43, [0x76] = 0x0, [0x77] = 0x8, [0x78] = 0xb9, [0x79] = 0x43, [0x7a] = 0x0, [0x7b] = 0x8, [0x7c] = 0xb9, [0x7d] = 0x43, [0x7e] = 0x0, [0x7f] = 0x8, [0x80] = 0xb9, [0x81] = 0x43, [0x82] = 0x0, [0x83] = 0x8, [0x84] = 0xb9, [0x85] = 0x43, [0x86] = 0x0, [0x87] = 0x8, [0x88] = 0xb9, [0x89] = 0x43, [0x8a] = 0x0, [0x8b] = 0x8, [0x8c] = 0xb9, [0x8d] = 0x43, [0x8e] = 0x0, [0x8f] = 0x8, [0x90] = 0xb9, [0x91] = 0x43, [0x92] = 0x0, [0x93] = 0x8, [0x94] = 0xb9, [0x95] = 0x43, [0x96] = 0x0, [0x97] = 0x8, [0x98] = 0xb9, [0x99] = 0x43, [0x9a] = 0x0, [0x9b] = 0x8, [0x9c] = 0xb9, [0x9d] = 0x43, [0x9e] = 0x0, [0x9f] = 0x8, [0xa0] = 0xb9, [0xa1] = 0x43, [0xa2] = 0x0, [0xa3] = 0x8, [0xa4] = 0xb9, [0xa5] = 0x43, [0xa6] = 0x0, [0xa7] = 0x8, [0xa8] = 0xb9, [0xa9] = 0x43, [0xaa] = 0x0, [0xab] = 0x8, [0xac] = 0x0, [0xad] = 0x0, [0xae] = 0x0, [0xaf] = 0x0, [0xb0] = 0x0, [0xb1] = 0x0, [0xb2] = 0x0, [0xb3] = 0x0, [0xb4] = 0xb9, [0xb5] = 0x43, [0xb6] = 0x0, [0xb7] = 0x8, [0xb8] = 0xb9, [0xb9] = 0x43, [0xba] = 0x0, [0xbb] = 0x8, [0xbc] = 0x0, [0xbd] = 0x0, [0xbe] = 0x0, [0xbf] = 0x0, [0xc0] = 0x0, [0xc1] = 0x0, [0xc2] = 0x0, [0xc3] = 0x0, [0xc4] = 0xb9, [0xc5] = 0x43, [0xc6] = 0x0, [0xc7] = 0x8, [0xc8] = 0x0, [0xc9] = 0x0, [0xca] = 0x0, [0xcb] = 0x0, [0xcc] = 0x7d, [0xcd] = 0x15...} +$2 = 0x0 +Invalid character '\' in expression. +Invalid character '\' in expression. +Invalid character '\' in expression. +Undefined command: "pserial_pkt_cb.buffer". Try "help". +$3 = (serial_pkt_t *) 0x0 +$4 = { + src_addr = 0 '\000', + dest_addr = 0 '\000', + len = 134234985, + frame_data = "e\025\000\bg\025\000\bi\025\000\bk\025\000\bm\025\000\b", '\000' , "o\025\000\bq\025\000\b\000\000\000\000s\025\000\bu\025\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\000\000\000\000\000\000\000\000\271C\000\b\271C\000\b\000\000\000\000\000\000\000\000\271C\000\b"..., + checksum = 0 '\000', + b_ready = false +} +$5 = { + src_addr = 0x0, + dest_addr = 0x0, + len = 0x8004369, + frame_data = {[0x0] = 0x65, [0x1] = 0x15, [0x2] = 0x0, [0x3] = 0x8, [0x4] = 0x67, [0x5] = 0x15, [0x6] = 0x0, [0x7] = 0x8, [0x8] = 0x69, [0x9] = 0x15, [0xa] = 0x0, [0xb] = 0x8, [0xc] = 0x6b, [0xd] = 0x15, [0xe] = 0x0, [0xf] = 0x8, [0x10] = 0x6d, [0x11] = 0x15, [0x12] = 0x0, [0x13] = 0x8, [0x14] = 0x0 , [0x24] = 0x6f, [0x25] = 0x15, [0x26] = 0x0, [0x27] = 0x8, [0x28] = 0x71, [0x29] = 0x15, [0x2a] = 0x0, [0x2b] = 0x8, [0x2c] = 0x0, [0x2d] = 0x0, [0x2e] = 0x0, [0x2f] = 0x0, [0x30] = 0x73, [0x31] = 0x15, [0x32] = 0x0, [0x33] = 0x8, [0x34] = 0x75, [0x35] = 0x15, [0x36] = 0x0, [0x37] = 0x8, [0x38] = 0xb9, [0x39] = 0x43, [0x3a] = 0x0, [0x3b] = 0x8, [0x3c] = 0xb9, [0x3d] = 0x43, [0x3e] = 0x0, [0x3f] = 0x8, [0x40] = 0xb9, [0x41] = 0x43, [0x42] = 0x0, [0x43] = 0x8, [0x44] = 0xb9, [0x45] = 0x43, [0x46] = 0x0, [0x47] = 0x8, [0x48] = 0xb9, [0x49] = 0x43, [0x4a] = 0x0, [0x4b] = 0x8, [0x4c] = 0xb9, [0x4d] = 0x43, [0x4e] = 0x0, [0x4f] = 0x8, [0x50] = 0xb9, [0x51] = 0x43, [0x52] = 0x0, [0x53] = 0x8, [0x54] = 0xb9, [0x55] = 0x43, [0x56] = 0x0, [0x57] = 0x8, [0x58] = 0xb9, [0x59] = 0x43, [0x5a] = 0x0, [0x5b] = 0x8, [0x5c] = 0xb9, [0x5d] = 0x43, [0x5e] = 0x0, [0x5f] = 0x8, [0x60] = 0xb9, [0x61] = 0x43, [0x62] = 0x0, [0x63] = 0x8, [0x64] = 0xb9, [0x65] = 0x43, [0x66] = 0x0, [0x67] = 0x8, [0x68] = 0xb9, [0x69] = 0x43, [0x6a] = 0x0, [0x6b] = 0x8, [0x6c] = 0xb9, [0x6d] = 0x43, [0x6e] = 0x0, [0x6f] = 0x8, [0x70] = 0xb9, [0x71] = 0x43, [0x72] = 0x0, [0x73] = 0x8, [0x74] = 0xb9, [0x75] = 0x43, [0x76] = 0x0, [0x77] = 0x8, [0x78] = 0xb9, [0x79] = 0x43, [0x7a] = 0x0, [0x7b] = 0x8, [0x7c] = 0xb9, [0x7d] = 0x43, [0x7e] = 0x0, [0x7f] = 0x8, [0x80] = 0xb9, [0x81] = 0x43, [0x82] = 0x0, [0x83] = 0x8, [0x84] = 0xb9, [0x85] = 0x43, [0x86] = 0x0, [0x87] = 0x8, [0x88] = 0xb9, [0x89] = 0x43, [0x8a] = 0x0, [0x8b] = 0x8, [0x8c] = 0xb9, [0x8d] = 0x43, [0x8e] = 0x0, [0x8f] = 0x8, [0x90] = 0xb9, [0x91] = 0x43, [0x92] = 0x0, [0x93] = 0x8, [0x94] = 0xb9, [0x95] = 0x43, [0x96] = 0x0, [0x97] = 0x8, [0x98] = 0xb9, [0x99] = 0x43, [0x9a] = 0x0, [0x9b] = 0x8, [0x9c] = 0xb9, [0x9d] = 0x43, [0x9e] = 0x0, [0x9f] = 0x8, [0xa0] = 0xb9, [0xa1] = 0x43, [0xa2] = 0x0, [0xa3] = 0x8, [0xa4] = 0xb9, [0xa5] = 0x43, [0xa6] = 0x0, [0xa7] = 0x8, [0xa8] = 0xb9, [0xa9] = 0x43, [0xaa] = 0x0, [0xab] = 0x8, [0xac] = 0x0, [0xad] = 0x0, [0xae] = 0x0, [0xaf] = 0x0, [0xb0] = 0x0, [0xb1] = 0x0, [0xb2] = 0x0, [0xb3] = 0x0, [0xb4] = 0xb9, [0xb5] = 0x43, [0xb6] = 0x0, [0xb7] = 0x8, [0xb8] = 0xb9, [0xb9] = 0x43, [0xba] = 0x0, [0xbb] = 0x8, [0xbc] = 0x0, [0xbd] = 0x0, [0xbe] = 0x0, [0xbf] = 0x0, [0xc0] = 0x0, [0xc1] = 0x0, [0xc2] = 0x0, [0xc3] = 0x0, [0xc4] = 0xb9, [0xc5] = 0x43, [0xc6] = 0x0, [0xc7] = 0x8, [0xc8] = 0x0, [0xc9] = 0x0, [0xca] = 0x0, [0xcb] = 0x0, [0xcc] = 0x7d, [0xcd] = 0x15...}, + checksum = 0x0, + b_ready = 0x0 +} +Quit +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:86 +warning: Source file is more recent than executable. +86 if (rxc == 0x7E) +### Assembly ################################################################## + 0x080041cc UART1_RxCpltCallback+152 str r2, [r3, #4] + 0x080041ce UART1_RxCpltCallback+154 ldr r3, [pc, #244] ; (0x80042c4 ) + 0x080041d0 UART1_RxCpltCallback+156 movs r2, #2 + 0x080041d2 UART1_RxCpltCallback+158 strb r2, [r3, #0] + 0x080041d4 UART1_RxCpltCallback+160 b.n 0x80042ae + 0x080041d6 UART1_RxCpltCallback+162 ldr r3, [pc, #240] ; (0x80042c8 ) + 0x080041d8 UART1_RxCpltCallback+164 ldrb r3, [r3, #0] + 0x080041da UART1_RxCpltCallback+166 cmp r3, #126 ; 0x7e + 0x080041dc UART1_RxCpltCallback+168 beq.n 0x8004216 + 0x080041de UART1_RxCpltCallback+170 cmp r3, #125 ; 0x7d +### Breakpoints ############################################################### +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000002 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x080041d6 control 0x00 +### Source #################################################################### + 76 default: + 77 { + 78 // shouldnt get here + 79 asm volatile("nop"); + 80 } + 81 }; + 82 } + 83 break; + 84 case SS_FRAME: + 85 { + 86 if (rxc == 0x7E) + 87 { + 88 asm volatile("nop"); + 89 // error occured. bail + 90 #pragma message(Reminder "add a safe escape routine for this") + 91 sstate = SS_IDLE; + 92 memset(&serial_pkt_cb.buffer[serial_pkt_cb.head], 0, sizeof(serial_pkt_t)); + 93 } + 94 else if (rxc == 0x7D) + 95 { +### Stack ##################################################################### +[0] from 0x080041d6 in UART1_RxCpltCallback+162 at shared/drivers/p_serial_mgr.c:86 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x08004320 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:155 +[6] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x080041d6 in UART1_RxCpltCallback+162 at shared/drivers/p_serial_mgr.c:86 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +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: 0x08004368 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9710 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x80098d0 +Loading section .ARM, size 0x8 lma 0x8009da8 +Loading section .init_array, size 0x8 lma 0x8009db0 +Loading section .fini_array, size 0x8 lma 0x8009db8 +Loading section .data, size 0x9a8 lma 0x8009dc0 +Start address 0x08004368, load size 42808 +Transfer rate: 29 KB/sec, 4756 bytes/write. +Breakpoint 1 at 0x800414a: file shared/drivers/p_serial_mgr.c, line 46. +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, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:46 +46 if (rxc == 0x7E) +### Assembly ################################################################## + 0x0800413c UART1_RxCpltCallback+8 bhi.w 0x80042bc + 0x08004140 UART1_RxCpltCallback+12 tbb [pc, r3] + 0x08004144 UART1_RxCpltCallback+16 lsrs r3, r0, #16 + 0x08004146 UART1_RxCpltCallback+18 ldrb r1, [r1, #13] + 0x08004148 UART1_RxCpltCallback+20 lsls r5, r3, #2 +!0x0800414a UART1_RxCpltCallback+22 ldr r3, [pc, #380] ; (0x80042c8 ) + 0x0800414c UART1_RxCpltCallback+24 ldrb r3, [r3, #0] + 0x0800414e UART1_RxCpltCallback+26 cmp r3, #126 ; 0x7e + 0x08004150 UART1_RxCpltCallback+28 bne.w 0x80042ae + 0x08004154 UART1_RxCpltCallback+32 ldr r3, [pc, #364] ; (0x80042c4 ) +### Breakpoints ############################################################### +[1] break at 0x0800414a in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ############################################################### +### History ################################################################### +### Memory #################################################################### +### Registers ################################################################# + r0 0x20000a60 r8 0x00000000 xPSR 0x81000035 + r1 0x00000000 r9 0x00000000 fpscr 0x00000010 + r2 0x40013808 r10 0x00000000 msp 0x2000ff60 + r3 0x00000000 r11 0x00000000 psp 0x00000000 + r4 0x20000a60 r12 0x00001000 primask 0x00 + r5 0x00004001 sp 0x2000ff60 basepri 0x00 + r6 0x00000000 lr 0x0800348f faultmask 0x00 + r7 0x00000000 pc 0x0800414a control 0x00 +### Source #################################################################### + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { +!46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; + 52 case SS_START: + 53 { + 54 switch (start_index_tracker) + 55 { +### Stack ##################################################################### +[0] from 0x0800414a in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +[1] from 0x0800348e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001584 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x08004320 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:155 +[6] from 0x0800151e in main+170 at Core/Src/main.c:146 +### Threads ################################################################### +[1] id 0 from 0x0800414a in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +### Variables ################################################################# +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +############################################################################### +$1 = 0 +$2 = { + src_addr = 0 '\000', + dest_addr = 0 '\000', + len = 134234985, + frame_data = "e\025\000\bg\025\000\bi\025\000\bk\025\000\bm\025\000\b", '\000' , "o\025\000\bq\025\000\b\000\000\000\000s\025\000\bu\025\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\271C\000\b\000\000\000\000\000\000\000\000\271C\000\b\271C\000\b\000\000\000\000\000\000\000\000\271C\000\b"..., + checksum = 0 '\000', + b_ready = false +} +$3 = { + src_addr = 0x0, + dest_addr = 0x0, + len = 0x8004369, + frame_data = {[0x0] = 0x65, [0x1] = 0x15, [0x2] = 0x0, [0x3] = 0x8, [0x4] = 0x67, [0x5] = 0x15, [0x6] = 0x0, [0x7] = 0x8, [0x8] = 0x69, [0x9] = 0x15, [0xa] = 0x0, [0xb] = 0x8, [0xc] = 0x6b, [0xd] = 0x15, [0xe] = 0x0, [0xf] = 0x8, [0x10] = 0x6d, [0x11] = 0x15, [0x12] = 0x0, [0x13] = 0x8, [0x14] = 0x0 , [0x24] = 0x6f, [0x25] = 0x15, [0x26] = 0x0, [0x27] = 0x8, [0x28] = 0x71, [0x29] = 0x15, [0x2a] = 0x0, [0x2b] = 0x8, [0x2c] = 0x0, [0x2d] = 0x0, [0x2e] = 0x0, [0x2f] = 0x0, [0x30] = 0x73, [0x31] = 0x15, [0x32] = 0x0, [0x33] = 0x8, [0x34] = 0x75, [0x35] = 0x15, [0x36] = 0x0, [0x37] = 0x8, [0x38] = 0xb9, [0x39] = 0x43, [0x3a] = 0x0, [0x3b] = 0x8, [0x3c] = 0xb9, [0x3d] = 0x43, [0x3e] = 0x0, [0x3f] = 0x8, [0x40] = 0xb9, [0x41] = 0x43, [0x42] = 0x0, [0x43] = 0x8, [0x44] = 0xb9, [0x45] = 0x43, [0x46] = 0x0, [0x47] = 0x8, [0x48] = 0xb9, [0x49] = 0x43, [0x4a] = 0x0, [0x4b] = 0x8, [0x4c] = 0xb9, [0x4d] = 0x43, [0x4e] = 0x0, [0x4f] = 0x8, [0x50] = 0xb9, [0x51] = 0x43, [0x52] = 0x0, [0x53] = 0x8, [0x54] = 0xb9, [0x55] = 0x43, [0x56] = 0x0, [0x57] = 0x8, [0x58] = 0xb9, [0x59] = 0x43, [0x5a] = 0x0, [0x5b] = 0x8, [0x5c] = 0xb9, [0x5d] = 0x43, [0x5e] = 0x0, [0x5f] = 0x8, [0x60] = 0xb9, [0x61] = 0x43, [0x62] = 0x0, [0x63] = 0x8, [0x64] = 0xb9, [0x65] = 0x43, [0x66] = 0x0, [0x67] = 0x8, [0x68] = 0xb9, [0x69] = 0x43, [0x6a] = 0x0, [0x6b] = 0x8, [0x6c] = 0xb9, [0x6d] = 0x43, [0x6e] = 0x0, [0x6f] = 0x8, [0x70] = 0xb9, [0x71] = 0x43, [0x72] = 0x0, [0x73] = 0x8, [0x74] = 0xb9, [0x75] = 0x43, [0x76] = 0x0, [0x77] = 0x8, [0x78] = 0xb9, [0x79] = 0x43, [0x7a] = 0x0, [0x7b] = 0x8, [0x7c] = 0xb9, [0x7d] = 0x43, [0x7e] = 0x0, [0x7f] = 0x8, [0x80] = 0xb9, [0x81] = 0x43, [0x82] = 0x0, [0x83] = 0x8, [0x84] = 0xb9, [0x85] = 0x43, [0x86] = 0x0, [0x87] = 0x8, [0x88] = 0xb9, [0x89] = 0x43, [0x8a] = 0x0, [0x8b] = 0x8, [0x8c] = 0xb9, [0x8d] = 0x43, [0x8e] = 0x0, [0x8f] = 0x8, [0x90] = 0xb9, [0x91] = 0x43, [0x92] = 0x0, [0x93] = 0x8, [0x94] = 0xb9, [0x95] = 0x43, [0x96] = 0x0, [0x97] = 0x8, [0x98] = 0xb9, [0x99] = 0x43, [0x9a] = 0x0, [0x9b] = 0x8, [0x9c] = 0xb9, [0x9d] = 0x43, [0x9e] = 0x0, [0x9f] = 0x8, [0xa0] = 0xb9, [0xa1] = 0x43, [0xa2] = 0x0, [0xa3] = 0x8, [0xa4] = 0xb9, [0xa5] = 0x43, [0xa6] = 0x0, [0xa7] = 0x8, [0xa8] = 0xb9, [0xa9] = 0x43, [0xaa] = 0x0, [0xab] = 0x8, [0xac] = 0x0, [0xad] = 0x0, [0xae] = 0x0, [0xaf] = 0x0, [0xb0] = 0x0, [0xb1] = 0x0, [0xb2] = 0x0, [0xb3] = 0x0, [0xb4] = 0xb9, [0xb5] = 0x43, [0xb6] = 0x0, [0xb7] = 0x8, [0xb8] = 0xb9, [0xb9] = 0x43, [0xba] = 0x0, [0xbb] = 0x8, [0xbc] = 0x0, [0xbd] = 0x0, [0xbe] = 0x0, [0xbf] = 0x0, [0xc0] = 0x0, [0xc1] = 0x0, [0xc2] = 0x0, [0xc3] = 0x0, [0xc4] = 0xb9, [0xc5] = 0x43, [0xc6] = 0x0, [0xc7] = 0x8, [0xc8] = 0x0, [0xc9] = 0x0, [0xca] = 0x0, [0xcb] = 0x0, [0xcc] = 0x7d, [0xcd] = 0x15...}, + checksum = 0x0, + b_ready = 0x0 +} +Quit +$4 = 268 +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x0800414a in UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:42 +42 switch (sstate) +### Assembly ############################################################################################################################ + 0x0800413c UART1_RxCpltCallback+4 bhi.w 0x80042bc + 0x08004140 UART1_RxCpltCallback+8 tbb [pc, r3] + 0x08004144 UART1_RxCpltCallback+12 lsrs r3, r0, #16 + 0x08004146 UART1_RxCpltCallback+14 ldrb r1, [r1, #13] + 0x08004148 UART1_RxCpltCallback+16 lsls r5, r3, #2 + 0x0800414a UART1_RxCpltCallback+18 ldr r3, [pc, #380] ; (0x80042c8 ) + 0x0800414c UART1_RxCpltCallback+20 ldrb r3, [r3, #0] + 0x0800414e UART1_RxCpltCallback+22 cmp r3, #126 ; 0x7e + 0x08004150 UART1_RxCpltCallback+24 bne.w 0x80042ae + 0x08004154 UART1_RxCpltCallback+28 ldr r3, [pc, #364] ; (0x80042c4 ) +### Breakpoints ######################################################################################################################### +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x20000a60 r4 0x20000a60 r8 0x00000000 r12 0x00001000 xPSR 0x81000035 primask 0x00 + r1 0x00000000 r5 0x00004001 r9 0x00000000 sp 0x2000ff60 fpscr 0x00000010 basepri 0x00 + r2 0x40013808 r6 0x00000000 r10 0x00000000 lr 0x0800348f msp 0x2000ff60 faultmask 0x00 + r3 0x00000000 r7 0x00000000 r11 0x00000000 pc 0x0800414a psp 0x00000000 control 0x00 +### Source ############################################################################################################################## + 32 static serial_pkt_t pkt_bank[10]; + 33 static p_cb_serial_pkt_t serial_pkt_cb; + 34 + 35 static volatile uint8_t start_index_tracker = 0; + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { + 46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; +### Stack ############################################################################################################################### +[0] from 0x0800414a in UART1_RxCpltCallback+18 at shared/drivers/p_serial_mgr.c:42 +[1] from 0x0800348e in UART_RxISR_8BIT+126 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e0 in HAL_UART_IRQHandler+104 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2345 +[3] from 0x08001584 in USART1_IRQHandler+4 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x08004320 in p_serial_mgr_init+4 at shared/drivers/p_serial_mgr.c:145 +[6] from 0x200016b4 in end +### Threads ############################################################################################################################# +[1] id 0 from 0x0800414a in UART1_RxCpltCallback+18 at shared/drivers/p_serial_mgr.c:42 +### Variables ########################################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +######################################################################################################################################### +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: 0x08004368 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9750 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009910 +Loading section .ARM, size 0x8 lma 0x8009de8 +Loading section .init_array, size 0x8 lma 0x8009df0 +Loading section .fini_array, size 0x8 lma 0x8009df8 +Loading section .data, size 0x9a8 lma 0x8009e00 +Start address 0x080043a8, load size 42872 +Transfer rate: 29 KB/sec, 4763 bytes/write. +Breakpoint 1 at 0x800414e: file shared/drivers/p_serial_mgr.c, line 46. +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, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:46 +46 if (rxc == 0x7E) +### Assembly ############################################################################################################################ + 0x08004144 UART1_RxCpltCallback+12 lsrs r3, r0, #16 + 0x08004146 UART1_RxCpltCallback+14 ldrb r1, [r1, #13] + 0x08004148 UART1_RxCpltCallback+16 lsls r5, r3, #2 + 0x0800414a UART1_RxCpltCallback+18 ldr r3, [pc, #380] ; (0x80042c8 ) + 0x0800414c UART1_RxCpltCallback+20 ldrb r3, [r3, #0] +!0x0800414e UART1_RxCpltCallback+22 cmp r3, #126 ; 0x7e + 0x08004150 UART1_RxCpltCallback+24 bne.w 0x80042ae + 0x08004154 UART1_RxCpltCallback+28 ldr r3, [pc, #364] ; (0x80042c4 ) + 0x08004156 UART1_RxCpltCallback+30 movs r2, #1 + 0x08004158 UART1_RxCpltCallback+32 strb r2, [r3, #0] +### Breakpoints ######################################################################################################################### +[1] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x20000a60 r4 0x20000a60 r8 0x00000000 r12 0x00001000 xPSR 0x81000035 primask 0x00 + r1 0x00000000 r5 0x00004001 r9 0x00000000 sp 0x2000ff60 fpscr 0x00000010 basepri 0x00 + r2 0x40013808 r6 0x00000000 r10 0x00000000 lr 0x08003493 msp 0x2000ff60 faultmask 0x00 + r3 0x00000000 r7 0x00000000 r11 0x00000000 pc 0x0800414e psp 0x00000000 control 0x00 +### Source ############################################################################################################################## + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { +!46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; + 52 case SS_START: + 53 { + 54 switch (start_index_tracker) + 55 { +### Stack ############################################################################################################################### +[0] from 0x0800414e in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +[1] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x0800437a in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:162 +[6] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x0800414e in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +### Variables ########################################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +######################################################################################################################################### +$1 = 261 +Continuing. +### Output/messages ##################################################################################################################### +halted: PC: 0x08004150 + +Program received signal SIGINT, Interrupt. +HAL_TIM_IRQHandler (htim=0x20000a14 ) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c:3965 +3965 if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK) != RESET) +### Assembly ############################################################################################################################ + 0x08001af2 HAL_TIM_IRQHandler+198 tst.w r2, #1 + 0x08001af6 HAL_TIM_IRQHandler+202 beq.n 0x8001b00 + 0x08001af8 HAL_TIM_IRQHandler+204 ldr r2, [r3, #12] + 0x08001afa HAL_TIM_IRQHandler+206 tst.w r2, #1 + 0x08001afe HAL_TIM_IRQHandler+210 bne.n 0x8001b80 + 0x08001b00 HAL_TIM_IRQHandler+212 ldr r3, [r4, #0] + 0x08001b02 HAL_TIM_IRQHandler+214 ldr r2, [r3, #16] + 0x08001b04 HAL_TIM_IRQHandler+216 tst.w r2, #128 ; 0x80 + 0x08001b08 HAL_TIM_IRQHandler+220 beq.n 0x8001b12 + 0x08001b0a HAL_TIM_IRQHandler+222 ldr r2, [r3, #12] +### Breakpoints ######################################################################################################################### +[1] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$0 = 261 +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x20000a14 r4 0x20000a14 r8 0x00000000 r12 0x00001000 xPSR 0x21000046 primask 0x00 + r1 0x000000fa r5 0x200009c8 r9 0x00000000 sp 0x2000ff78 fpscr 0x00000010 basepri 0x00 + r2 0x00002e66 r6 0x00000000 r10 0x00000000 lr 0x08001b8d msp 0x2000ff78 faultmask 0x00 + r3 0x00000080 r7 0x00000000 r11 0x00000000 pc 0x08001b00 psp 0x00000000 control 0x00 +### Source ############################################################################################################################## + 3955 { + 3956 __HAL_TIM_CLEAR_IT(htim, TIM_IT_UPDATE); + 3957 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + 3958 htim->PeriodElapsedCallback(htim); + 3959 #else + 3960 HAL_TIM_PeriodElapsedCallback(htim); + 3961 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + 3962 } + 3963 } + 3964 /* TIM Break input event */ + 3965 if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK) != RESET) + 3966 { + 3967 if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_BREAK) != RESET) + 3968 { + 3969 __HAL_TIM_CLEAR_IT(htim, TIM_IT_BREAK); + 3970 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + 3971 htim->BreakCallback(htim); + 3972 #else + 3973 HAL_TIMEx_BreakCallback(htim); + 3974 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +### Stack ############################################################################################################################### +[0] from 0x08001b00 in HAL_TIM_IRQHandler+212 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c:3965 +[1] from 0x080015a8 in TIM6_DAC_IRQHandler+8 at Core/Src/stm32l4xx_it.c:239 +[2] from 0xffffffe9 +[3] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x08001b00 in HAL_TIM_IRQHandler+212 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c:3965 +### Variables ########################################################################################################################### +arg htim = 0x20000a14 : {Instance = 0x40001000,Init = {Prescaler = 127,CounterMode = 0,Period =… +######################################################################################################################################### +Continuing. +### Output/messages ##################################################################################################################### + +Program received signal SIGINT, Interrupt. +0x080014f6 in main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ############################################################################################################################ + 0x080014e6 main+114 bl 0x80019b8 + 0x080014ea main+118 bl 0x8004384 + 0x080014ee main+122 bl 0x8004354 + 0x080014f2 main+126 mov r4, r0 + 0x080014f4 main+128 cmp r0, #0 + 0x080014f6 main+130 beq.n 0x80014ee + 0x080014f8 main+132 ldrb.w r2, [r0, #257] ; 0x101 + 0x080014fc main+136 ldrb.w r1, [r0, #256] ; 0x100 + 0x08001500 main+140 ldr r0, [pc, #80] ; (0x8001554 ) + 0x08001502 main+142 bl 0x800407c +### Breakpoints ######################################################################################################################### +[1] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$0 = 261 +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x00000000 r4 0x00000000 r8 0x00000000 r12 0x00001000 xPSR 0x61000000 primask 0x00 + r1 0x00000000 r5 0x200009c8 r9 0x00000000 sp 0x2000fff0 fpscr 0x00000010 basepri 0x00 + r2 0x00000000 r6 0x00000000 r10 0x00000000 lr 0x080014f3 msp 0x2000fff0 faultmask 0x00 + r3 0x00000000 r7 0x00000000 r11 0x00000000 pc 0x080014f6 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ############################################################################################################################### +[0] from 0x080014f6 in main+130 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x080014f6 in main+130 at Core/Src/main.c:146 +### Variables ########################################################################################################################### +loc pkt = 0x0: {frame_data = "\000\000\001 \251C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\0… +######################################################################################################################################### +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### + +Breakpoint 1, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:46 +46 if (rxc == 0x7E) +### Assembly ############################################################################################################################ + 0x08004140 UART1_RxCpltCallback+8 bhi.w 0x80042f8 + 0x08004144 UART1_RxCpltCallback+12 tbb [pc, r3] + 0x08004148 UART1_RxCpltCallback+16 lsrs r3, r0, #16 + 0x0800414a UART1_RxCpltCallback+18 ldrh r7, [r1, #42] ; 0x2a + 0x0800414c UART1_RxCpltCallback+20 lsls r0, r7, #2 +!0x0800414e UART1_RxCpltCallback+22 ldr r3, [pc, #436] ; (0x8004304 ) + 0x08004150 UART1_RxCpltCallback+24 ldrb r3, [r3, #0] + 0x08004152 UART1_RxCpltCallback+26 cmp r3, #126 ; 0x7e + 0x08004154 UART1_RxCpltCallback+28 bne.w 0x80042ea + 0x08004158 UART1_RxCpltCallback+32 ldr r3, [pc, #420] ; (0x8004300 ) +### Breakpoints ######################################################################################################################### +[1] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$0 = 261 +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x20000a60 r4 0x20000a60 r8 0x00000000 r12 0x00001000 xPSR 0x81000035 primask 0x00 + r1 0x00000000 r5 0x00004001 r9 0x00000000 sp 0x2000ff60 fpscr 0x00000010 basepri 0x00 + r2 0x40013808 r6 0x00000000 r10 0x00000000 lr 0x08003493 msp 0x2000ff60 faultmask 0x00 + r3 0x00000000 r7 0x00000000 r11 0x00000000 pc 0x0800414e psp 0x00000000 control 0x00 +### Source ############################################################################################################################## + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { +!46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; + 52 case SS_START: + 53 { + 54 switch (start_index_tracker) + 55 { +### Stack ############################################################################################################################### +[0] from 0x0800414e in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +[1] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x08004354 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:155 +[6] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x0800414e in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +### Variables ########################################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +######################################################################################################################################### +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### + +Breakpoint 1, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:46 +46 if (rxc == 0x7E) +### Assembly ############################################################################################################################ + 0x08004140 UART1_RxCpltCallback+8 bhi.w 0x80042f8 + 0x08004144 UART1_RxCpltCallback+12 tbb [pc, r3] + 0x08004148 UART1_RxCpltCallback+16 lsrs r3, r0, #16 + 0x0800414a UART1_RxCpltCallback+18 ldrh r7, [r1, #42] ; 0x2a + 0x0800414c UART1_RxCpltCallback+20 lsls r0, r7, #2 +!0x0800414e UART1_RxCpltCallback+22 ldr r3, [pc, #436] ; (0x8004304 ) + 0x08004150 UART1_RxCpltCallback+24 ldrb r3, [r3, #0] + 0x08004152 UART1_RxCpltCallback+26 cmp r3, #126 ; 0x7e + 0x08004154 UART1_RxCpltCallback+28 bne.w 0x80042ea + 0x08004158 UART1_RxCpltCallback+32 ldr r3, [pc, #420] ; (0x8004300 ) +### Breakpoints ######################################################################################################################### +[1] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$0 = 261 +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x20000a60 r4 0x20000a60 r8 0x00000000 r12 0x00001000 xPSR 0x81000035 primask 0x00 + r1 0x00000000 r5 0x00004001 r9 0x00000000 sp 0x2000ff60 fpscr 0x00000010 basepri 0x00 + r2 0x40013808 r6 0x00000000 r10 0x00000000 lr 0x08003493 msp 0x2000ff60 faultmask 0x00 + r3 0x00000000 r7 0x00000000 r11 0x00000000 pc 0x0800414e psp 0x00000000 control 0x00 +### Source ############################################################################################################################## + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { +!46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; + 52 case SS_START: + 53 { + 54 switch (start_index_tracker) + 55 { +### Stack ############################################################################################################################### +[0] from 0x0800414e in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +[1] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x0800435a in p_serial_mgr_init+50 at shared/drivers/p_serial_mgr.c:151 +[6] from 0x2000166c in heap_end +### Threads ############################################################################################################################# +[1] id 0 from 0x0800414e in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +### Variables ########################################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +######################################################################################################################################### +Continuing. +### Output/messages ##################################################################################################################### +halted: PC: 0x08004150 + +Program received signal SIGINT, Interrupt. +0x080014f2 in main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ############################################################################################################################ + 0x080014e0 main+108 bl 0x8003f6c + 0x080014e4 main+112 ldr r0, [pc, #104] ; (0x8001550 ) + 0x080014e6 main+114 bl 0x80019b8 + 0x080014ea main+118 bl 0x8004384 + 0x080014ee main+122 bl 0x8004354 + 0x080014f2 main+126 mov r4, r0 + 0x080014f4 main+128 cmp r0, #0 + 0x080014f6 main+130 beq.n 0x80014ee + 0x080014f8 main+132 ldrb.w r2, [r0, #257] ; 0x101 + 0x080014fc main+136 ldrb.w r1, [r0, #256] ; 0x100 +### Breakpoints ######################################################################################################################### +[1] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$0 = 261 +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x00000000 r4 0x00000000 r8 0x00000000 r12 0x00001000 xPSR 0x61000000 primask 0x00 + r1 0x00000000 r5 0x200009c8 r9 0x00000000 sp 0x2000fff0 fpscr 0x00000010 basepri 0x00 + r2 0x00000000 r6 0x00000000 r10 0x00000000 lr 0x080014f3 msp 0x2000fff0 faultmask 0x00 + r3 0x00000000 r7 0x00000000 r11 0x00000000 pc 0x080014f2 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 136 while (1) + 137 { + 138 // if (b_timer_struck) + 139 // { + 140 // // PDEBUG("%d\n", sys_time); + 141 // b_timer_struck = false; + 142 // motor_degrees = (motor_degrees + 1) % 360; + 143 // mc_service(motor_degrees, 50); + 144 // } + 145 serial_pkt_t *pkt = NULL; + 146 if ((pkt = p_serial_mgr_service()) != NULL) + 147 { + 148 PDEBUG("Source: %02x\n" + 149 "Destination: %02x\n", + 150 pkt->src_addr, pkt->dest_addr); + 151 PDEBUG("Frame Data: \n"); + 152 for (int ind = 0; ind < pkt->len; pkt++) + 153 { + 154 if (ind % 8 == 0) + 155 { +### Stack ############################################################################################################################### +[0] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Variables ########################################################################################################################### +loc pkt = 0x0: {frame_data = "\000\000\001 \251C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\0… +######################################################################################################################################### +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### + +Breakpoint 1, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:46 +46 if (rxc == 0x7E) +### Assembly ############################################################################################################################ + 0x08004140 UART1_RxCpltCallback+8 bhi.w 0x80042f8 + 0x08004144 UART1_RxCpltCallback+12 tbb [pc, r3] + 0x08004148 UART1_RxCpltCallback+16 lsrs r3, r0, #16 + 0x0800414a UART1_RxCpltCallback+18 ldrh r7, [r1, #42] ; 0x2a + 0x0800414c UART1_RxCpltCallback+20 lsls r0, r7, #2 +!0x0800414e UART1_RxCpltCallback+22 ldr r3, [pc, #436] ; (0x8004304 ) + 0x08004150 UART1_RxCpltCallback+24 ldrb r3, [r3, #0] + 0x08004152 UART1_RxCpltCallback+26 cmp r3, #126 ; 0x7e + 0x08004154 UART1_RxCpltCallback+28 bne.w 0x80042ea + 0x08004158 UART1_RxCpltCallback+32 ldr r3, [pc, #420] ; (0x8004300 ) +### Breakpoints ######################################################################################################################### +[1] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$0 = 261 +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x20000a60 r4 0x20000a60 r8 0x00000000 r12 0x00001000 xPSR 0x81000035 primask 0x00 + r1 0x00000000 r5 0x00004001 r9 0x00000000 sp 0x2000ff60 fpscr 0x00000010 basepri 0x00 + r2 0x40013808 r6 0x00000000 r10 0x00000000 lr 0x08003493 msp 0x2000ff60 faultmask 0x00 + r3 0x00000000 r7 0x00000000 r11 0x00000000 pc 0x0800414e psp 0x00000000 control 0x00 +### Source ############################################################################################################################## + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { +!46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; + 52 case SS_START: + 53 { + 54 switch (start_index_tracker) + 55 { +### Stack ############################################################################################################################### +[0] from 0x0800414e in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +[1] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x08004354 in p_serial_mgr_init+44 at shared/drivers/p_serial_mgr.c:151 +[6] from 0x2000166c in heap_end +### Threads ############################################################################################################################# +[1] id 0 from 0x0800414e in UART1_RxCpltCallback+22 at shared/drivers/p_serial_mgr.c:46 +### Variables ########################################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +######################################################################################################################################### +$2 = 261 +$3 = { + frame_data = {[0x0] = 0x0, [0x1] = 0x0, [0x2] = 0x1, [0x3] = 0x20, [0x4] = 0xa9, [0x5] = 0x43, [0x6] = 0x0, [0x7] = 0x8, [0x8] = 0x69, [0x9] = 0x15, [0xa] = 0x0, [0xb] = 0x8, [0xc] = 0x6b, [0xd] = 0x15, [0xe] = 0x0, [0xf] = 0x8, [0x10] = 0x6d, [0x11] = 0x15, [0x12] = 0x0, [0x13] = 0x8, [0x14] = 0x6f, [0x15] = 0x15, [0x16] = 0x0, [0x17] = 0x8, [0x18] = 0x71, [0x19] = 0x15, [0x1a] = 0x0, [0x1b] = 0x8, [0x1c] = 0x0 , [0x2c] = 0x73, [0x2d] = 0x15, [0x2e] = 0x0, [0x2f] = 0x8, [0x30] = 0x75, [0x31] = 0x15, [0x32] = 0x0, [0x33] = 0x8, [0x34] = 0x0, [0x35] = 0x0, [0x36] = 0x0, [0x37] = 0x0, [0x38] = 0x77, [0x39] = 0x15, [0x3a] = 0x0, [0x3b] = 0x8, [0x3c] = 0x79, [0x3d] = 0x15, [0x3e] = 0x0, [0x3f] = 0x8, [0x40] = 0xf9, [0x41] = 0x43, [0x42] = 0x0, [0x43] = 0x8, [0x44] = 0xf9, [0x45] = 0x43, [0x46] = 0x0, [0x47] = 0x8, [0x48] = 0xf9, [0x49] = 0x43, [0x4a] = 0x0, [0x4b] = 0x8, [0x4c] = 0xf9, [0x4d] = 0x43, [0x4e] = 0x0, [0x4f] = 0x8, [0x50] = 0xf9, [0x51] = 0x43, [0x52] = 0x0, [0x53] = 0x8, [0x54] = 0xf9, [0x55] = 0x43, [0x56] = 0x0, [0x57] = 0x8, [0x58] = 0xf9, [0x59] = 0x43, [0x5a] = 0x0, [0x5b] = 0x8, [0x5c] = 0xf9, [0x5d] = 0x43, [0x5e] = 0x0, [0x5f] = 0x8, [0x60] = 0xf9, [0x61] = 0x43, [0x62] = 0x0, [0x63] = 0x8, [0x64] = 0xf9, [0x65] = 0x43, [0x66] = 0x0, [0x67] = 0x8, [0x68] = 0xf9, [0x69] = 0x43, [0x6a] = 0x0, [0x6b] = 0x8, [0x6c] = 0xf9, [0x6d] = 0x43, [0x6e] = 0x0, [0x6f] = 0x8, [0x70] = 0xf9, [0x71] = 0x43, [0x72] = 0x0, [0x73] = 0x8, [0x74] = 0xf9, [0x75] = 0x43, [0x76] = 0x0, [0x77] = 0x8, [0x78] = 0xf9, [0x79] = 0x43, [0x7a] = 0x0, [0x7b] = 0x8, [0x7c] = 0xf9, [0x7d] = 0x43, [0x7e] = 0x0, [0x7f] = 0x8, [0x80] = 0xf9, [0x81] = 0x43, [0x82] = 0x0, [0x83] = 0x8, [0x84] = 0xf9, [0x85] = 0x43, [0x86] = 0x0, [0x87] = 0x8, [0x88] = 0xf9, [0x89] = 0x43, [0x8a] = 0x0, [0x8b] = 0x8, [0x8c] = 0xf9, [0x8d] = 0x43, [0x8e] = 0x0, [0x8f] = 0x8, [0x90] = 0xf9, [0x91] = 0x43, [0x92] = 0x0, [0x93] = 0x8, [0x94] = 0xf9, [0x95] = 0x43, [0x96] = 0x0, [0x97] = 0x8, [0x98] = 0xf9, [0x99] = 0x43, [0x9a] = 0x0, [0x9b] = 0x8, [0x9c] = 0xf9, [0x9d] = 0x43, [0x9e] = 0x0, [0x9f] = 0x8, [0xa0] = 0xf9, [0xa1] = 0x43, [0xa2] = 0x0, [0xa3] = 0x8, [0xa4] = 0xf9, [0xa5] = 0x43, [0xa6] = 0x0, [0xa7] = 0x8, [0xa8] = 0xf9, [0xa9] = 0x43, [0xaa] = 0x0, [0xab] = 0x8, [0xac] = 0xf9, [0xad] = 0x43, [0xae] = 0x0, [0xaf] = 0x8, [0xb0] = 0xf9, [0xb1] = 0x43, [0xb2] = 0x0, [0xb3] = 0x8, [0xb4] = 0x0, [0xb5] = 0x0, [0xb6] = 0x0, [0xb7] = 0x0, [0xb8] = 0x0, [0xb9] = 0x0, [0xba] = 0x0, [0xbb] = 0x0, [0xbc] = 0xf9, [0xbd] = 0x43, [0xbe] = 0x0, [0xbf] = 0x8, [0xc0] = 0xf9, [0xc1] = 0x43, [0xc2] = 0x0, [0xc3] = 0x8, [0xc4] = 0x0, [0xc5] = 0x0, [0xc6] = 0x0, [0xc7] = 0x0, [0xc8] = 0x0, [0xc9] = 0x0, [0xca] = 0x0, [0xcb] = 0x0, [0xcc] = 0xf9, [0xcd] = 0x43...}, + src_addr = 0x0, + dest_addr = 0x0, + checksum = 0x0, + len = 0x0, + b_ready = 0x0 +} +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### + +Breakpoint 1, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:46 +46 if (rxc == 0x7E) +### Assembly ############################################################################################################################ + 0x08004148 UART1_RxCpltCallback+16 lsrs r3, r0, #16 + 0x0800414a UART1_RxCpltCallback+18 ldrh r7, [r1, #42] ; 0x2a + 0x0800414c UART1_RxCpltCallback+20 lsls r0, r7, #2 + 0x0800414e UART1_RxCpltCallback+22 ldr r3, [pc, #436] ; (0x8004304 ) + 0x08004150 UART1_RxCpltCallback+24 ldrb r3, [r3, #0] +!0x08004152 UART1_RxCpltCallback+26 cmp r3, #126 ; 0x7e + 0x08004154 UART1_RxCpltCallback+28 bne.w 0x80042ea + 0x08004158 UART1_RxCpltCallback+32 ldr r3, [pc, #420] ; (0x8004300 ) + 0x0800415a UART1_RxCpltCallback+34 movs r2, #1 + 0x0800415c UART1_RxCpltCallback+36 strb r2, [r3, #0] +### Breakpoints ######################################################################################################################### +[1] break at 0x08004152 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$2 = 261 +$$1 = 261 +$$0 = {frame_data = "\000\000\001 \251C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\025\000\b", '\0… +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x20000a60 r4 0x20000a60 r8 0x00000000 r12 0x00001000 xPSR 0x81000035 primask 0x00 + r1 0x00000000 r5 0x00004001 r9 0x00000000 sp 0x2000ff60 fpscr 0x00000010 basepri 0x00 + r2 0x40013808 r6 0x00000000 r10 0x00000000 lr 0x08003493 msp 0x2000ff60 faultmask 0x00 + r3 0x0000007e r7 0x00000000 r11 0x00000000 pc 0x08004152 psp 0x00000000 control 0x00 +### Source ############################################################################################################################## + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { +!46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; + 52 case SS_START: + 53 { + 54 switch (start_index_tracker) + 55 { +### Stack ############################################################################################################################### +[0] from 0x08004152 in UART1_RxCpltCallback+26 at shared/drivers/p_serial_mgr.c:46 +[1] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x08004354 in p_serial_mgr_init+4 at shared/drivers/p_serial_mgr.c:146 +[6] from 0x2000166c in heap_end +### Threads ############################################################################################################################# +[1] id 0 from 0x08004152 in UART1_RxCpltCallback+26 at shared/drivers/p_serial_mgr.c:46 +### Variables ########################################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +######################################################################################################################################### +$4 = { + frame_data = {[0x0] = 0x0, [0x1] = 0x0, [0x2] = 0x1, [0x3] = 0x20, [0x4] = 0xa9, [0x5] = 0x43, [0x6] = 0x0, [0x7] = 0x8, [0x8] = 0x69, [0x9] = 0x15, [0xa] = 0x0, [0xb] = 0x8, [0xc] = 0x6b, [0xd] = 0x15, [0xe] = 0x0, [0xf] = 0x8, [0x10] = 0x6d, [0x11] = 0x15, [0x12] = 0x0, [0x13] = 0x8, [0x14] = 0x6f, [0x15] = 0x15, [0x16] = 0x0, [0x17] = 0x8, [0x18] = 0x71, [0x19] = 0x15, [0x1a] = 0x0, [0x1b] = 0x8, [0x1c] = 0x0 , [0x2c] = 0x73, [0x2d] = 0x15, [0x2e] = 0x0, [0x2f] = 0x8, [0x30] = 0x75, [0x31] = 0x15, [0x32] = 0x0, [0x33] = 0x8, [0x34] = 0x0, [0x35] = 0x0, [0x36] = 0x0, [0x37] = 0x0, [0x38] = 0x77, [0x39] = 0x15, [0x3a] = 0x0, [0x3b] = 0x8, [0x3c] = 0x79, [0x3d] = 0x15, [0x3e] = 0x0, [0x3f] = 0x8, [0x40] = 0xf9, [0x41] = 0x43, [0x42] = 0x0, [0x43] = 0x8, [0x44] = 0xf9, [0x45] = 0x43, [0x46] = 0x0, [0x47] = 0x8, [0x48] = 0xf9, [0x49] = 0x43, [0x4a] = 0x0, [0x4b] = 0x8, [0x4c] = 0xf9, [0x4d] = 0x43, [0x4e] = 0x0, [0x4f] = 0x8, [0x50] = 0xf9, [0x51] = 0x43, [0x52] = 0x0, [0x53] = 0x8, [0x54] = 0xf9, [0x55] = 0x43, [0x56] = 0x0, [0x57] = 0x8, [0x58] = 0xf9, [0x59] = 0x43, [0x5a] = 0x0, [0x5b] = 0x8, [0x5c] = 0xf9, [0x5d] = 0x43, [0x5e] = 0x0, [0x5f] = 0x8, [0x60] = 0xf9, [0x61] = 0x43, [0x62] = 0x0, [0x63] = 0x8, [0x64] = 0xf9, [0x65] = 0x43, [0x66] = 0x0, [0x67] = 0x8, [0x68] = 0xf9, [0x69] = 0x43, [0x6a] = 0x0, [0x6b] = 0x8, [0x6c] = 0xf9, [0x6d] = 0x43, [0x6e] = 0x0, [0x6f] = 0x8, [0x70] = 0xf9, [0x71] = 0x43, [0x72] = 0x0, [0x73] = 0x8, [0x74] = 0xf9, [0x75] = 0x43, [0x76] = 0x0, [0x77] = 0x8, [0x78] = 0xf9, [0x79] = 0x43, [0x7a] = 0x0, [0x7b] = 0x8, [0x7c] = 0xf9, [0x7d] = 0x43, [0x7e] = 0x0, [0x7f] = 0x8, [0x80] = 0xf9, [0x81] = 0x43, [0x82] = 0x0, [0x83] = 0x8, [0x84] = 0xf9, [0x85] = 0x43, [0x86] = 0x0, [0x87] = 0x8, [0x88] = 0xf9, [0x89] = 0x43, [0x8a] = 0x0, [0x8b] = 0x8, [0x8c] = 0xf9, [0x8d] = 0x43, [0x8e] = 0x0, [0x8f] = 0x8, [0x90] = 0xf9, [0x91] = 0x43, [0x92] = 0x0, [0x93] = 0x8, [0x94] = 0xf9, [0x95] = 0x43, [0x96] = 0x0, [0x97] = 0x8, [0x98] = 0xf9, [0x99] = 0x43, [0x9a] = 0x0, [0x9b] = 0x8, [0x9c] = 0xf9, [0x9d] = 0x43, [0x9e] = 0x0, [0x9f] = 0x8, [0xa0] = 0xf9, [0xa1] = 0x43, [0xa2] = 0x0, [0xa3] = 0x8, [0xa4] = 0xf9, [0xa5] = 0x43, [0xa6] = 0x0, [0xa7] = 0x8, [0xa8] = 0xf9, [0xa9] = 0x43, [0xaa] = 0x0, [0xab] = 0x8, [0xac] = 0xf9, [0xad] = 0x43, [0xae] = 0x0, [0xaf] = 0x8, [0xb0] = 0xf9, [0xb1] = 0x43, [0xb2] = 0x0, [0xb3] = 0x8, [0xb4] = 0x0, [0xb5] = 0x0, [0xb6] = 0x0, [0xb7] = 0x0, [0xb8] = 0x0, [0xb9] = 0x0, [0xba] = 0x0, [0xbb] = 0x0, [0xbc] = 0xf9, [0xbd] = 0x43, [0xbe] = 0x0, [0xbf] = 0x8, [0xc0] = 0xf9, [0xc1] = 0x43, [0xc2] = 0x0, [0xc3] = 0x8, [0xc4] = 0x0, [0xc5] = 0x0, [0xc6] = 0x0, [0xc7] = 0x0, [0xc8] = 0x0, [0xc9] = 0x0, [0xca] = 0x0, [0xcb] = 0x0, [0xcc] = 0xf9, [0xcd] = 0x43...}, + src_addr = 0x0, + dest_addr = 0x0, + checksum = 0x0, + len = 0x0, + b_ready = 0x0 +} +Continuing. +### Output/messages ##################################################################################################################### +halted: PC: 0x08004154 + +Program received signal SIGINT, Interrupt. +0x0800437c in p_serial_mgr_init (huart=) at shared/drivers/p_serial_mgr.c:151 +151 } +### Assembly ############################################################################################################################ + 0x08004370 p_serial_mgr_init+32 ldrb.w r2, [r0, #260] ; 0x104 + 0x08004374 p_serial_mgr_init+36 cmp r2, #0 + 0x08004376 p_serial_mgr_init+38 beq.n 0x8004358 + 0x08004378 p_serial_mgr_init+40 b.n 0x800437c + 0x0800437a p_serial_mgr_init+42 movs r0, #0 + 0x0800437c p_serial_mgr_init+44 bx lr + 0x0800437e p_serial_mgr_init+46 nop + 0x08004380 p_serial_mgr_init+48 asrs r4, r2, #24 + 0x08004382 p_serial_mgr_init+50 movs r0, #0 + 0x08004384 p_serial_mgr_init+52 push {r3, lr} +### Breakpoints ######################################################################################################################### +[1] break at 0x08004152 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$2 = 261 +$$1 = {frame_data = "\000\000\001 \251C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\025\000\b", '\0… +$$0 = {frame_data = "\000\000\001 \251C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\025\000\b", '\0… +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x00000000 r4 0x00000000 r8 0x00000000 r12 0x00001000 xPSR 0x61000000 primask 0x00 + r1 0x00000000 r5 0x200009c8 r9 0x00000000 sp 0x2000fff0 fpscr 0x00000010 basepri 0x00 + r2 0x00000000 r6 0x00000000 r10 0x00000000 lr 0x080014f3 msp 0x2000fff0 faultmask 0x00 + r3 0x00000000 r7 0x00000000 r11 0x00000000 pc 0x0800437c psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 141 // HAL_UART_Receive_IT(&huart1, &huart1_rxc, 1); + 142 // HAL_GPIO_WritePin(USART1_DE_GPIO_Port, USART1_DE_Pin, 0); + 143 } + 144 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 145 { + 146 _serial_huart_inst = huart; + 147 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 148 + 149 memset(pkt_bank, 0, sizeof(serial_pkt_t) * 10); + 150 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 151 } + 152 + 153 serial_pkt_t *p_serial_mgr_service(void) + 154 { + 155 // this will be less garbage when i switch to a queue + 156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 157 { + 158 if (serial_pkt_cb.buffer[ind].b_ready) + 159 { + 160 return &serial_pkt_cb.buffer[ind]; +### Stack ############################################################################################################################### +[0] from 0x0800437c in p_serial_mgr_init+44 at shared/drivers/p_serial_mgr.c:151 +[1] from 0x2000166c in heap_end +### Threads ############################################################################################################################# +[1] id 0 from 0x0800437c in p_serial_mgr_init+44 at shared/drivers/p_serial_mgr.c:151 +### Variables ########################################################################################################################### +arg huart = +######################################################################################################################################### +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### + +Breakpoint 1, UART1_RxCpltCallback (huart=0x20000a60 ) at shared/drivers/p_serial_mgr.c:46 +46 if (rxc == 0x7E) +### Assembly ############################################################################################################################ + 0x08004148 UART1_RxCpltCallback+16 lsrs r3, r0, #16 + 0x0800414a UART1_RxCpltCallback+18 ldrh r7, [r1, #42] ; 0x2a + 0x0800414c UART1_RxCpltCallback+20 lsls r0, r7, #2 + 0x0800414e UART1_RxCpltCallback+22 ldr r3, [pc, #436] ; (0x8004304 ) + 0x08004150 UART1_RxCpltCallback+24 ldrb r3, [r3, #0] +!0x08004152 UART1_RxCpltCallback+26 cmp r3, #126 ; 0x7e + 0x08004154 UART1_RxCpltCallback+28 bne.w 0x80042ea + 0x08004158 UART1_RxCpltCallback+32 ldr r3, [pc, #420] ; (0x8004300 ) + 0x0800415a UART1_RxCpltCallback+34 movs r2, #1 + 0x0800415c UART1_RxCpltCallback+36 strb r2, [r3, #0] +### Breakpoints ######################################################################################################################### +[1] break at 0x08004152 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$2 = 261 +$$1 = {frame_data = "\000\000\001 \251C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\025\000\b", '\0… +$$0 = {frame_data = "\000\000\001 \251C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\025\000\b", '\0… +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x20000a60 r4 0x20000a60 r8 0x00000000 r12 0x00001000 xPSR 0x81000035 primask 0x00 + r1 0x00000000 r5 0x00004001 r9 0x00000000 sp 0x2000ff60 fpscr 0x00000010 basepri 0x00 + r2 0x40013808 r6 0x00000000 r10 0x00000000 lr 0x08003493 msp 0x2000ff60 faultmask 0x00 + r3 0x0000007e r7 0x00000000 r11 0x00000000 pc 0x08004152 psp 0x00000000 control 0x00 +### Source ############################################################################################################################## + 36 static volatile uint8_t frame_index_tracker = 0; + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 switch (sstate) + 43 { + 44 case SS_IDLE: // packet start + 45 { +!46 if (rxc == 0x7E) + 47 { + 48 sstate = SS_START; + 49 } + 50 } + 51 break; + 52 case SS_START: + 53 { + 54 switch (start_index_tracker) + 55 { +### Stack ############################################################################################################################### +[0] from 0x08004152 in UART1_RxCpltCallback+26 at shared/drivers/p_serial_mgr.c:46 +[1] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x08004360 in p_serial_mgr_init+16 at shared/drivers/p_serial_mgr.c:149 +[6] from 0x2000166c in heap_end +### Threads ############################################################################################################################# +[1] id 0 from 0x08004152 in UART1_RxCpltCallback+26 at shared/drivers/p_serial_mgr.c:46 +### Variables ########################################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +######################################################################################################################################### +Continuing. +### Output/messages ##################################################################################################################### +halted: PC: 0x08004154 + +Program received signal SIGINT, Interrupt. +p_serial_mgr_init (huart=0x0) at shared/drivers/p_serial_mgr.c:149 +149 memset(pkt_bank, 0, sizeof(serial_pkt_t) * 10); +### Assembly ############################################################################################################################ + 0x08004352 p_serial_mgr_init+2 movs r0, #0 + 0x08004354 p_serial_mgr_init+4 movs r3, #0 + 0x08004356 p_serial_mgr_init+6 b.n 0x800435a + 0x08004358 p_serial_mgr_init+8 adds r3, #1 + 0x0800435a p_serial_mgr_init+10 ldr r2, [pc, #36] ; (0x8004380 ) + 0x0800435c p_serial_mgr_init+12 ldrh r2, [r2, #6] + 0x0800435e p_serial_mgr_init+14 cmp r2, r3 + 0x08004360 p_serial_mgr_init+16 ble.n 0x800437a + 0x08004362 p_serial_mgr_init+18 ldr r2, [pc, #28] ; (0x8004380 ) + 0x08004364 p_serial_mgr_init+20 ldr r0, [r2, #0] +### Breakpoints ######################################################################################################################### +[1] break at 0x08004152 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 hit 1 time +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +$$2 = 261 +$$1 = {frame_data = "\000\000\001 \251C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\025\000\b", '\0… +$$0 = {frame_data = "\000\000\001 \251C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\025\000\b", '\0… +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x00000000 r4 0x00000000 r8 0x00000000 r12 0x00001000 xPSR 0x61000000 primask 0x00 + r1 0x00000000 r5 0x200009c8 r9 0x00000000 sp 0x2000fff0 fpscr 0x00000010 basepri 0x00 + r2 0x20001614 r6 0x00000000 r10 0x00000000 lr 0x080014f3 msp 0x2000fff0 faultmask 0x00 + r3 0x00000000 r7 0x00000000 r11 0x00000000 pc 0x0800435c psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 139 + 140 // HAL_UART_Transmit(&huart2, &huart2_rxc, 1, 500); + 141 // HAL_UART_Receive_IT(&huart1, &huart1_rxc, 1); + 142 // HAL_GPIO_WritePin(USART1_DE_GPIO_Port, USART1_DE_Pin, 0); + 143 } + 144 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 145 { + 146 _serial_huart_inst = huart; + 147 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 148 + 149 memset(pkt_bank, 0, sizeof(serial_pkt_t) * 10); + 150 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 151 } + 152 + 153 serial_pkt_t *p_serial_mgr_service(void) + 154 { + 155 // this will be less garbage when i switch to a queue + 156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 157 { + 158 if (serial_pkt_cb.buffer[ind].b_ready) +### Stack ############################################################################################################################### +[0] from 0x0800435c in p_serial_mgr_init+12 at shared/drivers/p_serial_mgr.c:149 +[1] from 0x2000166c in heap_end +### Threads ############################################################################################################################# +[1] id 0 from 0x0800435c in p_serial_mgr_init+12 at shared/drivers/p_serial_mgr.c:149 +### Variables ########################################################################################################################### +arg huart = 0x0: {Instance = 0x20010000,Init = {BaudRate = 134235049,WordLength = 134223209,StopBits = … +######################################################################################################################################### +Quit +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] diff --git a/shared/drivers/p_serial_mgr.c b/shared/drivers/p_serial_mgr.c index 75c03c5..a5f3fb9 100644 --- a/shared/drivers/p_serial_mgr.c +++ b/shared/drivers/p_serial_mgr.c @@ -29,8 +29,8 @@ static UART_HandleTypeDef *_serial_huart_inst = NULL; static serial_state_t sstate = SS_IDLE; static uint8_t rxc = '\0'; -static serial_pkt_t pkt_bank[10]; -static p_cb_serial_pkt_t serial_pkt_cb; +volatile serial_pkt_t pkt_bank[10]; +volatile p_cb_serial_pkt_t serial_pkt_cb; static volatile uint8_t start_index_tracker = 0; static volatile uint8_t frame_index_tracker = 0; @@ -56,24 +56,27 @@ void UART1_RxCpltCallback(UART_HandleTypeDef *huart) case 0: // source addr { serial_pkt_cb.buffer[serial_pkt_cb.head].src_addr = rxc; + start_index_tracker++; } break; case 1: { serial_pkt_cb.buffer[serial_pkt_cb.head].dest_addr = rxc; + start_index_tracker++; } break; case 2: { - serial_pkt_cb.buffer[serial_pkt_cb.head].len = rxc; + start_index_tracker = 0; frame_index_tracker = 0; + serial_pkt_cb.buffer[serial_pkt_cb.head].len = rxc; sstate = SS_FRAME; } break; default: { // shouldnt get here - for (;;) {} + asm volatile("nop"); } }; } @@ -82,8 +85,11 @@ void UART1_RxCpltCallback(UART_HandleTypeDef *huart) { if (rxc == 0x7E) { + asm volatile("nop"); // error occured. bail #pragma message(Reminder "add a safe escape routine for this") + sstate = SS_IDLE; + memset(&serial_pkt_cb.buffer[serial_pkt_cb.head], 0, sizeof(serial_pkt_t)); } else if (rxc == 0x7D) { @@ -92,7 +98,7 @@ void UART1_RxCpltCallback(UART_HandleTypeDef *huart) else { serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc; - if (frame_index_tracker + 1 == serial_pkt_cb.buffer[serial_pkt_cb.head].len) + if (frame_index_tracker >= serial_pkt_cb.buffer[serial_pkt_cb.head].len) { sstate = SS_CHECKSUM; } @@ -102,17 +108,23 @@ void UART1_RxCpltCallback(UART_HandleTypeDef *huart) case SS_ESC: { serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc ^ 0x20; - if (frame_index_tracker + 1 == serial_pkt_cb.buffer[serial_pkt_cb.head].len) + if (frame_index_tracker >= serial_pkt_cb.buffer[serial_pkt_cb.head].len) { sstate = SS_CHECKSUM; } + else + { + sstate = SS_FRAME; + } } break; case SS_CHECKSUM: { + frame_index_tracker = 0; serial_pkt_cb.buffer[serial_pkt_cb.head].checksum = rxc; serial_pkt_cb.buffer[serial_pkt_cb.head].b_ready = true; serial_pkt_cb.head = (serial_pkt_cb.head + 1) % serial_pkt_cb.max_len; + sstate = SS_IDLE; } break; default: @@ -134,6 +146,7 @@ void p_serial_mgr_init(UART_HandleTypeDef *huart) _serial_huart_inst = huart; _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + memset(pkt_bank, 0, sizeof(serial_pkt_t) * 10); p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); } @@ -144,7 +157,7 @@ serial_pkt_t *p_serial_mgr_service(void) { if (serial_pkt_cb.buffer[ind].b_ready) { - return &serial_pkt_cb.buffer; + return &serial_pkt_cb.buffer[ind]; } } return NULL; diff --git a/shared/drivers/p_serial_mgr.h b/shared/drivers/p_serial_mgr.h index 5711670..3d09ca0 100644 --- a/shared/drivers/p_serial_mgr.h +++ b/shared/drivers/p_serial_mgr.h @@ -6,11 +6,11 @@ typedef struct serial_pkt_t { + uint8_t frame_data[256]; uint8_t src_addr; uint8_t dest_addr; - int len; - uint8_t frame_data[256]; uint8_t checksum; + uint8_t len; bool b_ready; } serial_pkt_t; @@ -18,4 +18,6 @@ void p_serial_mgr_init(UART_HandleTypeDef *huart); serial_pkt_t *p_serial_mgr_service(void); +void p_serial_mgr_start(); + #endif diff --git a/shared/util/PCircularBuffer.c b/shared/util/PCircularBuffer.c index 4d8177b..a08199f 100644 --- a/shared/util/PCircularBuffer.c +++ b/shared/util/PCircularBuffer.c @@ -122,6 +122,10 @@ PB_CB_STATUS p_cb_serial_pkt_init(p_cb_serial_pkt_t *inst, serial_pkt_t *buff, u ret = PB_CB_BAD_BUFFER_SIZE; break; } + for (int ind = 0; ind < max_length; ind++) + { + memset(inst->buffer[ind].frame_data, 0, 256); + } } while (0); // Debugging