From 9f0877c746c59140a445660c1364709bf2e4ccdb Mon Sep 17 00:00:00 2001 From: Penguin Date: Tue, 12 Apr 2022 18:32:24 -0500 Subject: [PATCH] fixed issue with receiving data. the interrupt overhead was too high so i switch to an interrupt/polling hybrid. idk how im going to do the queue but i have the library finished --- .gdb_history | 318 +- Core/Src/main.c | 50 +- compile_commands.json | 946 ---- env.sh | 6 + gdb.txt | 8959 +++++++++++++++++++++++++++++++++ shared/drivers/p_serial_mgr.c | 139 +- shared/drivers/p_serial_mgr.h | 2 +- shared/util/PCircularBuffer.c | 8 +- shared/util/PCircularBuffer.h | 4 +- shared/util/putil.c | 18 +- shared/util/putil.h | 1 + 11 files changed, 9204 insertions(+), 1247 deletions(-) create mode 100644 env.sh diff --git a/.gdb_history b/.gdb_history index 35bd910..c27a307 100644 --- a/.gdb_history +++ b/.gdb_history @@ -1,150 +1,3 @@ -q -q -q -b main -file build/motor_controller.hex -q -r -q -r -q -b main -r -n -n -n -n -n -n -n -n -n -n -n -n -n -n -b 129 -c -qq -q -b main -r -n -n -n -n -n -n -n -n -n -n -n -b 128 -n -n -n -n -b 129 -de -del -b 129 -r -c -n -s -s -s -q -q -q -b 129 -r -q -b Core/Src/main.c:380 -r -q -q -q -q -q -b 392 -r -s -s -c -p huart1_rxc -s -s -s -c -q -q -q -b 392 -r -c -c -del -b main() -b 124 -r -n -q -b 392 -r -p huart1_rxc -c -p huart1_rxc -p huart1_rxc -c -p huart1_rxc -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 @@ -230,3 +83,174 @@ r c del q +q +b p_serial_mgr.c:43 if rxc == 0x7D +r +make -j20 +load +r +make -j20 +load +r +del +b p_serial_mgr.c:44 +r +b p_serial_mgr.c:44 if rxc == 0x7D +del +b p_serial_mgr.c:44 if rxc == 0x7D +r +del +b p_serial_mgr.c:44 if (rxc == 0x7D) +r +r +s +s +s +q +b putil.c:34 +r +p bytep byte +p byte +/xp byte +p/x byte +make -j20 +load +q +b putil.c:34 +r +n +n +make -j20 +load +r +n +n +make -j20 +make +load +r +n +n +q +b putil.c:34 +r +c +make -j20 +load +r +n +n +n +q +b putil.c:35 +r +n +make -j20; load; r +make -j20 +load +r +n +n +n +c +c +c +q +b main.c:148 +r +q +b putil.c:36 +b putil.c:36 +r +p main.c:161 +b main.c:161 +r +del +b p_serial_mgr.c:161 +r +c +b p_serial_mgr_service +r +c +n +p serial_pkt_cb.buffer[0] +p serial_pkt_cb.buffer[0] +c +s +p ind +c +p ind +n +p ind +p serial_pkt_cb.max_len +p ind +s +p serial_pkt_cb.buffer[ind] +p serial_pkt_cb.buffer +p serial_pkt_cb.buffer[0] +p serial_pkt_cb.buffer[1] +p serial_pkt_cb.buffer[2] +p serial_pkt_cb.buffer[3] +p serial_pkt_cb.buffer[4] +del +b p_serial_mgr_service if serial_pkt_cb.buffer[0].frame_data[0] != 0 +r +q +q +q +b UART1_RxCpltCallback +r +c +p b_go +b main.c:141 +r +c +n +n +n +n +n +n +step +f +finish +finish +n +n +n +n +n +n +n +n +finish +n +finish +c 20 +p b_go +q +b 141 +r +n +p ret +make +load +r +n +p ret +q +make +load +r +n +make +load +r +n +n +n +n +n +p ret +make clean +q diff --git a/Core/Src/main.c b/Core/Src/main.c index 753b5ef..e75827f 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -133,8 +133,22 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ + uint8_t rxb[256] = {0}; while (1) { + if (p_serial_mgr_service()) + { + volatile HAL_StatusTypeDef ret; + ret = HAL_UART_Receive(&huart1, rxb, 256, 5); + + for (int ind = 0; ind < 20; ind++) + { + p_uart_async_write_byte(rxb[ind]); + } + PDEBUG("\n\n\n\n"); + memset(rxb, 0, 256); + p_serial_mgr_start(); + } // if (b_timer_struck) // { // // PDEBUG("%d\n", sys_time); @@ -142,24 +156,24 @@ int main(void) // motor_degrees = (motor_degrees + 1) % 360; // mc_service(motor_degrees, 50); // } - serial_pkt_t *pkt = NULL; - if ((pkt = p_serial_mgr_service()) != NULL) - { - PDEBUG("Source: %02x\n" - "Destination: %02x\n", - pkt->src_addr, pkt->dest_addr); - PDEBUG("Frame Data: \n"); - for (int ind = 0; ind < pkt->len; pkt++) - { - if (ind % 8 == 0) - { - PDEBUG("\n"); - } - PDEBUG("%02x ", pkt->frame_data[ind]); - } - PDEBUG("\nChecksum: %02x\n\n"); - memset(pkt, 0, sizeof(serial_pkt_t)); - } + // serial_pkt_t *pkt = NULL; + // if ((pkt = p_serial_mgr_service()) != NULL) + // { + // PDEBUG("Source: %02x\n" + // "Destination: %02x\n", + // pkt->src_addr, pkt->dest_addr); + // PDEBUG("Frame Data: \n"); + // for (int ind = 0; ind < pkt->len; pkt++) + // { + // if (ind % 8 == 0) + // { + // PDEBUG("\n"); + // } + // PDEBUG("%02x ", pkt->frame_data[ind]); + // } + // PDEBUG("\nChecksum: %02x\n\n"); + // memset(pkt, 0, sizeof(serial_pkt_t)); + // } /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ diff --git a/compile_commands.json b/compile_commands.json index 2e718be..118ff25 100644 --- a/compile_commands.json +++ b/compile_commands.json @@ -1,109 +1,4 @@ [ - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_msp.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_msp.lst", - "-o", - "build/stm32l4xx_hal_msp.o", - "Core/Src/stm32l4xx_hal_msp.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Core/Src/stm32l4xx_hal_msp.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_dma.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_dma.lst", - "-o", - "build/stm32l4xx_hal_dma.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_gpio.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_gpio.lst", - "-o", - "build/stm32l4xx_hal_gpio.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c" - }, { "arguments": [ "arm-none-eabi-gcc", @@ -138,846 +33,5 @@ ], "directory": "/storage/Shared/Projects/Penguinator/motor_controller", "file": "Core/Src/main.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_rcc_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_rcc_ex.lst", - "-o", - "build/stm32l4xx_hal_rcc_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_flash_ramfunc.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_flash_ramfunc.lst", - "-o", - "build/stm32l4xx_hal_flash_ramfunc.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_tim.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_tim.lst", - "-o", - "build/stm32l4xx_hal_tim.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/p_serial_mgr.d", - "-Wa,-a,-ad,-alms=build/p_serial_mgr.lst", - "-o", - "build/p_serial_mgr.o", - "shared/drivers/p_serial_mgr.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "shared/drivers/p_serial_mgr.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal.lst", - "-o", - "build/stm32l4xx_hal.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_cortex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_cortex.lst", - "-o", - "build/stm32l4xx_hal_cortex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_flash.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_flash.lst", - "-o", - "build/stm32l4xx_hal_flash.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_it.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_it.lst", - "-o", - "build/stm32l4xx_it.o", - "Core/Src/stm32l4xx_it.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Core/Src/stm32l4xx_it.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_i2c.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_i2c.lst", - "-o", - "build/stm32l4xx_hal_i2c.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_pwr_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_pwr_ex.lst", - "-o", - "build/stm32l4xx_hal_pwr_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/putil.d", - "-Wa,-a,-ad,-alms=build/putil.lst", - "-o", - "build/putil.o", - "shared/util/putil.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "shared/util/putil.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_dma_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_dma_ex.lst", - "-o", - "build/stm32l4xx_hal_dma_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_tim_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_tim_ex.lst", - "-o", - "build/stm32l4xx_hal_tim_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_pwr.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_pwr.lst", - "-o", - "build/stm32l4xx_hal_pwr.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/motor_controller.d", - "-Wa,-a,-ad,-alms=build/motor_controller.lst", - "-o", - "build/motor_controller.o", - "shared/devices/motor_controller.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "shared/devices/motor_controller.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_exti.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_exti.lst", - "-o", - "build/stm32l4xx_hal_exti.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/system_stm32l4xx.d", - "-Wa,-a,-ad,-alms=build/system_stm32l4xx.lst", - "-o", - "build/system_stm32l4xx.o", - "Core/Src/system_stm32l4xx.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Core/Src/system_stm32l4xx.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_flash_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_flash_ex.lst", - "-o", - "build/stm32l4xx_hal_flash_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_uart_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_uart_ex.lst", - "-o", - "build/stm32l4xx_hal_uart_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_uart.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_uart.lst", - "-o", - "build/stm32l4xx_hal_uart.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-x", - "assembler-with-cpp", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/startup_stm32l432xx.d", - "-o", - "build/startup_stm32l432xx.o", - "startup_stm32l432xx.s" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "startup_stm32l432xx.s" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/PCircularBuffer.d", - "-Wa,-a,-ad,-alms=build/PCircularBuffer.lst", - "-o", - "build/PCircularBuffer.o", - "shared/util/PCircularBuffer.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "shared/util/PCircularBuffer.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_rcc.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_rcc.lst", - "-o", - "build/stm32l4xx_hal_rcc.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-g3", - "-gdwarf-2", - "-D_DEBUG", - "-MFbuild/stm32l4xx_hal_i2c_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_i2c_ex.lst", - "-o", - "build/stm32l4xx_hal_i2c_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c" - ], - "directory": "/storage/Shared/Projects/Penguinator/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c" } ] \ No newline at end of file diff --git a/env.sh b/env.sh new file mode 100644 index 0000000..7ebf8f4 --- /dev/null +++ b/env.sh @@ -0,0 +1,6 @@ +elf="./build/motor_controller.elf" + +alias pregen="make clean; rdos2unix" +alias ppush="make -j20; arm-none-eabi-gdb ${elf} -x generic_push.gdb" +alias pdebug="make -j20; arm-none-eabi-gdb ${elf} -x generic_debug.gdb" + diff --git a/gdb.txt b/gdb.txt index ab4db24..9826d37 100644 --- a/gdb.txt +++ b/gdb.txt @@ -5562,3 +5562,8962 @@ arg huart = 0x0: {Instance = 0x20010000,Init = {BaudRate = 134235049,WordLength Quit Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target [Inferior 1 (Remote target) detached] +warning: No executable has been specified and target does not support +determining executable automatically. Try using the "file" command. +0x080014f2 in ?? () +### Assembly ################################################################## + 0x080014f2 ? mov r4, r0 + 0x080014f4 ? cmp r0, #0 + 0x080014f6 ? beq.n 0x80014ee + 0x080014f8 ? ldrb.w r2, [r0, #257] ; 0x101 + 0x080014fc ? ldrb.w r1, [r0, #256] ; 0x100 + 0x08001500 ? ldr r0, [pc, #80] ; (0x8001554) + 0x08001502 ? bl 0x800407c + 0x08001506 ? ldr r0, [pc, #80] ; (0x8001558) + 0x08001508 ? bl 0x800407c + 0x0800150c ? ldrb.w r3, [r4, #259] ; 0x103 +### 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 0x080014f3 faultmask 0x00 + r7 0x00000000 pc 0x080014f2 control 0x04 +### Source #################################################################### +### Stack ##################################################################### +[0] from 0x080014f2 +### Threads ################################################################### +[1] id 0 from 0x080014f2 +### 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: 0x080043a8 msp: 0x20010000 +generic_debug.gdb:7: Error in sourced command file: +No executable file specified. +Use the "file" or "exec-file" command. +Detaching from program: , Remote target +[Inferior 1 (Remote target) detached] +mc_init (tim=0x0) at shared/devices/motor_controller.c:9 +9 _motor_timer = tim; +### Assembly ################################################################## +~ +~ +~ +~ +~ + 0x080043a8 mc_init+0 ldr.w sp, [pc, #52] ; 0x80043e0 + 0x080043ac mc_init+4 bl 0x8004068 + 0x080043b0 mc_init+8 ldr r0, [pc, #48] ; (0x80043e4 ) + 0x080043b2 mc_init+10 ldr r1, [pc, #52] ; (0x80043e8 ) +~ +### 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 0x080043a8 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"); +### Stack ##################################################################### +[0] from 0x080043a8 in mc_init+0 at shared/devices/motor_controller.c:9 +[1] from 0xfffffffe +### Threads ################################################################### +[1] id 0 from 0x080043a8 in mc_init+0 at shared/devices/motor_controller.c:9 +### Variables ################################################################# +arg tim = 0x0: {Instance = 0x20010000,Init = {Prescaler = 134235049,CounterMode = 134223209,Period = … +############################################################################### +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: 0x080043a8 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9758 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009918 +Loading section .ARM, size 0x8 lma 0x8009df0 +Loading section .init_array, size 0x8 lma 0x8009df8 +Loading section .fini_array, size 0x8 lma 0x8009e00 +Loading section .data, size 0x9a8 lma 0x8009e08 +Start address 0x080043b4, load size 42880 +Transfer rate: 29 KB/sec, 4764 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 ########################################################### +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 + +Program received signal SIGINT, Interrupt. +0x08004368 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ############################################################################################################################ +~ + 0x08004360 p_serial_mgr_service+0 movs r3, #0 + 0x08004362 p_serial_mgr_service+2 b.n 0x8004366 + 0x08004364 p_serial_mgr_service+4 adds r3, #1 + 0x08004366 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x800438c ) + 0x08004368 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x0800436a p_serial_mgr_service+10 cmp r2, r3 + 0x0800436c p_serial_mgr_service+12 ble.n 0x8004386 + 0x0800436e p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x800438c ) + 0x08004370 p_serial_mgr_service+16 ldr r0, [r2, #0] +### Breakpoints ######################################################################################################################### +[1] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:43 if rxc == 0x7D +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### 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 0x08004368 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ############################################################################################################################### +[0] from 0x08004368 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x08004368 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:156 +### Variables ########################################################################################################################### +loc ind = 0 +######################################################################################################################################### +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0xb440 lma 0x80001c0 +Loading section .rodata, size 0x4b0 lma 0x800b600 +Loading section .ARM, size 0x8 lma 0x800bab0 +Loading section .init_array, size 0x8 lma 0x800bab8 +Loading section .fini_array, size 0x8 lma 0x800bac0 +Loading section .data, size 0x9a8 lma 0x800bac8 +Start address 0x0800618c, load size 50240 +Transfer rate: 30 KB/sec, 5582 bytes/write. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 +halted: PC: 0x08005e46 + +Program received signal SIGINT, Interrupt. +0x08006134 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ############################################################################################################################ + 0x0800612a p_serial_mgr_service+62 str r3, [r7, #4] + 0x0800612c p_serial_mgr_service+64 ldr r3, [pc, #24] ; (0x8006148 ) + 0x0800612e p_serial_mgr_service+66 ldrh r3, [r3, #6] + 0x08006130 p_serial_mgr_service+68 mov r2, r3 + 0x08006132 p_serial_mgr_service+70 ldr r3, [r7, #4] + 0x08006134 p_serial_mgr_service+72 cmp r3, r2 + 0x08006136 p_serial_mgr_service+74 blt.n 0x80060f8 + 0x08006138 p_serial_mgr_service+76 movs r3, #0 + 0x0800613a p_serial_mgr_service+78 mov r0, r3 + 0x0800613c p_serial_mgr_service+80 adds r7, #12 +### Breakpoints ######################################################################################################################### +[1] break at 0x08005e44 in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:43 if rxc == 0x7D +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### Memory ############################################################################################################################## +### Registers ########################################################################################################################### + r0 0x00000000 r4 0x2000166c r8 0x00000000 r12 0x0000000d xPSR 0x61030000 primask 0x00 + r1 0x40013800 r5 0x00000000 r9 0x00000000 sp 0x2000ffd8 fpscr 0x00000010 basepri 0x00 + r2 0x00000000 r6 0x00000000 r10 0x00000000 lr 0x080011bd msp 0x2000ffd8 faultmask 0x00 + r3 0x00000000 r7 0x2000ffd8 r11 0x00000000 pc 0x08006134 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ############################################################################################################################### +[0] from 0x08006134 in p_serial_mgr_service+72 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080011bc in main+136 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x08006134 in p_serial_mgr_service+72 at shared/drivers/p_serial_mgr.c:156 +### Variables ########################################################################################################################### +loc ind = 0 +######################################################################################################################################### +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9758 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009918 +Loading section .ARM, size 0x8 lma 0x8009df0 +Loading section .init_array, size 0x8 lma 0x8009df8 +Loading section .fini_array, size 0x8 lma 0x8009e00 +Loading section .data, size 0x9a8 lma 0x8009e08 +Start address 0x080043b4, load size 42880 +Transfer rate: 29 KB/sec, 4764 bytes/write. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### +halted: PC: 0x08004150 +halted: PC: 0x08004150 +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 0x8004390 + 0x080014ee main+122 bl 0x8004360 + 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:43 if rxc == 0x7D +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### 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 \265C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\0… +######################################################################################################################################### +Breakpoint 2 at 0x800414e: 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 ############################################################################################################################ + 0x08004140 UART1_RxCpltCallback+8 bhi.w 0x8004302 + 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, #448] ; (0x8004310 ) + 0x08004150 UART1_RxCpltCallback+24 ldrb r3, [r3, #0] + 0x08004152 UART1_RxCpltCallback+26 cmp r3, #126 ; 0x7e + 0x08004154 UART1_RxCpltCallback+28 bne.w 0x80042f4 + 0x08004158 UART1_RxCpltCallback+32 ldr r3, [pc, #432] ; (0x800430c ) +### Breakpoints ######################################################################################################################### +[2] 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 0x08004366 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:156 +[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… +######################################################################################################################################### +Note: breakpoint 2 also set at pc 0x800414e. +Breakpoint 3 at 0x800414e: file shared/drivers/p_serial_mgr.c, line 46. +Breakpoint 4 at 0x800414e: file shared/drivers/p_serial_mgr.c, line 46. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 + +Program received signal SIGINT, Interrupt. +0x08004386 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:163 +163 return NULL; +### Assembly ############################################################################################################################ + 0x0800437a p_serial_mgr_service+26 add r0, r2 + 0x0800437c p_serial_mgr_service+28 ldrb.w r2, [r0, #260] ; 0x104 + 0x08004380 p_serial_mgr_service+32 cmp r2, #0 + 0x08004382 p_serial_mgr_service+34 beq.n 0x8004364 + 0x08004384 p_serial_mgr_service+36 b.n 0x8004388 + 0x08004386 p_serial_mgr_service+38 movs r0, #0 + 0x08004388 p_serial_mgr_service+40 bx lr + 0x0800438a p_serial_mgr_service+42 nop + 0x0800438c p_serial_mgr_service+44 asrs r4, r2, #24 + 0x0800438e p_serial_mgr_service+46 movs r0, #0 +### Breakpoints ######################################################################################################################### +[4] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 if rxc == 0x7D +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### 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 0x08004386 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() + 167 { + 168 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 169 } +~ +~ +~ +### Stack ############################################################################################################################### +[0] from 0x08004386 in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:163 +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x08004386 in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:163 +### Variables ########################################################################################################################### +######################################################################################################################################### +Quit +Breakpoint 5 at 0x800414e: file shared/drivers/p_serial_mgr.c, line 46. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### + +Program received signal SIGINT, Interrupt. +0x08004368 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ############################################################################################################################ +~ + 0x08004360 p_serial_mgr_service+0 movs r3, #0 + 0x08004362 p_serial_mgr_service+2 b.n 0x8004366 + 0x08004364 p_serial_mgr_service+4 adds r3, #1 + 0x08004366 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x800438c ) + 0x08004368 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x0800436a p_serial_mgr_service+10 cmp r2, r3 + 0x0800436c p_serial_mgr_service+12 ble.n 0x8004386 + 0x0800436e p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x800438c ) + 0x08004370 p_serial_mgr_service+16 ldr r0, [r2, #0] +### Breakpoints ######################################################################################################################### +[5] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 if (rxc == 0x7D) +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### 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 0x08004368 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ############################################################################################################################### +[0] from 0x08004368 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x08004368 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:156 +### Variables ########################################################################################################################### +loc ind = 0 +######################################################################################################################################### +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ##################################################################################################################### +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 +halted: PC: 0x08004150 + +Program received signal SIGINT, Interrupt. +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ############################################################################################################################ +~ +~ +~ +~ +~ + 0x08004360 p_serial_mgr_service+0 movs r3, #0 + 0x08004362 p_serial_mgr_service+2 b.n 0x8004366 + 0x08004364 p_serial_mgr_service+4 adds r3, #1 + 0x08004366 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x800438c ) + 0x08004368 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ######################################################################################################################### +[5] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 if (rxc == 0x7D) +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### 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 0x08004360 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ############################################################################################################################### +[0] from 0x08004360 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x08004360 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +### Variables ########################################################################################################################### +loc ind = 0 +######################################################################################################################################### +### Output/messages ##################################################################################################################### +halted: PC: 0x08004362 +halted: PC: 0x08004366 +halted: PC: 0x08004368 +halted: PC: 0x0800436a +halted: PC: 0x0800436c +halted: PC: 0x08004386 +halted: PC: 0x08004388 +halted: PC: 0x080014f2 +halted: PC: 0x080014f4 +halted: PC: 0x080014f6 +halted: PC: 0x080014ee +halted: PC: 0x08004360 +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ############################################################################################################################ +~ +~ +~ +~ +~ + 0x08004360 p_serial_mgr_service+0 movs r3, #0 + 0x08004362 p_serial_mgr_service+2 b.n 0x8004366 + 0x08004364 p_serial_mgr_service+4 adds r3, #1 + 0x08004366 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x800438c ) + 0x08004368 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ######################################################################################################################### +[5] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 if (rxc == 0x7D) +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### 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 0x08004360 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ############################################################################################################################### +[0] from 0x08004360 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x08004360 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +### Variables ########################################################################################################################### +loc ind = 0 +######################################################################################################################################### +### Output/messages ##################################################################################################################### +halted: PC: 0x08004362 +halted: PC: 0x08004366 +halted: PC: 0x08004368 +halted: PC: 0x0800436a +halted: PC: 0x0800436c +halted: PC: 0x08004386 +halted: PC: 0x08004388 +halted: PC: 0x080014f2 +halted: PC: 0x080014f4 +halted: PC: 0x080014f6 +halted: PC: 0x080014ee +halted: PC: 0x08004360 +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ############################################################################################################################ +~ +~ +~ +~ +~ + 0x08004360 p_serial_mgr_service+0 movs r3, #0 + 0x08004362 p_serial_mgr_service+2 b.n 0x8004366 + 0x08004364 p_serial_mgr_service+4 adds r3, #1 + 0x08004366 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x800438c ) + 0x08004368 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ######################################################################################################################### +[5] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 if (rxc == 0x7D) +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### 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 0x08004360 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ############################################################################################################################### +[0] from 0x08004360 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x08004360 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +### Variables ########################################################################################################################### +loc ind = 0 +######################################################################################################################################### +### Output/messages ##################################################################################################################### +halted: PC: 0x08004362 +halted: PC: 0x08004366 +halted: PC: 0x08004368 +halted: PC: 0x0800436a +halted: PC: 0x0800436c +halted: PC: 0x08004386 +halted: PC: 0x08004388 +halted: PC: 0x080014f2 +halted: PC: 0x080014f4 +halted: PC: 0x080014f6 +halted: PC: 0x080014ee +halted: PC: 0x08004360 +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ############################################################################################################################ +~ +~ +~ +~ +~ + 0x08004360 p_serial_mgr_service+0 movs r3, #0 + 0x08004362 p_serial_mgr_service+2 b.n 0x8004366 + 0x08004364 p_serial_mgr_service+4 adds r3, #1 + 0x08004366 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x800438c ) + 0x08004368 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ######################################################################################################################### +[5] break at 0x0800414e in shared/drivers/p_serial_mgr.c:46 for p_serial_mgr.c:44 if (rxc == 0x7D) +### Expressions ######################################################################################################################### +### History ############################################################################################################################# +### 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 0x08004360 psp 0x00000000 control 0x04 +### Source ############################################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ############################################################################################################################### +[0] from 0x08004360 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ############################################################################################################################# +[1] id 0 from 0x08004360 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +### Variables ########################################################################################################################### +loc ind = 0 +######################################################################################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x08004360 in UART1_RxCpltCallback (huart=) at shared/drivers/p_serial_mgr.c:101 +101 serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc; +### Assembly ######################################################################################################## + 0x08004356 UART1_RxCpltCallback+210 lsrs r0, r0, #32 + 0x08004358 UART1_RxCpltCallback+212 lsrs r0, r4, #15 + 0x0800435a UART1_RxCpltCallback+214 movs r0, #0 + 0x0800435c UART1_RxCpltCallback+216 asrs r4, r2, #24 + 0x0800435e UART1_RxCpltCallback+218 movs r0, #0 + 0x08004360 UART1_RxCpltCallback+220 movs r3, #0 + 0x08004362 UART1_RxCpltCallback+222 b.n 0x8004366 + 0x08004364 UART1_RxCpltCallback+224 adds r3, #1 + 0x08004366 UART1_RxCpltCallback+226 ldr r2, [pc, #36] ; (0x800438c ) + 0x08004368 UART1_RxCpltCallback+228 ldrh r2, [r2, #6] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x08004360 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 91 #pragma message(Reminder "add a safe escape routine for this") + 92 sstate = SS_IDLE; + 93 memset(&serial_pkt_cb.buffer[serial_pkt_cb.head], 0, sizeof(serial_pkt_t)); + 94 } + 95 else if (rxc == 0x7D) + 96 { + 97 sstate = SS_ESC; + 98 } + 99 else + 100 { + 101 serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc; + 102 if (frame_index_tracker >= serial_pkt_cb.buffer[serial_pkt_cb.head].len) + 103 { + 104 sstate = SS_CHECKSUM; + 105 } + 106 } + 107 } + 108 break; + 109 case SS_ESC: + 110 { +### Stack ########################################################################################################### +[0] from 0x08004360 in UART1_RxCpltCallback+220 at shared/drivers/p_serial_mgr.c:101 +[1] from 0x2000166c in heap_end +### Threads ######################################################################################################### +[1] id 0 from 0x08004360 in UART1_RxCpltCallback+220 at shared/drivers/p_serial_mgr.c:101 +### Variables ####################################################################################################### +arg huart = +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x98b0 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009a70 +Loading section .ARM, size 0x8 lma 0x8009f48 +Loading section .init_array, size 0x8 lma 0x8009f50 +Loading section .fini_array, size 0x8 lma 0x8009f58 +Loading section .data, size 0x9a8 lma 0x8009f60 +Start address 0x08004508, load size 43224 +Transfer rate: 29 KB/sec, 4802 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] +0x080044ba in memset () +### Assembly ######################################################################################################## + 0x080044ba ? ldr r2, [pc, #36] ; (0x80044e0 ) + 0x080044bc ? ldrh r2, [r2, #6] + 0x080044be ? cmp r2, r3 + 0x080044c0 ? ble.n 0x80044da + 0x080044c2 ? ldr r2, [pc, #28] ; (0x80044e0 ) + 0x080044c4 ? ldr r0, [r2, #0] + 0x080044c6 ? add.w r2, r3, r3, lsl #6 + 0x080044ca ? add.w r2, r3, r2, lsl #2 + 0x080044ce ? add r0, r2 + 0x080044d0 ? ldrb.w r2, [r0, #260] ; 0x104 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080044ba primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x080044ba in memset +[1] from 0x2000166c in heap_end +### Threads ######################################################################################################### +[1] id 0 from 0x080044ba in memset +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9788 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009948 +Loading section .ARM, size 0x8 lma 0x8009e20 +Loading section .init_array, size 0x8 lma 0x8009e28 +Loading section .fini_array, size 0x8 lma 0x8009e30 +Loading section .data, size 0x9a8 lma 0x8009e38 +Start address 0x080043e0, load size 42928 +Transfer rate: 29 KB/sec, 4769 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:157 +157 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ + 0x0800438c p_serial_mgr_service+0 movs r3, #0 + 0x0800438e p_serial_mgr_service+2 b.n 0x8004392 + 0x08004390 p_serial_mgr_service+4 adds r3, #1 + 0x08004392 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x80043b8 ) + 0x08004394 p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x0800438c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 147 _serial_huart_inst = huart; + 148 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 149 + 150 memset(pkt_bank, 0, sizeof(serial_pkt_t) * 10); + 151 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 152 } + 153 + 154 serial_pkt_t *p_serial_mgr_service(void) + 155 { + 156 // this will be less garbage when i switch to a queue + 157 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 158 { + 159 if (serial_pkt_cb.buffer[ind].b_ready) + 160 { + 161 return &serial_pkt_cb.buffer[ind]; + 162 } + 163 } + 164 return NULL; + 165 } + 166 +### Stack ########################################################################################################### +[0] from 0x0800438c in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:157 +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x0800438c in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:157 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9788 lma 0x80001c0 +Loading section .rodata, size 0x4d8 lma 0x8009948 +Loading section .ARM, size 0x8 lma 0x8009e20 +Loading section .init_array, size 0x8 lma 0x8009e28 +Loading section .fini_array, size 0x8 lma 0x8009e30 +Loading section .data, size 0x9a8 lma 0x8009e38 +Start address 0x080043e0, load size 42928 +Transfer rate: 29 KB/sec, 4769 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] +0x08004392 in UART1_RxCpltCallback (huart=) at shared/drivers/p_serial_mgr.c:102 +102 if (frame_index_tracker >= serial_pkt_cb.buffer[serial_pkt_cb.head].len) +### Assembly ######################################################################################################## + 0x08004388 UART1_RxCpltCallback+240 asrs r4, r2, #24 + 0x0800438a UART1_RxCpltCallback+242 movs r0, #0 + 0x0800438c UART1_RxCpltCallback+244 movs r3, #0 + 0x0800438e UART1_RxCpltCallback+246 b.n 0x8004392 + 0x08004390 UART1_RxCpltCallback+248 adds r3, #1 + 0x08004392 UART1_RxCpltCallback+250 ldr r2, [pc, #36] ; (0x80043b8 ) + 0x08004394 UART1_RxCpltCallback+252 ldrh r2, [r2, #6] + 0x08004396 UART1_RxCpltCallback+254 cmp r2, r3 + 0x08004398 UART1_RxCpltCallback+256 ble.n 0x80043b2 + 0x0800439a UART1_RxCpltCallback+258 ldr r2, [pc, #28] ; (0x80043b8 ) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x08004392 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 92 sstate = SS_IDLE; + 93 memset(&serial_pkt_cb.buffer[serial_pkt_cb.head], 0, sizeof(serial_pkt_t)); + 94 } + 95 else if (rxc == 0x7D) + 96 { + 97 sstate = SS_ESC; + 98 } + 99 else + 100 { + 101 serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc; + 102 if (frame_index_tracker >= serial_pkt_cb.buffer[serial_pkt_cb.head].len) + 103 { + 104 sstate = SS_CHECKSUM; + 105 } + 106 } + 107 } + 108 break; + 109 case SS_ESC: + 110 { + 111 serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc ^ 0x20; +### Stack ########################################################################################################### +[0] from 0x08004392 in UART1_RxCpltCallback+250 at shared/drivers/p_serial_mgr.c:102 +[1] from 0x2000166c in heap_end +### Threads ######################################################################################################### +[1] id 0 from 0x08004392 in UART1_RxCpltCallback+250 at shared/drivers/p_serial_mgr.c:102 +### Variables ####################################################################################################### +arg huart = +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9908 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009ac8 +Loading section .ARM, size 0x8 lma 0x8009fa8 +Loading section .init_array, size 0x8 lma 0x8009fb0 +Loading section .fini_array, size 0x8 lma 0x8009fb8 +Loading section .data, size 0x9a8 lma 0x8009fc0 +Start address 0x0800451c, load size 43320 +Transfer rate: 29 KB/sec, 4813 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] +0x08009aa8 in _exit () +### Assembly ######################################################################################################## + 0x08009aa8 ? b.n 0x8009aa8 <_exit> + 0x08009aaa ? nop + 0x08009aac ? push {r3, r4, r5, r6, r7, lr} + 0x08009aae ? nop + 0x08009ab0 ? pop {r3, r4, r5, r6, r7} + 0x08009ab2 ? pop {r3} + 0x08009ab4 ? mov lr, r3 + 0x08009ab6 ? bx lr + 0x08009ab8 ? push {r3, r4, r5, r6, r7, lr} + 0x08009aba ? nop +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009aa8 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009bbc r9 0x00000000 lr 0x080047ad psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009aa8 in _exit +[1] from 0x080047ac in __chk_fail +[2] from 0x0800469c in __sprintf_chk +[3] from 0x0800423c in p_uart_async_write_byte+24 at shared/util/putil.c:35 +[4] from 0x080042a2 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080044f0 in p_serial_mgr_service+40 at shared/drivers/p_serial_mgr.c:165 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08009aa8 in _exit +### 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: 0x0800451c msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9908 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009ac8 +Loading section .ARM, size 0x8 lma 0x8009fa8 +Loading section .init_array, size 0x8 lma 0x8009fb0 +Loading section .fini_array, size 0x8 lma 0x8009fb8 +Loading section .data, size 0x9a8 lma 0x8009fc0 +Start address 0x0800451c, load size 43320 +Transfer rate: 29 KB/sec, 4813 bytes/write. +Breakpoint 1 at 0x8004228: file shared/util/putil.c, line 34. +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, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:34 +34 char send = '\0'; +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004224 p_uart_async_write_byte+0 push {lr} + 0x08004226 p_uart_async_write_byte+2 sub sp, #20 +!0x08004228 p_uart_async_write_byte+4 movs r1, #0 + 0x0800422a p_uart_async_write_byte+6 strb.w r1, [sp, #15] + 0x0800422e p_uart_async_write_byte+10 str r0, [sp, #0] + 0x08004230 p_uart_async_write_byte+12 ldr r3, [pc, #28] ; (0x8004250 ) + 0x08004232 p_uart_async_write_byte+14 movs r2, #1 +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004228 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20001612 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x080042a3 psp 0x00000000 +### Source ########################################################################################################## + 24 return 0; + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send = '\0'; + 35 sprintf(&send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, &send, 1); + 37 } +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:34 +[1] from 0x080042a2 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044f0 in p_serial_mgr_service+40 at shared/drivers/p_serial_mgr.c:165 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:34 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = 0 '\000' +##################################################################################################################### +Quit +No symbol "bytep" in current context. +Quit +Quit +Quit +Quit +$1 = 126 '~' +Undefined command: "". Try "help". +$2 = 0x7e +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9900 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009ac0 +Loading section .ARM, size 0x8 lma 0x8009fa0 +Loading section .init_array, size 0x8 lma 0x8009fa8 +Loading section .fini_array, size 0x8 lma 0x8009fb0 +Loading section .data, size 0x9a8 lma 0x8009fb8 +Start address 0x08004514, load size 43312 +Transfer rate: 29 KB/sec, 4812 bytes/write. +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:62 +62 ldr sp, =_estack /* Set stack pointer */ +### Assembly ######################################################################################################## + 0x08004514 ? ldr.w sp, [pc, #52] ; 0x800454c + 0x08004518 ? bl 0x8004194 + 0x0800451c ? ldr r0, [pc, #48] ; (0x8004550 ) + 0x0800451e ? ldr r1, [pc, #52] ; (0x8004554 ) + 0x08004520 ? ldr r2, [pc, #52] ; (0x8004558 ) + 0x08004522 ? movs r3, #0 + 0x08004524 ? b.n 0x800452c + 0x08004526 ? ldr r4, [r2, r3] + 0x08004528 ? str r4, [r0, r3] + 0x0800452a ? adds r3, #4 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x08004514 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000000 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x20010000 msp 0x20010000 control 0x00 + r4 0x00000000 r9 0x00000000 lr 0xffffffff psp 0x00000000 +### Source ########################################################################################################## + 52 * necessary set is performed, after which the application + 53 * supplied main() routine is called. + 54 * @param None + 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 +### Stack ########################################################################################################### +[0] from 0x08004514 in Reset_Handler at startup_stm32l432xx.s:62 +### Threads ######################################################################################################### +[1] id 0 from 0x08004514 in Reset_Handler at startup_stm32l432xx.s:62 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9900 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009ac0 +Loading section .ARM, size 0x8 lma 0x8009fa0 +Loading section .init_array, size 0x8 lma 0x8009fa8 +Loading section .fini_array, size 0x8 lma 0x8009fb0 +Loading section .data, size 0x9a8 lma 0x8009fb8 +Start address 0x08004514, load size 43312 +Transfer rate: 29 KB/sec, 4812 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] +0x08009aa0 in _exit () +### Assembly ######################################################################################################## + 0x08009aa0 ? b.n 0x8009aa0 <_exit> + 0x08009aa2 ? nop + 0x08009aa4 ? push {r3, r4, r5, r6, r7, lr} + 0x08009aa6 ? nop + 0x08009aa8 ? pop {r3, r4, r5, r6, r7} + 0x08009aaa ? pop {r3} + 0x08009aac ? mov lr, r3 + 0x08009aae ? bx lr + 0x08009ab0 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ab2 ? nop +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009aa0 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009bb4 r9 0x00000000 lr 0x080047a5 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009aa0 in _exit +[1] from 0x080047a4 in __chk_fail +[2] from 0x08004694 in __sprintf_chk +[3] from 0x08004236 in p_uart_async_write_byte+18 at shared/util/putil.c:35 +[4] from 0x0800429a in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080044c6 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:157 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08009aa0 in _exit +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9900 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009ac0 +Loading section .ARM, size 0x8 lma 0x8009fa0 +Loading section .init_array, size 0x8 lma 0x8009fa8 +Loading section .fini_array, size 0x8 lma 0x8009fb0 +Loading section .data, size 0x9a8 lma 0x8009fb8 +Start address 0x08004514, load size 43312 +Transfer rate: 29 KB/sec, 4812 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] +0x08009aa0 in _write () +### Assembly ######################################################################################################## + 0x08009aa0 ? b.n 0x8009aa0 <_write> + 0x08009aa2 ? nop + 0x08009aa4 ? push {r3, r4, r5, r6, r7, lr} + 0x08009aa6 ? nop + 0x08009aa8 ? pop {r3, r4, r5, r6, r7} + 0x08009aaa ? pop {r3} + 0x08009aac ? mov lr, r3 + 0x08009aae ? bx lr + 0x08009ab0 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ab2 ? nop +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009aa0 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009bb4 r9 0x00000000 lr 0x080047a5 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009aa0 in _write +[1] from 0x080047a4 in __chk_fail +### Threads ######################################################################################################### +[1] id 0 from 0x08009aa0 in _write +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9910 lma 0x80001c0 +Loading section .rodata, size 0x4e8 lma 0x8009ad0 +Loading section .ARM, size 0x8 lma 0x8009fb8 +Loading section .init_array, size 0x8 lma 0x8009fc0 +Loading section .fini_array, size 0x8 lma 0x8009fc8 +Loading section .data, size 0x9a8 lma 0x8009fd0 +Start address 0x08004524, load size 43336 +Transfer rate: 29 KB/sec, 4815 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] +0x08009ab0 in _exit () +### Assembly ######################################################################################################## + 0x08009ab0 ? b.n 0x8009ab0 <_exit> + 0x08009ab2 ? nop + 0x08009ab4 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ab6 ? nop + 0x08009ab8 ? pop {r3, r4, r5, r6, r7} + 0x08009aba ? pop {r3} + 0x08009abc ? mov lr, r3 + 0x08009abe ? bx lr + 0x08009ac0 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ac2 ? nop +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009ab0 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009bc8 r9 0x00000000 lr 0x080047b5 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009ab0 in _exit +[1] from 0x080047b4 in __chk_fail +[2] from 0x080046a4 in __sprintf_chk +[3] from 0x08004242 in p_uart_async_write_byte+30 at shared/util/putil.c:35 +[4] from 0x080042aa in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08009ab0 in _exit +### 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: 0x08004524 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9910 lma 0x80001c0 +Loading section .rodata, size 0x4e8 lma 0x8009ad0 +Loading section .ARM, size 0x8 lma 0x8009fb8 +Loading section .init_array, size 0x8 lma 0x8009fc0 +Loading section .fini_array, size 0x8 lma 0x8009fc8 +Loading section .data, size 0x9a8 lma 0x8009fd0 +Start address 0x08004524, load size 43336 +Transfer rate: 29 KB/sec, 4815 bytes/write. +Breakpoint 1 at 0x8004228: file shared/util/putil.c, line 34. +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, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:34 +34 char send[3] = {0}; +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004224 p_uart_async_write_byte+0 push {lr} + 0x08004226 p_uart_async_write_byte+2 sub sp, #20 +!0x08004228 p_uart_async_write_byte+4 ldr r3, [pc, #40] ; (0x8004254 ) + 0x0800422a p_uart_async_write_byte+6 ldrh r3, [r3, #0] + 0x0800422c p_uart_async_write_byte+8 strh.w r3, [sp, #12] + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 + 0x08004232 p_uart_async_write_byte+14 strb.w r1, [sp, #14] +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004228 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20001612 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x080042ab psp 0x00000000 +### Source ########################################################################################################## + 24 return 0; + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[3] = {0}; + 35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:34 +[1] from 0x080042aa in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044da in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:157 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:34 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = "\000\000" +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800422a +halted: PC: 0x0800422c +halted: PC: 0x08004230 +halted: PC: 0x08004232 +halted: PC: 0x08004236 +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## +!0x08004228 p_uart_async_write_byte+4 ldr r3, [pc, #40] ; (0x8004254 ) + 0x0800422a p_uart_async_write_byte+6 ldrh r3, [r3, #0] + 0x0800422c p_uart_async_write_byte+8 strh.w r3, [sp, #12] + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 + 0x08004232 p_uart_async_write_byte+14 strb.w r1, [sp, #14] + 0x08004236 p_uart_async_write_byte+18 str r0, [sp, #0] + 0x08004238 p_uart_async_write_byte+20 ldr r3, [pc, #28] ; (0x8004258 ) + 0x0800423a p_uart_async_write_byte+22 movs r2, #3 + 0x0800423c p_uart_async_write_byte+24 add r0, sp, #12 + 0x0800423e p_uart_async_write_byte+26 bl 0x8004664 <__sprintf_chk> +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004236 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x080042ab psp 0x00000000 +### Source ########################################################################################################## + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[3] = {0}; + 35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004236 in p_uart_async_write_byte+18 at shared/util/putil.c:35 +[1] from 0x080042aa in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044da in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:157 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004236 in p_uart_async_write_byte+18 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = "\000\000" +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08004238 +halted: PC: 0x0800423a +halted: PC: 0x0800423c +halted: PC: 0x0800423e +halted: PC: 0x08004664 + +Program received signal SIGINT, Interrupt. +0x08009ab0 in _exit () +### Assembly ######################################################################################################## + 0x08009ab0 ? b.n 0x8009ab0 <_exit> + 0x08009ab2 ? nop + 0x08009ab4 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ab6 ? nop + 0x08009ab8 ? pop {r3, r4, r5, r6, r7} + 0x08009aba ? pop {r3} + 0x08009abc ? mov lr, r3 + 0x08009abe ? bx lr + 0x08009ac0 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ac2 ? nop +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009ab0 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009bc8 r9 0x00000000 lr 0x080047b5 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009ab0 in _exit +[1] from 0x080047b4 in __chk_fail +[2] from 0x080046a4 in __sprintf_chk +[3] from 0x08004242 in p_uart_async_write_byte+30 at shared/util/putil.c:35 +[4] from 0x080042aa in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080044da in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:157 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08009ab0 in _exit +### Variables ####################################################################################################### +##################################################################################################################### +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9910 lma 0x80001c0 +Loading section .rodata, size 0x4e8 lma 0x8009ad0 +Loading section .ARM, size 0x8 lma 0x8009fb8 +Loading section .init_array, size 0x8 lma 0x8009fc0 +Loading section .fini_array, size 0x8 lma 0x8009fc8 +Loading section .data, size 0x9a8 lma 0x8009fd0 +Start address 0x08004528, load size 43336 +Transfer rate: 29 KB/sec, 4815 bytes/write. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 1, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:34 +34 char send[3] = {0}; +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004224 p_uart_async_write_byte+0 push {lr} + 0x08004226 p_uart_async_write_byte+2 sub sp, #20 +!0x08004228 p_uart_async_write_byte+4 ldr r3, [pc, #44] ; (0x8004258 ) + 0x0800422a p_uart_async_write_byte+6 ldrh r3, [r3, #0] + 0x0800422c p_uart_async_write_byte+8 strh.w r3, [sp, #12] + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 + 0x08004232 p_uart_async_write_byte+14 strb.w r1, [sp, #14] +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004228 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20001612 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x080042af psp 0x00000000 +### Source ########################################################################################################## + 24 return 0; + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[3] = {0}; + 35 sprintf(send, "%02x\n", byte); + 36 asm volatile("nop"); + 37 HAL_UART_Transmit_IT(huart_inst, send, 2); + 38 } +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:34 +[1] from 0x080042ae in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044fa in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:34 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = "\000\000" +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800422a +halted: PC: 0x0800422c +halted: PC: 0x08004230 +halted: PC: 0x08004232 +halted: PC: 0x08004236 +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## +!0x08004228 p_uart_async_write_byte+4 ldr r3, [pc, #44] ; (0x8004258 ) + 0x0800422a p_uart_async_write_byte+6 ldrh r3, [r3, #0] + 0x0800422c p_uart_async_write_byte+8 strh.w r3, [sp, #12] + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 + 0x08004232 p_uart_async_write_byte+14 strb.w r1, [sp, #14] + 0x08004236 p_uart_async_write_byte+18 str r0, [sp, #0] + 0x08004238 p_uart_async_write_byte+20 ldr r3, [pc, #32] ; (0x800425c ) + 0x0800423a p_uart_async_write_byte+22 movs r2, #3 + 0x0800423c p_uart_async_write_byte+24 add r0, sp, #12 + 0x0800423e p_uart_async_write_byte+26 bl 0x8004668 <__sprintf_chk> +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004236 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x080042af psp 0x00000000 +### Source ########################################################################################################## + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[3] = {0}; + 35 sprintf(send, "%02x\n", byte); + 36 asm volatile("nop"); + 37 HAL_UART_Transmit_IT(huart_inst, send, 2); + 38 } +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004236 in p_uart_async_write_byte+18 at shared/util/putil.c:35 +[1] from 0x080042ae in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044fa in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004236 in p_uart_async_write_byte+18 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = "\000\000" +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08004238 +halted: PC: 0x0800423a +halted: PC: 0x0800423c +halted: PC: 0x0800423e +halted: PC: 0x08004668 + +Program received signal SIGINT, Interrupt. +0x08009ab0 in _exit () +### Assembly ######################################################################################################## + 0x08009ab0 ? b.n 0x8009ab0 <_exit> + 0x08009ab2 ? nop + 0x08009ab4 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ab6 ? nop + 0x08009ab8 ? pop {r3, r4, r5, r6, r7} + 0x08009aba ? pop {r3} + 0x08009abc ? mov lr, r3 + 0x08009abe ? bx lr + 0x08009ac0 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ac2 ? nop +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009ab0 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009bc8 r9 0x00000000 lr 0x080047b9 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009ab0 in _exit +[1] from 0x080047b8 in __chk_fail +[2] from 0x080046a8 in __sprintf_chk +[3] from 0x08004242 in p_uart_async_write_byte+30 at shared/util/putil.c:35 +[4] from 0x080042ae in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080044fa in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08009ab0 in _exit +### Variables ####################################################################################################### +##################################################################################################################### +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x97e8 lma 0x80001c0 +Loading section .rodata, size 0x4e8 lma 0x80099a8 +Loading section .ARM, size 0x8 lma 0x8009e90 +Loading section .init_array, size 0x8 lma 0x8009e98 +Loading section .fini_array, size 0x8 lma 0x8009ea0 +Loading section .data, size 0x9a8 lma 0x8009ea8 +Start address 0x080043fc, load size 43040 +Transfer rate: 29 KB/sec, 4782 bytes/write. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 1, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:34 +34 char send[3] = {0}; +### Assembly ######################################################################################################## +~ +~ +~ + 0x080040f8 p_uart_async_write_byte+0 push {lr} + 0x080040fa p_uart_async_write_byte+2 sub sp, #20 +!0x080040fc p_uart_async_write_byte+4 ldr r3, [pc, #44] ; (0x800412c ) + 0x080040fe p_uart_async_write_byte+6 ldrh r3, [r3, #0] + 0x08004100 p_uart_async_write_byte+8 strh.w r3, [sp, #12] + 0x08004104 p_uart_async_write_byte+12 movs r1, #0 + 0x08004106 p_uart_async_write_byte+14 strb.w r1, [sp, #14] +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x080040fc primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20001612 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x08004183 psp 0x00000000 +### Source ########################################################################################################## + 24 return 0; + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[3] = {0}; + 35 sprintf(send, "%02x\n", byte); + 36 asm volatile("nop"); + 37 HAL_UART_Transmit(huart_inst, send, 2, 100); + 38 } +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x080040fc in p_uart_async_write_byte+4 at shared/util/putil.c:34 +[1] from 0x08004182 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080043d0 in p_serial_mgr_service+40 at shared/drivers/p_serial_mgr.c:165 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080040fc in p_uart_async_write_byte+4 at shared/util/putil.c:34 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = "\000\000" +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080040fe +halted: PC: 0x08004100 +halted: PC: 0x08004104 +halted: PC: 0x08004106 +halted: PC: 0x0800410a +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## +!0x080040fc p_uart_async_write_byte+4 ldr r3, [pc, #44] ; (0x800412c ) + 0x080040fe p_uart_async_write_byte+6 ldrh r3, [r3, #0] + 0x08004100 p_uart_async_write_byte+8 strh.w r3, [sp, #12] + 0x08004104 p_uart_async_write_byte+12 movs r1, #0 + 0x08004106 p_uart_async_write_byte+14 strb.w r1, [sp, #14] + 0x0800410a p_uart_async_write_byte+18 str r0, [sp, #0] + 0x0800410c p_uart_async_write_byte+20 ldr r3, [pc, #32] ; (0x8004130 ) + 0x0800410e p_uart_async_write_byte+22 movs r2, #3 + 0x08004110 p_uart_async_write_byte+24 add r0, sp, #12 + 0x08004112 p_uart_async_write_byte+26 bl 0x800453c <__sprintf_chk> +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x0800410a primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x08004183 psp 0x00000000 +### Source ########################################################################################################## + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[3] = {0}; + 35 sprintf(send, "%02x\n", byte); + 36 asm volatile("nop"); + 37 HAL_UART_Transmit(huart_inst, send, 2, 100); + 38 } +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x0800410a in p_uart_async_write_byte+18 at shared/util/putil.c:35 +[1] from 0x08004182 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080043d0 in p_serial_mgr_service+40 at shared/drivers/p_serial_mgr.c:165 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x0800410a in p_uart_async_write_byte+18 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = "\000\000" +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800410c +halted: PC: 0x0800410e +halted: PC: 0x08004110 +halted: PC: 0x08004112 +halted: PC: 0x0800453c + +Program received signal SIGINT, Interrupt. +0x08009988 in _exit () +### Assembly ######################################################################################################## + 0x08009988 ? b.n 0x8009988 <_exit> + 0x0800998a ? nop + 0x0800998c ? push {r3, r4, r5, r6, r7, lr} + 0x0800998e ? nop + 0x08009990 ? pop {r3, r4, r5, r6, r7} + 0x08009992 ? pop {r3} + 0x08009994 ? mov lr, r3 + 0x08009996 ? bx lr + 0x08009998 ? push {r3, r4, r5, r6, r7, lr} + 0x0800999a ? nop +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009988 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009aa0 r9 0x00000000 lr 0x0800468d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009988 in _exit +[1] from 0x0800468c in __chk_fail +[2] from 0x0800457c in __sprintf_chk +[3] from 0x08004116 in p_uart_async_write_byte+30 at shared/util/putil.c:35 +[4] from 0x08004182 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080043d0 in p_serial_mgr_service+40 at shared/drivers/p_serial_mgr.c:165 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08009988 in _exit +### Variables ####################################################################################################### +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x08009988 in _exit () +### Assembly ######################################################################################################## + 0x08009988 ? b.n 0x8009988 <_exit> + 0x0800998a ? nop + 0x0800998c ? push {r3, r4, r5, r6, r7, lr} + 0x0800998e ? nop + 0x08009990 ? pop {r3, r4, r5, r6, r7} + 0x08009992 ? pop {r3} + 0x08009994 ? mov lr, r3 + 0x08009996 ? bx lr + 0x08009998 ? push {r3, r4, r5, r6, r7, lr} + 0x0800999a ? nop +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009988 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009aa0 r9 0x00000000 lr 0x0800468d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009988 in _exit +[1] from 0x0800468c in __chk_fail +[2] from 0x0800457c in __sprintf_chk +[3] from 0x08004116 in p_uart_async_write_byte+30 at shared/util/putil.c:35 +[4] from 0x08004182 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080043d0 in p_serial_mgr_service+40 at shared/drivers/p_serial_mgr.c:165 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08009988 in _exit +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x97e8 lma 0x80001c0 +Loading section .rodata, size 0x4e8 lma 0x80099a8 +Loading section .ARM, size 0x8 lma 0x8009e90 +Loading section .init_array, size 0x8 lma 0x8009e98 +Loading section .fini_array, size 0x8 lma 0x8009ea0 +Loading section .data, size 0x9a8 lma 0x8009ea8 +Start address 0x080043fc, load size 43040 +Transfer rate: 29 KB/sec, 4782 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] +0x08009988 in _exit () +### Assembly ######################################################################################################## + 0x08009988 ? b.n 0x8009988 <_exit> + 0x0800998a ? nop + 0x0800998c ? push {r3, r4, r5, r6, r7, lr} + 0x0800998e ? nop + 0x08009990 ? pop {r3, r4, r5, r6, r7} + 0x08009992 ? pop {r3} + 0x08009994 ? mov lr, r3 + 0x08009996 ? bx lr + 0x08009998 ? push {r3, r4, r5, r6, r7, lr} + 0x0800999a ? nop +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009988 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009aa0 r9 0x00000000 lr 0x0800468d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009988 in _exit +[1] from 0x0800468c in __chk_fail +[2] from 0x0800457c in __sprintf_chk +[3] from 0x08004116 in p_uart_async_write_byte+30 at shared/util/putil.c:35 +[4] from 0x08004182 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080014ee in main+122 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08009988 in _exit +### 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: 0x080043fc msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x97e8 lma 0x80001c0 +Loading section .rodata, size 0x4e8 lma 0x80099a8 +Loading section .ARM, size 0x8 lma 0x8009e90 +Loading section .init_array, size 0x8 lma 0x8009e98 +Loading section .fini_array, size 0x8 lma 0x8009ea0 +Loading section .data, size 0x9a8 lma 0x8009ea8 +Start address 0x080043fc, load size 43040 +Transfer rate: 29 KB/sec, 4782 bytes/write. +Breakpoint 1 at 0x80040fc: file shared/util/putil.c, line 34. +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, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:34 +34 char send[3] = {0}; +### Assembly ######################################################################################################## +~ +~ +~ + 0x080040f8 p_uart_async_write_byte+0 push {lr} + 0x080040fa p_uart_async_write_byte+2 sub sp, #20 +!0x080040fc p_uart_async_write_byte+4 ldr r3, [pc, #44] ; (0x800412c ) + 0x080040fe p_uart_async_write_byte+6 ldrh r3, [r3, #0] + 0x08004100 p_uart_async_write_byte+8 strh.w r3, [sp, #12] + 0x08004104 p_uart_async_write_byte+12 movs r1, #0 + 0x08004106 p_uart_async_write_byte+14 strb.w r1, [sp, #14] +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x080040fc primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20001612 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x08004183 psp 0x00000000 +### Source ########################################################################################################## + 24 return 0; + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[3] = {0}; + 35 sprintf(send, "%02x\n", byte); + 36 asm volatile("nop"); + 37 HAL_UART_Transmit(huart_inst, send, 2, 100); + 38 } +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x080040fc in p_uart_async_write_byte+4 at shared/util/putil.c:34 +[1] from 0x08004182 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080043aa in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:157 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080040fc in p_uart_async_write_byte+4 at shared/util/putil.c:34 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = "\000\000" +##################################################################################################################### +Continuing. +### Output/messages ################################################################################################# +halted: PC: 0x080040fe + +Program received signal SIGINT, Interrupt. +0x08009988 in _exit () +### Assembly ######################################################################################################## + 0x08009988 ? b.n 0x8009988 <_exit> + 0x0800998a ? nop + 0x0800998c ? push {r3, r4, r5, r6, r7, lr} + 0x0800998e ? nop + 0x08009990 ? pop {r3, r4, r5, r6, r7} + 0x08009992 ? pop {r3} + 0x08009994 ? mov lr, r3 + 0x08009996 ? bx lr + 0x08009998 ? push {r3, r4, r5, r6, r7, lr} + 0x0800999a ? nop +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009988 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009aa0 r9 0x00000000 lr 0x0800468d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009988 in _exit +[1] from 0x0800468c in __chk_fail +[2] from 0x0800457c in __sprintf_chk +[3] from 0x08004116 in p_uart_async_write_byte+30 at shared/util/putil.c:35 +[4] from 0x08004182 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080043aa in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:157 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08009988 in _exit +### Variables ####################################################################################################### +##################################################################################################################### +Continuing. +### Output/messages ################################################################################################# + +Program received signal SIGINT, Interrupt. +0x08009988 in _exit () +### Assembly ######################################################################################################## + 0x08009988 ? b.n 0x8009988 <_exit> + 0x0800998a ? nop + 0x0800998c ? push {r3, r4, r5, r6, r7, lr} + 0x0800998e ? nop + 0x08009990 ? pop {r3, r4, r5, r6, r7} + 0x08009992 ? pop {r3} + 0x08009994 ? mov lr, r3 + 0x08009996 ? bx lr + 0x08009998 ? push {r3, r4, r5, r6, r7, lr} + 0x0800999a ? nop +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009988 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x08009aa0 r9 0x00000000 lr 0x0800468d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009988 in _exit +[1] from 0x0800468c in __chk_fail +[2] from 0x0800457c in __sprintf_chk +[3] from 0x08004116 in p_uart_async_write_byte+30 at shared/util/putil.c:35 +[4] from 0x08004182 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080043aa in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:157 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08009988 in _exit +### Variables ####################################################################################################### +##################################################################################################################### +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x97d8 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009998 +Loading section .ARM, size 0x8 lma 0x8009e78 +Loading section .init_array, size 0x8 lma 0x8009e80 +Loading section .fini_array, size 0x8 lma 0x8009e88 +Loading section .data, size 0x9a8 lma 0x8009e90 +Start address 0x080043f0, load size 43016 +Transfer rate: 29 KB/sec, 4779 bytes/write. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 1, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:34 +34 char send[6] = {'\0'}; +### Assembly ######################################################################################################## +~ +~ +~ + 0x080040f8 p_uart_async_write_byte+0 push {lr} + 0x080040fa p_uart_async_write_byte+2 sub sp, #20 +!0x080040fc p_uart_async_write_byte+4 movs r1, #0 + 0x080040fe p_uart_async_write_byte+6 str r1, [sp, #8] + 0x08004100 p_uart_async_write_byte+8 strh.w r1, [sp, #12] + 0x08004104 p_uart_async_write_byte+12 str r0, [sp, #0] + 0x08004106 p_uart_async_write_byte+14 ldr r3, [pc, #28] ; (0x8004124 ) +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x080040fc primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20001612 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x08004177 psp 0x00000000 +### Source ########################################################################################################## + 24 return 0; + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[6] = {'\0'}; + 35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit(huart_inst, send, 2, 100); + 37 } +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x080040fc in p_uart_async_write_byte+4 at shared/util/putil.c:34 +[1] from 0x08004176 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080040fc in p_uart_async_write_byte+4 at shared/util/putil.c:34 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = "\000\000\000\000\000" +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080040fe +halted: PC: 0x08004100 +halted: PC: 0x08004104 +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## + 0x080040f8 p_uart_async_write_byte+0 push {lr} + 0x080040fa p_uart_async_write_byte+2 sub sp, #20 +!0x080040fc p_uart_async_write_byte+4 movs r1, #0 + 0x080040fe p_uart_async_write_byte+6 str r1, [sp, #8] + 0x08004100 p_uart_async_write_byte+8 strh.w r1, [sp, #12] + 0x08004104 p_uart_async_write_byte+12 str r0, [sp, #0] + 0x08004106 p_uart_async_write_byte+14 ldr r3, [pc, #28] ; (0x8004124 ) + 0x08004108 p_uart_async_write_byte+16 movs r2, #6 + 0x0800410a p_uart_async_write_byte+18 add r0, sp, #8 + 0x0800410c p_uart_async_write_byte+20 bl 0x8004530 <__sprintf_chk> +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004104 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20001612 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x08004177 psp 0x00000000 +### Source ########################################################################################################## + 25 } + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[6] = {'\0'}; + 35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit(huart_inst, send, 2, 100); + 37 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004104 in p_uart_async_write_byte+12 at shared/util/putil.c:35 +[1] from 0x08004176 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004104 in p_uart_async_write_byte+12 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 126 '~' +loc send = "\000\000\000\000\000" +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08004106 +halted: PC: 0x08004108 +halted: PC: 0x0800410a +halted: PC: 0x0800410c +halted: PC: 0x08004530 +36 HAL_UART_Transmit(huart_inst, send, 2, 100); +### Assembly ######################################################################################################## + 0x08004104 p_uart_async_write_byte+12 str r0, [sp, #0] + 0x08004106 p_uart_async_write_byte+14 ldr r3, [pc, #28] ; (0x8004124 ) + 0x08004108 p_uart_async_write_byte+16 movs r2, #6 + 0x0800410a p_uart_async_write_byte+18 add r0, sp, #8 + 0x0800410c p_uart_async_write_byte+20 bl 0x8004530 <__sprintf_chk> + 0x08004110 p_uart_async_write_byte+24 movs r3, #100 ; 0x64 + 0x08004112 p_uart_async_write_byte+26 movs r2, #2 + 0x08004114 p_uart_async_write_byte+28 add r1, sp, #8 + 0x08004116 p_uart_async_write_byte+30 ldr r0, [pc, #16] ; (0x8004128 ) + 0x08004118 p_uart_async_write_byte+32 ldr r0, [r0, #0] +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000003 r5 0x00004001 r10 0x00000000 pc 0x08004110 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x810f0035 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x08009a4d fpscr 0x00000000 faultmask 0x00 + r3 0x2000ff53 r8 0x00000000 sp 0x2000ff48 msp 0x2000ff48 control 0x04 + r4 0x20000a60 r9 0x00000000 lr 0x08004111 psp 0x00000000 +### Source ########################################################################################################## + 26 void p_uart_init(UART_HandleTypeDef *huart) + 27 { + 28 huart_inst = huart; + 29 PDEBUG("...\n"); + 30 PDEBUG("UART2 Initialized\n"); + 31 } + 32 void p_uart_async_write_byte(uint8_t byte) + 33 { +!34 char send[6] = {'\0'}; + 35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit(huart_inst, send, 2, 100); + 37 } +~ +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004110 in p_uart_async_write_byte+24 at shared/util/putil.c:36 +[1] from 0x08004176 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x08003492 in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x080035e4 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004110 in p_uart_async_write_byte+24 at shared/util/putil.c:36 +### Variables ####################################################################################################### +arg byte = +loc send = "7e\n\000\000" +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08004112 +halted: PC: 0x08004114 +halted: PC: 0x08004116 +halted: PC: 0x08004118 +halted: PC: 0x0800411a +halted: PC: 0x08003cca +halted: PC: 0x08004120 +halted: PC: 0x08004176 +UART1_RxCpltCallback (huart=) at shared/drivers/p_serial_mgr.c:43 +43 switch (sstate) +### Assembly ######################################################################################################## +~ + 0x0800416c UART1_RxCpltCallback+0 push {r3, lr} + 0x0800416e UART1_RxCpltCallback+2 ldr r3, [pc, #472] ; (0x8004348 ) + 0x08004170 UART1_RxCpltCallback+4 ldrb r0, [r3, #0] + 0x08004172 UART1_RxCpltCallback+6 bl 0x80040f8 + 0x08004176 UART1_RxCpltCallback+10 ldr r3, [pc, #468] ; (0x800434c ) + 0x08004178 UART1_RxCpltCallback+12 ldrb r3, [r3, #0] + 0x0800417a UART1_RxCpltCallback+14 cmp r3, #4 + 0x0800417c UART1_RxCpltCallback+16 bhi.w 0x800433e + 0x08004180 UART1_RxCpltCallback+20 tbb [pc, r3] +### Breakpoints ##################################################################################################### +[1] break at 0x080040fc in shared/util/putil.c:34 for putil.c:34 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00004001 r10 0x00000000 pc 0x08004176 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0035 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009a4d fpscr 0x00000000 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000ff60 msp 0x2000ff60 control 0x04 + r4 0x20000a60 r9 0x00000000 lr 0x08003c27 psp 0x00000000 +### Source ########################################################################################################## + 33 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 p_uart_async_write_byte(rxc); + 43 switch (sstate) + 44 { + 45 case SS_IDLE: // packet start + 46 { + 47 if (rxc == 0x7E) + 48 { + 49 sstate = SS_START; + 50 } + 51 } + 52 break; +### Stack ########################################################################################################### +[0] from 0x08004176 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:43 +[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 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004176 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:43 +### Variables ####################################################################################################### +arg huart = +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +UART1_RxCpltCallback (huart=) at shared/drivers/p_serial_mgr.c:43 +43 switch (sstate) +### Assembly ######################################################################################################## +~ + 0x0800416c UART1_RxCpltCallback+0 push {r3, lr} + 0x0800416e UART1_RxCpltCallback+2 ldr r3, [pc, #472] ; (0x8004348 ) + 0x08004170 UART1_RxCpltCallback+4 ldrb r0, [r3, #0] + 0x08004172 UART1_RxCpltCallback+6 bl 0x80040f8 + 0x08004176 UART1_RxCpltCallback+10 ldr r3, [pc, #468] ; (0x800434c ) + 0x08004178 UART1_RxCpltCallback+12 ldrb r3, [r3, #0] + 0x0800417a UART1_RxCpltCallback+14 cmp r3, #4 + 0x0800417c UART1_RxCpltCallback+16 bhi.w 0x800433e + 0x08004180 UART1_RxCpltCallback+20 tbb [pc, r3] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00004001 r10 0x00000000 pc 0x08004176 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0035 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009a4d fpscr 0x00000000 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000ff60 msp 0x2000ff60 control 0x04 + r4 0x20000a60 r9 0x00000000 lr 0x08003c27 psp 0x00000000 +### Source ########################################################################################################## + 33 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 p_uart_async_write_byte(rxc); + 43 switch (sstate) + 44 { + 45 case SS_IDLE: // packet start + 46 { + 47 if (rxc == 0x7E) + 48 { + 49 sstate = SS_START; + 50 } + 51 } + 52 break; +### Stack ########################################################################################################### +[0] from 0x08004176 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:43 +[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 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004176 in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:43 +### Variables ####################################################################################################### +arg huart = +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x97d8 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009998 +Loading section .ARM, size 0x8 lma 0x8009e78 +Loading section .init_array, size 0x8 lma 0x8009e80 +Loading section .fini_array, size 0x8 lma 0x8009e88 +Loading section .data, size 0x9a8 lma 0x8009e90 +Start address 0x080043f0, load size 43016 +Transfer rate: 29 KB/sec, 4779 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] +0x080043c2 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:164 +164 return NULL; +### Assembly ######################################################################################################## + 0x080043b6 p_serial_mgr_service+26 add r0, r2 + 0x080043b8 p_serial_mgr_service+28 ldrb.w r2, [r0, #260] ; 0x104 + 0x080043bc p_serial_mgr_service+32 cmp r2, #0 + 0x080043be p_serial_mgr_service+34 beq.n 0x80043a0 + 0x080043c0 p_serial_mgr_service+36 b.n 0x80043c4 + 0x080043c2 p_serial_mgr_service+38 movs r0, #0 + 0x080043c4 p_serial_mgr_service+40 bx lr + 0x080043c6 p_serial_mgr_service+42 nop + 0x080043c8 p_serial_mgr_service+44 asrs r4, r2, #24 + 0x080043ca p_serial_mgr_service+46 movs r0, #0 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080043c2 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 154 serial_pkt_t *p_serial_mgr_service(void) + 155 { + 156 // this will be less garbage when i switch to a queue + 157 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 158 { + 159 if (serial_pkt_cb.buffer[ind].b_ready) + 160 { + 161 return &serial_pkt_cb.buffer[ind]; + 162 } + 163 } + 164 return NULL; + 165 } + 166 + 167 void p_serial_mgr_start() + 168 { + 169 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 170 } +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x080043c2 in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080043c2 in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x97d8 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009998 +Loading section .ARM, size 0x8 lma 0x8009e78 +Loading section .init_array, size 0x8 lma 0x8009e80 +Loading section .fini_array, size 0x8 lma 0x8009e88 +Loading section .data, size 0x9a8 lma 0x8009e90 +Start address 0x080043f0, load size 43016 +Transfer rate: 29 KB/sec, 4779 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] +0x08009978 in _fstat_r () +### Assembly ######################################################################################################## + 0x08009978 ? b.n 0x8009978 <_fstat_r+28> + 0x0800997a ? nop + 0x0800997c ? push {r3, r4, r5, r6, r7, lr} + 0x0800997e ? nop + 0x08009980 ? pop {r3, r4, r5, r6, r7} + 0x08009982 ? pop {r3} + 0x08009984 ? mov lr, r3 + 0x08009986 ? bx lr + 0x08009988 ? push {r3, r4, r5, r6, r7, lr} + 0x0800998a ? nop +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009978 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000ff00 msp 0x2000ff00 control 0x04 + r4 0x08009a8c r9 0x00000000 lr 0x08004681 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009978 in _fstat_r +[1] from 0x08004680 in __sprintf_chk +### Threads ######################################################################################################### +[1] id 0 from 0x08009978 in _fstat_r +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9900 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009ac0 +Loading section .ARM, size 0x8 lma 0x8009fa0 +Loading section .init_array, size 0x8 lma 0x8009fa8 +Loading section .fini_array, size 0x8 lma 0x8009fb0 +Loading section .data, size 0x9a8 lma 0x8009fb8 +Start address 0x08004518, load size 43312 +Transfer rate: 29 KB/sec, 4812 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] +0x08009aa0 in _exit () +### Assembly ######################################################################################################## + 0x08009aa0 ? b.n 0x8009aa0 <_exit> + 0x08009aa2 ? nop + 0x08009aa4 ? push {r3, r4, r5, r6, r7, lr} + 0x08009aa6 ? nop + 0x08009aa8 ? pop {r3, r4, r5, r6, r7} + 0x08009aaa ? pop {r3} + 0x08009aac ? mov lr, r3 + 0x08009aae ? bx lr + 0x08009ab0 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ab2 ? nop +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009aa0 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000ff00 msp 0x2000ff00 control 0x04 + r4 0x08009bb4 r9 0x00000000 lr 0x080047a9 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009aa0 in _exit +[1] from 0x080047a8 in __chk_fail +[2] from 0x08004698 in __sprintf_chk +[3] from 0x08004238 in p_uart_async_write_byte+20 at shared/util/putil.c:35 +[4] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080014ee in main+122 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08009aa0 in _exit +### 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: 0x08004518 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9900 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009ac0 +Loading section .ARM, size 0x8 lma 0x8009fa0 +Loading section .init_array, size 0x8 lma 0x8009fa8 +Loading section .fini_array, size 0x8 lma 0x8009fb0 +Loading section .data, size 0x9a8 lma 0x8009fb8 +Start address 0x08004518, load size 43312 +Transfer rate: 29 KB/sec, 4812 bytes/write. +Breakpoint 1 at 0x8004228: file shared/util/putil.c, line 35. +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, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:35 +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004224 p_uart_async_write_byte+0 push {r4, lr} + 0x08004226 p_uart_async_write_byte+2 sub sp, #8 +!0x08004228 p_uart_async_write_byte+4 ldr r4, [pc, #28] ; (0x8004248 ) + 0x0800422a p_uart_async_write_byte+6 str r0, [sp, #0] + 0x0800422c p_uart_async_write_byte+8 ldr r3, [pc, #28] ; (0x800424c ) + 0x0800422e p_uart_async_write_byte+10 movs r2, #3 + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:35 for putil.c:35 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004228 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20001616 r8 0x00000000 sp 0x2000ff50 msp 0x2000ff50 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x0800429f psp 0x00000000 +### Source ########################################################################################################## + 25 return 0; + 26 } + 27 void p_uart_init(UART_HandleTypeDef *huart) + 28 { + 29 huart_inst = huart; + 30 PDEBUG("...\n"); + 31 PDEBUG("UART2 Initialized\n"); + 32 } + 33 void p_uart_async_write_byte(uint8_t byte) + 34 { +!35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +[1] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044ce in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:157 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 126 '~' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800422a +halted: PC: 0x0800422c +halted: PC: 0x0800422e +halted: PC: 0x08004230 +halted: PC: 0x08004232 +halted: PC: 0x08004234 +halted: PC: 0x08004658 + +Program received signal SIGINT, Interrupt. +0x08009aa0 in _exit () +### Assembly ######################################################################################################## + 0x08009aa0 ? b.n 0x8009aa0 <_exit> + 0x08009aa2 ? nop + 0x08009aa4 ? push {r3, r4, r5, r6, r7, lr} + 0x08009aa6 ? nop + 0x08009aa8 ? pop {r3, r4, r5, r6, r7} + 0x08009aaa ? pop {r3} + 0x08009aac ? mov lr, r3 + 0x08009aae ? bx lr + 0x08009ab0 ? push {r3, r4, r5, r6, r7, lr} + 0x08009ab2 ? nop +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:35 for putil.c:35 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007f r5 0x00004001 r10 0x00000000 pc 0x08009aa0 primask 0x00 + r1 0x00000006 r6 0x00000000 r11 0x00000000 xPSR 0x21010035 basepri 0x00 + r2 0x00000058 r7 0x00000000 r12 0x20000010 fpscr 0x00000000 faultmask 0x00 + r3 0x00000058 r8 0x00000000 sp 0x2000ff00 msp 0x2000ff00 control 0x04 + r4 0x08009bb4 r9 0x00000000 lr 0x080047a9 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08009aa0 in _exit +[1] from 0x080047a8 in __chk_fail +[2] from 0x08004698 in __sprintf_chk +[3] from 0x08004238 in p_uart_async_write_byte+20 at shared/util/putil.c:35 +[4] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[5] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[6] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[7] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[8] from 0xffffffe9 +[9] from 0x080044ce in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:157 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08009aa0 in _exit +### Variables ####################################################################################################### +##################################################################################################################### +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9900 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009ac0 +Loading section .ARM, size 0x8 lma 0x8009fa0 +Loading section .init_array, size 0x8 lma 0x8009fa8 +Loading section .fini_array, size 0x8 lma 0x8009fb0 +Loading section .data, size 0x9a8 lma 0x8009fb8 +Start address 0x08004518, load size 43312 +Transfer rate: 29 KB/sec, 4812 bytes/write. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 1, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:35 +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004224 p_uart_async_write_byte+0 push {r4, lr} + 0x08004226 p_uart_async_write_byte+2 sub sp, #8 +!0x08004228 p_uart_async_write_byte+4 ldr r4, [pc, #28] ; (0x8004248 ) + 0x0800422a p_uart_async_write_byte+6 str r0, [sp, #0] + 0x0800422c p_uart_async_write_byte+8 ldr r3, [pc, #28] ; (0x800424c ) + 0x0800422e p_uart_async_write_byte+10 movs r2, #10 + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:35 for putil.c:35 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004228 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x2000161e r8 0x00000000 sp 0x2000ff50 msp 0x2000ff50 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x0800429f psp 0x00000000 +### Source ########################################################################################################## + 25 return 0; + 26 } + 27 void p_uart_init(UART_HandleTypeDef *huart) + 28 { + 29 huart_inst = huart; + 30 PDEBUG("...\n"); + 31 PDEBUG("UART2 Initialized\n"); + 32 } + 33 void p_uart_async_write_byte(uint8_t byte) + 34 { +!35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +[1] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044ea in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 126 '~' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800422a +halted: PC: 0x0800422c +halted: PC: 0x0800422e +halted: PC: 0x08004230 +halted: PC: 0x08004232 +halted: PC: 0x08004234 +halted: PC: 0x08004658 +36 HAL_UART_Transmit_IT(huart_inst, send, 2); +### Assembly ######################################################################################################## + 0x0800422c p_uart_async_write_byte+8 ldr r3, [pc, #28] ; (0x800424c ) + 0x0800422e p_uart_async_write_byte+10 movs r2, #10 + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 + 0x08004232 p_uart_async_write_byte+14 mov r0, r4 + 0x08004234 p_uart_async_write_byte+16 bl 0x8004658 <__sprintf_chk> + 0x08004238 p_uart_async_write_byte+20 movs r2, #2 + 0x0800423a p_uart_async_write_byte+22 mov r1, r4 + 0x0800423c p_uart_async_write_byte+24 ldr r3, [pc, #16] ; (0x8004250 ) + 0x0800423e p_uart_async_write_byte+26 ldr r0, [r3, #0] + 0x08004240 p_uart_async_write_byte+28 bl 0x8003624 +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:35 for putil.c:35 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000003 r5 0x00004001 r10 0x00000000 pc 0x08004238 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x810f0035 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x08009b75 fpscr 0x00000000 faultmask 0x00 + r3 0x20000bdb r8 0x00000000 sp 0x2000ff50 msp 0x2000ff50 control 0x04 + r4 0x20000bd8 r9 0x00000000 lr 0x08004239 psp 0x00000000 +### Source ########################################################################################################## + 26 } + 27 void p_uart_init(UART_HandleTypeDef *huart) + 28 { + 29 huart_inst = huart; + 30 PDEBUG("...\n"); + 31 PDEBUG("UART2 Initialized\n"); + 32 } + 33 void p_uart_async_write_byte(uint8_t byte) + 34 { +!35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004238 in p_uart_async_write_byte+20 at shared/util/putil.c:36 +[1] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044ea in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004238 in p_uart_async_write_byte+20 at shared/util/putil.c:36 +### Variables ####################################################################################################### +arg byte = +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800423a +halted: PC: 0x0800423c +halted: PC: 0x0800423e +halted: PC: 0x08004240 +halted: PC: 0x08003624 +halted: PC: 0x08004246 +halted: PC: 0x0800429e +UART1_RxCpltCallback (huart=) at shared/drivers/p_serial_mgr.c:43 +43 switch (sstate) +### Assembly ######################################################################################################## +~ + 0x08004294 UART1_RxCpltCallback+0 push {r3, lr} + 0x08004296 UART1_RxCpltCallback+2 ldr r3, [pc, #472] ; (0x8004470 ) + 0x08004298 UART1_RxCpltCallback+4 ldrb r0, [r3, #0] + 0x0800429a UART1_RxCpltCallback+6 bl 0x8004224 + 0x0800429e UART1_RxCpltCallback+10 ldr r3, [pc, #468] ; (0x8004474 ) + 0x080042a0 UART1_RxCpltCallback+12 ldrb r3, [r3, #0] + 0x080042a2 UART1_RxCpltCallback+14 cmp r3, #4 + 0x080042a4 UART1_RxCpltCallback+16 bhi.w 0x8004466 + 0x080042a8 UART1_RxCpltCallback+20 tbb [pc, r3] +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:35 for putil.c:35 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00004001 r10 0x00000000 pc 0x0800429e primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x610f0035 basepri 0x00 + r2 0x40004400 r7 0x00000000 r12 0x08009b75 fpscr 0x00000000 faultmask 0x00 + r3 0x000000ad r8 0x00000000 sp 0x2000ff60 msp 0x2000ff60 control 0x04 + r4 0x20000a60 r9 0x00000000 lr 0x08004245 psp 0x00000000 +### Source ########################################################################################################## + 33 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 p_uart_async_write_byte(rxc); + 43 switch (sstate) + 44 { + 45 case SS_IDLE: // packet start + 46 { + 47 if (rxc == 0x7E) + 48 { + 49 sstate = SS_START; + 50 } + 51 } + 52 break; +### Stack ########################################################################################################### +[0] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:43 +[1] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x08003710 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 0x080044ea in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[6] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:43 +### Variables ####################################################################################################### +arg huart = +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080042a0 +halted: PC: 0x080042a2 +halted: PC: 0x080042a4 +halted: PC: 0x080042a8 +halted: PC: 0x080042b2 +47 if (rxc == 0x7E) +### Assembly ######################################################################################################## + 0x080042a4 UART1_RxCpltCallback+16 bhi.w 0x8004466 + 0x080042a8 UART1_RxCpltCallback+20 tbb [pc, r3] + 0x080042ac UART1_RxCpltCallback+24 lsrs r3, r0, #16 + 0x080042ae UART1_RxCpltCallback+26 ldrh r7, [r1, #42] ; 0x2a + 0x080042b0 UART1_RxCpltCallback+28 lsls r0, r7, #2 + 0x080042b2 UART1_RxCpltCallback+30 ldr r3, [pc, #444] ; (0x8004470 ) + 0x080042b4 UART1_RxCpltCallback+32 ldrb r3, [r3, #0] + 0x080042b6 UART1_RxCpltCallback+34 cmp r3, #126 ; 0x7e + 0x080042b8 UART1_RxCpltCallback+36 bne.w 0x8004458 + 0x080042bc UART1_RxCpltCallback+40 ldr r3, [pc, #436] ; (0x8004474 ) +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:35 for putil.c:35 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00004001 r10 0x00000000 pc 0x080042b2 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x810f0035 basepri 0x00 + r2 0x40004400 r7 0x00000000 r12 0x08009b75 fpscr 0x00000000 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000ff60 msp 0x2000ff60 control 0x04 + r4 0x20000a60 r9 0x00000000 lr 0x08004245 psp 0x00000000 +### Source ########################################################################################################## + 37 + 38 #pragma message(Reminder "Move away from cirular buffer to a managed queue") + 39 + 40 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 41 { + 42 p_uart_async_write_byte(rxc); + 43 switch (sstate) + 44 { + 45 case SS_IDLE: // packet start + 46 { + 47 if (rxc == 0x7E) + 48 { + 49 sstate = SS_START; + 50 } + 51 } + 52 break; + 53 case SS_START: + 54 { + 55 switch (start_index_tracker) + 56 { +### Stack ########################################################################################################### +[0] from 0x080042b2 in UART1_RxCpltCallback+30 at shared/drivers/p_serial_mgr.c:47 +[1] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x08003710 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 0x080044ea in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[6] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080042b2 in UART1_RxCpltCallback+30 at shared/drivers/p_serial_mgr.c:47 +### Variables ####################################################################################################### +arg huart = +##################################################################################################################### +Continuing. +### Output/messages ################################################################################################# + +Breakpoint 1, p_uart_async_write_byte (byte=1 '\001') at shared/util/putil.c:35 +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004224 p_uart_async_write_byte+0 push {r4, lr} + 0x08004226 p_uart_async_write_byte+2 sub sp, #8 +!0x08004228 p_uart_async_write_byte+4 ldr r4, [pc, #28] ; (0x8004248 ) + 0x0800422a p_uart_async_write_byte+6 str r0, [sp, #0] + 0x0800422c p_uart_async_write_byte+8 ldr r3, [pc, #28] ; (0x800424c ) + 0x0800422e p_uart_async_write_byte+10 movs r2, #10 + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:35 for putil.c:35 hit 2 times +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000001 r5 0x00004001 r10 0x00000000 pc 0x08004228 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x810f0035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x08009b75 fpscr 0x00000000 faultmask 0x00 + r3 0x2000161e r8 0x00000000 sp 0x2000ff50 msp 0x2000ff50 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x0800429f psp 0x00000000 +### Source ########################################################################################################## + 25 return 0; + 26 } + 27 void p_uart_init(UART_HandleTypeDef *huart) + 28 { + 29 huart_inst = huart; + 30 PDEBUG("...\n"); + 31 PDEBUG("UART2 Initialized\n"); + 32 } + 33 void p_uart_async_write_byte(uint8_t byte) + 34 { +!35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +[1] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x080037ba in HAL_UART_IRQHandler+278 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2427 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044ea in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 1 '\001' +##################################################################################################################### +Continuing. +### Output/messages ################################################################################################# +halted: PC: 0x0800422a + +Breakpoint 1, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:35 +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004224 p_uart_async_write_byte+0 push {r4, lr} + 0x08004226 p_uart_async_write_byte+2 sub sp, #8 +!0x08004228 p_uart_async_write_byte+4 ldr r4, [pc, #28] ; (0x8004248 ) + 0x0800422a p_uart_async_write_byte+6 str r0, [sp, #0] + 0x0800422c p_uart_async_write_byte+8 ldr r3, [pc, #28] ; (0x800424c ) + 0x0800422e p_uart_async_write_byte+10 movs r2, #10 + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:35 for putil.c:35 hit 3 times +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004228 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x810f0035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x08009b75 fpscr 0x00000000 faultmask 0x00 + r3 0x2000161e r8 0x00000000 sp 0x2000ff50 msp 0x2000ff50 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x0800429f psp 0x00000000 +### Source ########################################################################################################## + 25 return 0; + 26 } + 27 void p_uart_init(UART_HandleTypeDef *huart) + 28 { + 29 huart_inst = huart; + 30 PDEBUG("...\n"); + 31 PDEBUG("UART2 Initialized\n"); + 32 } + 33 void p_uart_async_write_byte(uint8_t byte) + 34 { +!35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +[1] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x080037ba in HAL_UART_IRQHandler+278 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2427 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044ea in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 126 '~' +##################################################################################################################### +Continuing. +### Output/messages ################################################################################################# +halted: PC: 0x0800422a + +Breakpoint 1, p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:35 +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004224 p_uart_async_write_byte+0 push {r4, lr} + 0x08004226 p_uart_async_write_byte+2 sub sp, #8 +!0x08004228 p_uart_async_write_byte+4 ldr r4, [pc, #28] ; (0x8004248 ) + 0x0800422a p_uart_async_write_byte+6 str r0, [sp, #0] + 0x0800422c p_uart_async_write_byte+8 ldr r3, [pc, #28] ; (0x800424c ) + 0x0800422e p_uart_async_write_byte+10 movs r2, #10 + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 +### Breakpoints ##################################################################################################### +[1] break at 0x08004228 in shared/util/putil.c:35 for putil.c:35 hit 4 times +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004228 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x2000161e r8 0x00000000 sp 0x2000ff50 msp 0x2000ff50 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x0800429f psp 0x00000000 +### Source ########################################################################################################## + 25 return 0; + 26 } + 27 void p_uart_init(UART_HandleTypeDef *huart) + 28 { + 29 huart_inst = huart; + 30 PDEBUG("...\n"); + 31 PDEBUG("UART2 Initialized\n"); + 32 } + 33 void p_uart_async_write_byte(uint8_t byte) + 34 { +!35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +[1] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044ea in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 126 '~' +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +p_uart_async_write_byte (byte=126 '~') at shared/util/putil.c:35 +35 sprintf(send, "%02x\n", byte); +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004224 p_uart_async_write_byte+0 push {r4, lr} + 0x08004226 p_uart_async_write_byte+2 sub sp, #8 + 0x08004228 p_uart_async_write_byte+4 ldr r4, [pc, #28] ; (0x8004248 ) + 0x0800422a p_uart_async_write_byte+6 str r0, [sp, #0] + 0x0800422c p_uart_async_write_byte+8 ldr r3, [pc, #28] ; (0x800424c ) + 0x0800422e p_uart_async_write_byte+10 movs r2, #10 + 0x08004230 p_uart_async_write_byte+12 movs r1, #0 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0000007e r5 0x00004001 r10 0x00000000 pc 0x08004228 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x2000161e r8 0x00000000 sp 0x2000ff50 msp 0x2000ff50 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x0800429f psp 0x00000000 +### Source ########################################################################################################## + 25 return 0; + 26 } + 27 void p_uart_init(UART_HandleTypeDef *huart) + 28 { + 29 huart_inst = huart; + 30 PDEBUG("...\n"); + 31 PDEBUG("UART2 Initialized\n"); + 32 } + 33 void p_uart_async_write_byte(uint8_t byte) + 34 { + 35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +[1] from 0x0800429e in UART1_RxCpltCallback+10 at shared/drivers/p_serial_mgr.c:42 +[2] from 0x0800353e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[3] from 0x08003710 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[4] from 0x08001588 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[5] from 0xffffffe9 +[6] from 0x080044ea in p_serial_mgr_service+38 at shared/drivers/p_serial_mgr.c:164 +[7] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004228 in p_uart_async_write_byte+4 at shared/util/putil.c:35 +### Variables ####################################################################################################### +arg byte = 126 '~' +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9900 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009ac0 +Loading section .ARM, size 0x8 lma 0x8009fa0 +Loading section .init_array, size 0x8 lma 0x8009fa8 +Loading section .fini_array, size 0x8 lma 0x8009fb0 +Loading section .data, size 0x9a8 lma 0x8009fb8 +Start address 0x08004518, load size 43312 +Transfer rate: 29 KB/sec, 4812 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] +0x080014f2 in main () at Core/Src/main.c:146 +146 if ((pkt = p_serial_mgr_service()) != NULL) +### Assembly ######################################################################################################## + 0x080014e0 main+108 bl 0x8004098 + 0x080014e4 main+112 ldr r0, [pc, #104] ; (0x8001550 ) + 0x080014e6 main+114 bl 0x80019b8 + 0x080014ea main+118 bl 0x80044f4 + 0x080014ee main+122 bl 0x80044c4 + 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 ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014f2 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### 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 \031E\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\0… +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x97d8 lma 0x80001c0 +Loading section .rodata, size 0x4e0 lma 0x8009998 +Loading section .ARM, size 0x8 lma 0x8009e78 +Loading section .init_array, size 0x8 lma 0x8009e80 +Loading section .fini_array, size 0x8 lma 0x8009e88 +Loading section .data, size 0x9a8 lma 0x8009e90 +Start address 0x080043f0, load size 43016 +Transfer rate: 29 KB/sec, 4779 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] +0x080043a6 in __libc_init_array () +### Assembly ######################################################################################################## + 0x080043a6 ? cmp r2, r3 + 0x080043a8 ? ble.n 0x80043c2 <__libc_init_array+62> + 0x080043aa ? ldr r2, [pc, #28] ; (0x80043c8 <__libc_init_array+68>) + 0x080043ac ? ldr r0, [r2, #0] + 0x080043ae ? add.w r2, r3, r3, lsl #6 + 0x080043b2 ? add.w r2, r3, r2, lsl #2 + 0x080043b6 ? add r0, r2 + 0x080043b8 ? ldrb.w r2, [r0, #260] ; 0x104 + 0x080043bc ? cmp r2, #0 + 0x080043be ? beq.n 0x80043a0 <__libc_init_array+28> +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080043a6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x080043a6 in __libc_init_array +[1] from 0x080014f2 in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080043a6 in __libc_init_array +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9718 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x80098d8 +Loading section .ARM, size 0x8 lma 0x8009da0 +Loading section .init_array, size 0x8 lma 0x8009da8 +Loading section .fini_array, size 0x8 lma 0x8009db0 +Loading section .data, size 0x9a8 lma 0x8009db8 +Start address 0x08004330, load size 42800 +Transfer rate: 29 KB/sec, 4755 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] +0x080014f4 in main () at Core/Src/main.c:156 +156 PDEBUG("\n"); +### Assembly ######################################################################################################## + 0x080014e4 main+164 ldr r0, [pc, #104] ; (0x8001550 ) + 0x080014e6 main+166 bl 0x80019b8 + 0x080014ea main+170 bl 0x800430c + 0x080014ee main+174 bl 0x80042dc + 0x080014f2 main+178 mov r4, r0 + 0x080014f4 main+180 cmp r0, #0 + 0x080014f6 main+182 beq.n 0x80014ee + 0x080014f8 main+184 ldrb.w r2, [r0, #257] ; 0x101 + 0x080014fc main+188 ldrb.w r1, [r0, #256] ; 0x100 + 0x08001500 main+192 ldr r0, [pc, #80] ; (0x8001554 ) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014f4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 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 { + 156 PDEBUG("\n"); + 157 } + 158 PDEBUG("%02x ", pkt->frame_data[ind]); + 159 } + 160 PDEBUG("\nChecksum: %02x\n\n"); + 161 memset(pkt, 0, sizeof(serial_pkt_t)); + 162 } + 163 /* USER CODE END WHILE */ + 164 + 165 /* USER CODE BEGIN 3 */ +### Stack ########################################################################################################### +[0] from 0x080014f4 in main+180 at Core/Src/main.c:156 +### Threads ######################################################################################################### +[1] id 0 from 0x080014f4 in main+180 at Core/Src/main.c:156 +### Variables ####################################################################################################### +loc pkt = 0x0: {frame_data = "\000\000\001 1C\000\bi\025\000\bk\025\000\bm\025\000\bo\025\000\bq\025\… +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9788 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009948 +Loading section .ARM, size 0x8 lma 0x8009e10 +Loading section .init_array, size 0x8 lma 0x8009e18 +Loading section .fini_array, size 0x8 lma 0x8009e20 +Loading section .data, size 0x9a8 lma 0x8009e28 +Start address 0x080043a0, load size 42912 +Transfer rate: 29 KB/sec, 4768 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] +0x0800435c in memset () +### Assembly ######################################################################################################## + 0x0800435c ? ldr r0, [r2, #0] + 0x0800435e ? add.w r2, r3, r3, lsl #6 + 0x08004362 ? add.w r2, r3, r2, lsl #2 + 0x08004366 ? add r0, r2 + 0x08004368 ? ldrb.w r2, [r0, #260] ; 0x104 + 0x0800436c ? cmp r2, #0 + 0x0800436e ? beq.n 0x8004350 + 0x08004370 ? b.n 0x8004374 + 0x08004372 ? movs r0, #0 + 0x08004374 ? bx lr +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000ced r5 0x200009c8 r10 0x00000000 pc 0x0800435c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x2000161c r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000002 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x0800435c in memset +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x0800435c in memset +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x95d0 lma 0x80001c0 +Loading section .rodata, size 0x4c0 lma 0x8009790 +Loading section .ARM, size 0x8 lma 0x8009c50 +Loading section .init_array, size 0x8 lma 0x8009c58 +Loading section .fini_array, size 0x8 lma 0x8009c60 +Loading section .data, size 0x9a8 lma 0x8009c68 +Start address 0x08004228, load size 42464 +Transfer rate: 29 KB/sec, 4718 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] +0x080041ea in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:158 +158 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ######################################################################################################## + 0x080041de p_serial_mgr_service+10 cmp r2, r3 + 0x080041e0 p_serial_mgr_service+12 ble.n 0x80041fa + 0x080041e2 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x8004200 ) + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080041e6 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 + 0x080041ea p_serial_mgr_service+22 add.w r2, r3, r2, lsl #2 + 0x080041ee p_serial_mgr_service+26 add r0, r2 + 0x080041f0 p_serial_mgr_service+28 ldrb.w r2, [r0, #260] ; 0x104 + 0x080041f4 p_serial_mgr_service+32 cmp r2, #0 + 0x080041f6 p_serial_mgr_service+34 beq.n 0x80041d8 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000bdc r5 0x200009c8 r10 0x00000000 pc 0x080041ea primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000082 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000002 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() + 167 { +### Stack ########################################################################################################### +[0] from 0x080041ea in p_serial_mgr_service+22 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041ea in p_serial_mgr_service+22 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 2 +##################################################################################################################### +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: 0x08004228 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x95d0 lma 0x80001c0 +Loading section .rodata, size 0x4c0 lma 0x8009790 +Loading section .ARM, size 0x8 lma 0x8009c50 +Loading section .init_array, size 0x8 lma 0x8009c58 +Loading section .fini_array, size 0x8 lma 0x8009c60 +Loading section .data, size 0x9a8 lma 0x8009c68 +Start address 0x08004228, load size 42464 +Transfer rate: 29 KB/sec, 4718 bytes/write. +Breakpoint 1 at 0x80014c4: 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. +0x080041f4 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:158 +158 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ######################################################################################################## + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080041e6 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 + 0x080041ea p_serial_mgr_service+22 add.w r2, r3, r2, lsl #2 + 0x080041ee p_serial_mgr_service+26 add r0, r2 + 0x080041f0 p_serial_mgr_service+28 ldrb.w r2, [r0, #260] ; 0x104 + 0x080041f4 p_serial_mgr_service+32 cmp r2, #0 + 0x080041f6 p_serial_mgr_service+34 beq.n 0x80041d8 + 0x080041f8 p_serial_mgr_service+36 b.n 0x80041fc + 0x080041fa p_serial_mgr_service+38 movs r0, #0 + 0x080041fc p_serial_mgr_service+40 bx lr +### Breakpoints ##################################################################################################### +[1] break at 0x080014c4 in Core/Src/main.c:148 for main.c:148 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x200012ff r5 0x200009c8 r10 0x00000000 pc 0x080041f4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000007 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() + 167 { +### Stack ########################################################################################################### +[0] from 0x080041f4 in p_serial_mgr_service+32 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041f4 in p_serial_mgr_service+32 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 7 +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x080041f4 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:158 +158 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ######################################################################################################## + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080041e6 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 + 0x080041ea p_serial_mgr_service+22 add.w r2, r3, r2, lsl #2 + 0x080041ee p_serial_mgr_service+26 add r0, r2 + 0x080041f0 p_serial_mgr_service+28 ldrb.w r2, [r0, #260] ; 0x104 + 0x080041f4 p_serial_mgr_service+32 cmp r2, #0 + 0x080041f6 p_serial_mgr_service+34 beq.n 0x80041d8 + 0x080041f8 p_serial_mgr_service+36 b.n 0x80041fc + 0x080041fa p_serial_mgr_service+38 movs r0, #0 + 0x080041fc p_serial_mgr_service+40 bx lr +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x200012ff r5 0x200009c8 r10 0x00000000 pc 0x080041f4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000007 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() + 167 { +### Stack ########################################################################################################### +[0] from 0x080041f4 in p_serial_mgr_service+32 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041f4 in p_serial_mgr_service+32 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 7 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x95d0 lma 0x80001c0 +Loading section .rodata, size 0x4c0 lma 0x8009790 +Loading section .ARM, size 0x8 lma 0x8009c50 +Loading section .init_array, size 0x8 lma 0x8009c58 +Loading section .fini_array, size 0x8 lma 0x8009c60 +Loading section .data, size 0x9a8 lma 0x8009c68 +Start address 0x08004228, load size 42464 +Transfer rate: 29 KB/sec, 4718 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] +0x080041de in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## + 0x080041d4 p_serial_mgr_service+0 movs r3, #0 + 0x080041d6 p_serial_mgr_service+2 b.n 0x80041da + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080041de p_serial_mgr_service+10 cmp r2, r3 + 0x080041e0 p_serial_mgr_service+12 ble.n 0x80041fa + 0x080041e2 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x8004200 ) + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080041e6 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20001404 r5 0x200009c8 r10 0x00000000 pc 0x080041de primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000009 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ########################################################################################################### +[0] from 0x080041de in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041de in p_serial_mgr_service+10 at shared/drivers/p_serial_mgr.c:156 +### Variables ####################################################################################################### +loc ind = 9 +##################################################################################################################### +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: 0x08004228 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x95d0 lma 0x80001c0 +Loading section .rodata, size 0x4c0 lma 0x8009790 +Loading section .ARM, size 0x8 lma 0x8009c50 +Loading section .init_array, size 0x8 lma 0x8009c58 +Loading section .fini_array, size 0x8 lma 0x8009c60 +Loading section .data, size 0x9a8 lma 0x8009c68 +Start address 0x08004228, load size 42464 +Transfer rate: 29 KB/sec, 4718 bytes/write. +No line 36 in file "putil.c". +Quit +No line 36 in file "putil.c". +Breakpoint 1 (putil.c:36) pending. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Program received signal SIGINT, Interrupt. +0x080041dc in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## +~ + 0x080041d4 p_serial_mgr_service+0 movs r3, #0 + 0x080041d6 p_serial_mgr_service+2 b.n 0x80041da + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080041de p_serial_mgr_service+10 cmp r2, r3 + 0x080041e0 p_serial_mgr_service+12 ble.n 0x80041fa + 0x080041e2 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x8004200 ) + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] +### Breakpoints ##################################################################################################### +[1] break for putil.c:36 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000eeb r5 0x200009c8 r10 0x00000000 pc 0x080041dc primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x20001610 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000004 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ########################################################################################################### +[0] from 0x080041dc in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041dc in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:156 +### Variables ####################################################################################################### +loc ind = 4 +##################################################################################################################### +A syntax error in expression, near `:161'. +Breakpoint 2 at 0x80014e4: file Core/Src/main.c, line 161. +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. +0x080041ee in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:158 +158 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ######################################################################################################## + 0x080041e0 p_serial_mgr_service+12 ble.n 0x80041fa + 0x080041e2 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x8004200 ) + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080041e6 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 + 0x080041ea p_serial_mgr_service+22 add.w r2, r3, r2, lsl #2 + 0x080041ee p_serial_mgr_service+26 add r0, r2 + 0x080041f0 p_serial_mgr_service+28 ldrb.w r2, [r0, #260] ; 0x104 + 0x080041f4 p_serial_mgr_service+32 cmp r2, #0 + 0x080041f6 p_serial_mgr_service+34 beq.n 0x80041d8 + 0x080041f8 p_serial_mgr_service+36 b.n 0x80041fc +### Breakpoints ##################################################################################################### +[1] break for putil.c:36 +[2] break at 0x080014e4 in Core/Src/main.c:161 for main.c:161 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000bdc r5 0x200009c8 r10 0x00000000 pc 0x080041ee primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x0000030f r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000003 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() + 167 { +### Stack ########################################################################################################### +[0] from 0x080041ee in p_serial_mgr_service+26 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041ee in p_serial_mgr_service+26 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 3 +##################################################################################################################### +Quit +Quit +Quit +Breakpoint 3 at 0x8004204: file shared/drivers/p_serial_mgr.c, line 167. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 3, p_serial_mgr_start () at shared/drivers/p_serial_mgr.c:167 +167 { +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x08004204 p_serial_mgr_start+0 push {r3, lr} + 0x08004206 p_serial_mgr_start+2 movs r2, #1 + 0x08004208 p_serial_mgr_start+4 ldr r1, [pc, #8] ; (0x8004214 ) + 0x0800420a p_serial_mgr_start+6 ldr r3, [pc, #12] ; (0x8004218 ) + 0x0800420c p_serial_mgr_start+8 ldr r0, [r3, #0] +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x08004204 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40001000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x080014bb psp 0x00000000 +### Source ########################################################################################################## + 157 { + 158 if (serial_pkt_cb.buffer[ind].b_ready) + 159 { + 160 return &serial_pkt_cb.buffer[ind]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() +!167 { + 168 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 169 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004204 in p_serial_mgr_start+0 at shared/drivers/p_serial_mgr.c:167 +[1] from 0x080014ba in main+122 at Core/Src/main.c:129 +### Threads ######################################################################################################### +[1] id 0 from 0x08004204 in p_serial_mgr_start+0 at shared/drivers/p_serial_mgr.c:167 +### Variables ####################################################################################################### +##################################################################################################################### +Continuing. +### Output/messages ################################################################################################# +halted: PC: 0x08004206 + +Program received signal SIGINT, Interrupt. +0x080041d8 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## +~ +~ +~ + 0x080041d4 p_serial_mgr_service+0 movs r3, #0 + 0x080041d6 p_serial_mgr_service+2 b.n 0x80041da + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080041de p_serial_mgr_service+10 cmp r2, r3 + 0x080041e0 p_serial_mgr_service+12 ble.n 0x80041fa +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000bdc r5 0x200009c8 r10 0x00000000 pc 0x080041d8 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ########################################################################################################### +[0] from 0x080041d8 in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041d8 in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:156 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +Quit +Breakpoint 4 at 0x80041d4: file shared/drivers/p_serial_mgr.c, line 156. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 3, p_serial_mgr_start () at shared/drivers/p_serial_mgr.c:167 +167 { +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x08004204 p_serial_mgr_start+0 push {r3, lr} + 0x08004206 p_serial_mgr_start+2 movs r2, #1 + 0x08004208 p_serial_mgr_start+4 ldr r1, [pc, #8] ; (0x8004214 ) + 0x0800420a p_serial_mgr_start+6 ldr r3, [pc, #12] ; (0x8004218 ) + 0x0800420c p_serial_mgr_start+8 ldr r0, [r3, #0] +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +[4] break at 0x080041d4 in shared/drivers/p_serial_mgr.c:156 for p_serial_mgr_service +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x08004204 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40001000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x080014bb psp 0x00000000 +### Source ########################################################################################################## + 157 { + 158 if (serial_pkt_cb.buffer[ind].b_ready) + 159 { + 160 return &serial_pkt_cb.buffer[ind]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() +!167 { + 168 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 169 } +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08004204 in p_serial_mgr_start+0 at shared/drivers/p_serial_mgr.c:167 +[1] from 0x080014ba in main+122 at Core/Src/main.c:129 +### Threads ######################################################################################################### +[1] id 0 from 0x08004204 in p_serial_mgr_start+0 at shared/drivers/p_serial_mgr.c:167 +### Variables ####################################################################################################### +##################################################################################################################### +Continuing. +### Output/messages ################################################################################################# +halted: PC: 0x08004206 + +Breakpoint 4, p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x080041d4 p_serial_mgr_service+0 movs r3, #0 + 0x080041d6 p_serial_mgr_service+2 b.n 0x80041da + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +[4] break at 0x080041d4 in shared/drivers/p_serial_mgr.c:156 for p_serial_mgr_service hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080041d4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40013800 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40001000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ########################################################################################################### +[0] from 0x080041d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080041d6 +halted: PC: 0x080041da +halted: PC: 0x080041dc +halted: PC: 0x080041de +halted: PC: 0x080041e0 +halted: PC: 0x080041e2 +158 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ######################################################################################################## + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080041de p_serial_mgr_service+10 cmp r2, r3 + 0x080041e0 p_serial_mgr_service+12 ble.n 0x80041fa + 0x080041e2 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x8004200 ) + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080041e6 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 + 0x080041ea p_serial_mgr_service+22 add.w r2, r3, r2, lsl #2 + 0x080041ee p_serial_mgr_service+26 add r0, r2 +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +[4] break at 0x080041d4 in shared/drivers/p_serial_mgr.c:156 for p_serial_mgr_service hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080041e2 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() +!167 { +### Stack ########################################################################################################### +[0] from 0x080041e2 in p_serial_mgr_service+14 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041e2 in p_serial_mgr_service+14 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +$1 = { + frame_data = '\000' , + src_addr = 0 '\000', + dest_addr = 0 '\000', + checksum = 0 '\000', + len = 0 '\000', + b_ready = false +} +$2 = { + frame_data = '\000' , + src_addr = 0 '\000', + dest_addr = 0 '\000', + checksum = 0 '\000', + len = 0 '\000', + b_ready = false +} +Continuing. +### Output/messages ################################################################################################# + +Breakpoint 4, p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x080041d4 p_serial_mgr_service+0 movs r3, #0 + 0x080041d6 p_serial_mgr_service+2 b.n 0x80041da + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +[4] break at 0x080041d4 in shared/drivers/p_serial_mgr.c:156 for p_serial_mgr_service hit 2 times +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +$$0 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080041d4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x0000000a r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ########################################################################################################### +[0] from 0x080041d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080041d6 +halted: PC: 0x080041da +halted: PC: 0x080041dc +halted: PC: 0x080041de +halted: PC: 0x080041e0 +halted: PC: 0x080041e2 +158 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ######################################################################################################## + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080041de p_serial_mgr_service+10 cmp r2, r3 + 0x080041e0 p_serial_mgr_service+12 ble.n 0x80041fa + 0x080041e2 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x8004200 ) + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080041e6 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 + 0x080041ea p_serial_mgr_service+22 add.w r2, r3, r2, lsl #2 + 0x080041ee p_serial_mgr_service+26 add r0, r2 +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +[4] break at 0x080041d4 in shared/drivers/p_serial_mgr.c:156 for p_serial_mgr_service hit 2 times +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +$$0 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080041e2 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() +!167 { +### Stack ########################################################################################################### +[0] from 0x080041e2 in p_serial_mgr_service+14 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041e2 in p_serial_mgr_service+14 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +$3 = 0 +Continuing. +### Output/messages ################################################################################################# + +Breakpoint 4, p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x080041d4 p_serial_mgr_service+0 movs r3, #0 + 0x080041d6 p_serial_mgr_service+2 b.n 0x80041da + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +[4] break at 0x080041d4 in shared/drivers/p_serial_mgr.c:156 for p_serial_mgr_service hit 3 times +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$2 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +$$1 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +$$0 = 0 +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080041d4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x0000000a r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ########################################################################################################### +[0] from 0x080041d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +$4 = 0 +### Output/messages ################################################################################################# +halted: PC: 0x080041d6 +halted: PC: 0x080041da +halted: PC: 0x080041dc +halted: PC: 0x080041de +halted: PC: 0x080041e0 +halted: PC: 0x080041e2 +158 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ######################################################################################################## + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080041de p_serial_mgr_service+10 cmp r2, r3 + 0x080041e0 p_serial_mgr_service+12 ble.n 0x80041fa + 0x080041e2 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x8004200 ) + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080041e6 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 + 0x080041ea p_serial_mgr_service+22 add.w r2, r3, r2, lsl #2 + 0x080041ee p_serial_mgr_service+26 add r0, r2 +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +[4] break at 0x080041d4 in shared/drivers/p_serial_mgr.c:156 for p_serial_mgr_service hit 3 times +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$2 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +$$1 = 0 +$$0 = 0 +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080041e2 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() +!167 { +### Stack ########################################################################################################### +[0] from 0x080041e2 in p_serial_mgr_service+14 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041e2 in p_serial_mgr_service+14 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +$5 = 0 +$6 = 10 +$7 = 0 +### Output/messages ################################################################################################# +halted: PC: 0x080041e4 +halted: PC: 0x080041e6 +halted: PC: 0x080041ea +halted: PC: 0x080041ee +halted: PC: 0x080041f0 +halted: PC: 0x080041f4 +halted: PC: 0x080041f6 +halted: PC: 0x080041d8 +halted: PC: 0x080041da +halted: PC: 0x080041dc +halted: PC: 0x080041de +halted: PC: 0x080041e0 +halted: PC: 0x080041e2 +158 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ######################################################################################################## + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x080041de p_serial_mgr_service+10 cmp r2, r3 + 0x080041e0 p_serial_mgr_service+12 ble.n 0x80041fa + 0x080041e2 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x8004200 ) + 0x080041e4 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x080041e6 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 + 0x080041ea p_serial_mgr_service+22 add.w r2, r3, r2, lsl #2 + 0x080041ee p_serial_mgr_service+26 add r0, r2 +### Breakpoints ##################################################################################################### +[3] break at 0x08004204 in shared/drivers/p_serial_mgr.c:167 for p_serial_mgr.c:161 hit 1 time +[4] break at 0x080041d4 in shared/drivers/p_serial_mgr.c:156 for p_serial_mgr_service hit 3 times +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$2 = 0 +$$1 = 10 +$$0 = 0 +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000bdc r5 0x200009c8 r10 0x00000000 pc 0x080041e2 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000001 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 + 166 void p_serial_mgr_start() +!167 { +### Stack ########################################################################################################### +[0] from 0x080041e2 in p_serial_mgr_service+14 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041e2 in p_serial_mgr_service+14 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 1 +##################################################################################################################### +$8 = { + frame_data = '\000' , + src_addr = 0 '\000', + dest_addr = 0 '\000', + checksum = 0 '\000', + len = 0 '\000', + b_ready = false +} +$9 = (serial_pkt_t *) 0x20000bdc +$10 = { + frame_data = '\000' , + src_addr = 0 '\000', + dest_addr = 0 '\000', + checksum = 0 '\000', + len = 0 '\000', + b_ready = false +} +$11 = { + frame_data = '\000' , + src_addr = 0 '\000', + dest_addr = 0 '\000', + checksum = 0 '\000', + len = 0 '\000', + b_ready = false +} +$12 = { + frame_data = '\000' , + src_addr = 0 '\000', + dest_addr = 0 '\000', + checksum = 0 '\000', + len = 0 '\000', + b_ready = false +} +$13 = { + frame_data = '\000' , + src_addr = 0 '\000', + dest_addr = 0 '\000', + checksum = 0 '\000', + len = 0 '\000', + b_ready = false +} +$14 = { + frame_data = '\000' , + src_addr = 0 '\000', + dest_addr = 0 '\000', + checksum = 0 '\000', + len = 0 '\000', + b_ready = false +} +Quit +Breakpoint 5 at 0x80041d4: file shared/drivers/p_serial_mgr.c, line 156. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 +halted: PC: 0x080041d6 + +Program received signal SIGINT, Interrupt. +p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:156 +156 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x080041d4 p_serial_mgr_service+0 movs r3, #0 + 0x080041d6 p_serial_mgr_service+2 b.n 0x80041da + 0x080041d8 p_serial_mgr_service+4 adds r3, #1 + 0x080041da p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_serial_mgr_service+8 ldrh r2, [r2, #6] +### Breakpoints ##################################################################################################### +[5] break at 0x080041d4 in shared/drivers/p_serial_mgr.c:156 for p_serial_mgr_service if serial_pkt_cb.buffer[0].frame_data[0] != 0 +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$2 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +$$1 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +$$0 = {frame_data = '\000' ,src_addr = 0 '\000',dest_addr = 0 '\000',checksum = 0 '\000… +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080041d4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x0000000a r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 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]; + 161 } + 162 } + 163 return NULL; + 164 } + 165 +### Stack ########################################################################################################### +[0] from 0x080041d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080041d4 in p_serial_mgr_service+0 at shared/drivers/p_serial_mgr.c:156 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x080041d4 in p_uart_init (huart=0x0) at shared/util/putil.c:29 +29 huart_inst = huart; +### Assembly ######################################################################################################## +~ +~ +~ + 0x080041d0 p_uart_init+0 asrs r0, r2, #24 + 0x080041d2 p_uart_init+2 movs r0, #0 + 0x080041d4 p_uart_init+4 movs r3, #0 + 0x080041d6 p_uart_init+6 b.n 0x80041da + 0x080041d8 p_uart_init+8 adds r3, #1 + 0x080041da p_uart_init+10 ldr r2, [pc, #36] ; (0x8004200 ) + 0x080041dc p_uart_init+12 ldrh r2, [r2, #6] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080041d4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x0000000a r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 19 memset(printf_buffer, '\0', MAX_PRINTF_BUFFER); + 20 va_list args; + 21 va_start(args, fmt); + 22 vsprintf((char *)printf_buffer, fmt, args); + 23 va_end(args); + 24 HAL_UART_Transmit(huart_inst, printf_buffer, strlen(printf_buffer), 100); + 25 return 0; + 26 } + 27 void p_uart_init(UART_HandleTypeDef *huart) + 28 { + 29 huart_inst = huart; + 30 PDEBUG("...\n"); + 31 PDEBUG("UART2 Initialized\n"); + 32 } + 33 void p_uart_async_write_byte(uint8_t byte) + 34 { + 35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit_IT(huart_inst, send, 2); + 37 } +~ +### Stack ########################################################################################################### +[0] from 0x080041d4 in p_uart_init+4 at shared/util/putil.c:29 +[1] from 0x20001664 in __malloc_max_total_mem +### Threads ######################################################################################################### +[1] id 0 from 0x080041d4 in p_uart_init+4 at shared/util/putil.c:29 +### Variables ####################################################################################################### +arg huart = 0x0: {Instance = 0x20010000,Init = {BaudRate = 134234665,WordLength = 134223157,StopBits = … +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9788 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009948 +Loading section .ARM, size 0x8 lma 0x8009e10 +Loading section .init_array, size 0x8 lma 0x8009e18 +Loading section .fini_array, size 0x8 lma 0x8009e20 +Loading section .data, size 0x9a8 lma 0x8009e28 +Start address 0x080043a0, load size 42912 +Transfer rate: 29 KB/sec, 4768 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] +0x0800436c in memset () +### Assembly ######################################################################################################## + 0x0800436c ? cmp r2, #0 + 0x0800436e ? beq.n 0x8004350 + 0x08004370 ? b.n 0x8004374 + 0x08004372 ? movs r0, #0 + 0x08004374 ? bx lr + 0x08004376 ? nop + 0x08004378 ? asrs r4, r3, #24 + 0x0800437a ? movs r0, #0 + 0x0800437c ? push {r3, lr} + 0x0800437e ? movs r2, #1 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20001206 r5 0x200009c8 r10 0x00000000 pc 0x0800436c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000006 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x0800436c in memset +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x0800436c in memset +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9670 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009830 +Loading section .ARM, size 0x8 lma 0x8009cf8 +Loading section .init_array, size 0x8 lma 0x8009d00 +Loading section .fini_array, size 0x8 lma 0x8009d08 +Loading section .data, size 0x9a8 lma 0x8009d10 +Start address 0x08004284, load size 42632 +Transfer rate: 29 KB/sec, 4736 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] +0x08004238 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:158 +158 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## +~ + 0x08004230 p_serial_mgr_service+0 movs r3, #0 + 0x08004232 p_serial_mgr_service+2 b.n 0x8004236 + 0x08004234 p_serial_mgr_service+4 adds r3, #1 + 0x08004236 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x800425c ) + 0x08004238 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x0800423a p_serial_mgr_service+10 cmp r2, r3 + 0x0800423c p_serial_mgr_service+12 ble.n 0x8004256 + 0x0800423e p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x800425c ) + 0x08004240 p_serial_mgr_service+16 ldr r0, [r2, #0] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x08004238 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x2000161c r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 148 _serial_huart_inst = huart; + 149 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 150 + 151 memset(pkt_bank, 0, sizeof(serial_pkt_t) * 10); + 152 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 153 } + 154 + 155 serial_pkt_t *p_serial_mgr_service(void) + 156 { + 157 // this will be less garbage when i switch to a queue + 158 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 159 { + 160 if (serial_pkt_cb.buffer[ind].b_ready) + 161 { + 162 return &serial_pkt_cb.buffer[ind]; + 163 } + 164 } + 165 return NULL; + 166 } + 167 +### Stack ########################################################################################################### +[0] from 0x08004238 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004238 in p_serial_mgr_service+8 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 0 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9670 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009830 +Loading section .ARM, size 0x8 lma 0x8009cf8 +Loading section .init_array, size 0x8 lma 0x8009d00 +Loading section .fini_array, size 0x8 lma 0x8009d08 +Loading section .data, size 0x9a8 lma 0x8009d10 +Start address 0x08004284, load size 42632 +Transfer rate: 29 KB/sec, 4736 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] +0x08004236 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:158 +warning: Source file is more recent than executable. +158 { +### Assembly ######################################################################################################## +~ +~ + 0x08004230 p_serial_mgr_service+0 movs r3, #0 + 0x08004232 p_serial_mgr_service+2 b.n 0x8004236 + 0x08004234 p_serial_mgr_service+4 adds r3, #1 + 0x08004236 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x800425c ) + 0x08004238 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x0800423a p_serial_mgr_service+10 cmp r2, r3 + 0x0800423c p_serial_mgr_service+12 ble.n 0x8004256 + 0x0800423e p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x800425c ) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x2000130b r5 0x200009c8 r10 0x00000000 pc 0x08004236 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000008 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 148 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 149 { + 150 _serial_huart_inst = huart; + 151 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 152 + 153 memset(pkt_bank, 0, sizeof(serial_pkt_t) * 10); + 154 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 155 } + 156 + 157 serial_pkt_t *p_serial_mgr_service(void) + 158 { + 159 // this will be less garbage when i switch to a queue + 160 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 161 { + 162 if (serial_pkt_cb.buffer[ind].b_ready) + 163 { + 164 return &serial_pkt_cb.buffer[ind]; + 165 } + 166 } + 167 return NULL; +### Stack ########################################################################################################### +[0] from 0x08004236 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:158 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004236 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:158 +### Variables ####################################################################################################### +loc ind = 8 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9670 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009830 +Loading section .ARM, size 0x8 lma 0x8009cf8 +Loading section .init_array, size 0x8 lma 0x8009d00 +Loading section .fini_array, size 0x8 lma 0x8009d08 +Loading section .data, size 0x9a8 lma 0x8009d10 +Start address 0x08004284, load size 42632 +Transfer rate: 29 KB/sec, 4736 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] +warning: No executable has been specified and target does not support +determining executable automatically. Try using the "file" command. +0x08004236 in ?? () +### Assembly ######################################################################################################## + 0x08004236 ? ldr r2, [pc, #36] ; (0x800425c) + 0x08004238 ? ldrh r2, [r2, #6] + 0x0800423a ? cmp r2, r3 + 0x0800423c ? ble.n 0x8004256 + 0x0800423e ? ldr r2, [pc, #28] ; (0x800425c) + 0x08004240 ? ldr r0, [r2, #0] + 0x08004242 ? add.w r2, r3, r3, lsl #6 + 0x08004246 ? add.w r2, r3, r2, lsl #2 + 0x0800424a ? add r0, r2 + 0x0800424c ? ldrb.w r2, [r0, #260] ; 0x104 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000ffc r5 0x200009c8 r10 0x00000000 pc 0x08004236 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000005 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08004236 +[1] from 0x080014be +### Threads ######################################################################################################### +[1] id 0 from 0x08004236 +### Variables ####################################################################################################### +##################################################################################################################### +generic_push.gdb:7: Error in sourced command file: +No executable file specified. +Use the "file" or "exec-file" command. +Detaching from program: , Remote target +[Inferior 1 (Remote target) detached] +warning: No executable has been specified and target does not support +determining executable automatically. Try using the "file" command. +0x08004236 in ?? () +### Assembly ######################################################################################################## + 0x08004236 ? ldr r2, [pc, #36] ; (0x800425c) + 0x08004238 ? ldrh r2, [r2, #6] + 0x0800423a ? cmp r2, r3 + 0x0800423c ? ble.n 0x8004256 + 0x0800423e ? ldr r2, [pc, #28] ; (0x800425c) + 0x08004240 ? ldr r0, [r2, #0] + 0x08004242 ? add.w r2, r3, r3, lsl #6 + 0x08004246 ? add.w r2, r3, r2, lsl #2 + 0x0800424a ? add r0, r2 + 0x0800424c ? ldrb.w r2, [r0, #260] ; 0x104 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000ffc r5 0x200009c8 r10 0x00000000 pc 0x08004236 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000005 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08004236 +[1] from 0x080014be +### Threads ######################################################################################################### +[1] id 0 from 0x08004236 +### Variables ####################################################################################################### +##################################################################################################################### +generic_push.gdb:7: Error in sourced command file: +No executable file specified. +Use the "file" or "exec-file" command. +Detaching from program: , Remote target +[Inferior 1 (Remote target) detached] +0x08004236 in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:160 +160 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) +### Assembly ######################################################################################################## +~ +~ + 0x08004230 p_serial_mgr_service+0 movs r3, #0 + 0x08004232 p_serial_mgr_service+2 b.n 0x8004236 + 0x08004234 p_serial_mgr_service+4 adds r3, #1 + 0x08004236 p_serial_mgr_service+6 ldr r2, [pc, #36] ; (0x800425c ) + 0x08004238 p_serial_mgr_service+8 ldrh r2, [r2, #6] + 0x0800423a p_serial_mgr_service+10 cmp r2, r3 + 0x0800423c p_serial_mgr_service+12 ble.n 0x8004256 + 0x0800423e p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x800425c ) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000ffc r5 0x200009c8 r10 0x00000000 pc 0x08004236 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000005 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 150 _serial_huart_inst = huart; + 151 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 152 + 153 memset(pkt_bank, 0, sizeof(serial_pkt_t) * 10); + 154 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 155 } + 156 + 157 serial_pkt_t *p_serial_mgr_service(void) + 158 { + 159 // this will be less garbage when i switch to a queue + 160 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 161 { + 162 if (serial_pkt_cb.buffer[ind].b_ready) + 163 { + 164 return &serial_pkt_cb.buffer[ind]; + 165 } + 166 } + 167 return NULL; + 168 } + 169 +### Stack ########################################################################################################### +[0] from 0x08004236 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:160 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004236 in p_serial_mgr_service+6 at shared/drivers/p_serial_mgr.c:160 +### Variables ####################################################################################################### +loc ind = 5 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9670 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009830 +Loading section .ARM, size 0x8 lma 0x8009cf8 +Loading section .init_array, size 0x8 lma 0x8009d00 +Loading section .fini_array, size 0x8 lma 0x8009d08 +Loading section .data, size 0x9a8 lma 0x8009d10 +Start address 0x08004284, load size 42632 +Transfer rate: 29 KB/sec, 4736 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] +0x0800424a in p_serial_mgr_start () at shared/drivers/p_serial_mgr.c:173 +173 } +### Assembly ######################################################################################################## + 0x0800423c p_serial_mgr_start+8 ble.n 0x8004256 + 0x0800423e p_serial_mgr_start+10 ldr r2, [pc, #28] ; (0x800425c ) + 0x08004240 p_serial_mgr_start+12 ldr r0, [r2, #0] + 0x08004242 p_serial_mgr_start+14 add.w r2, r3, r3, lsl #6 + 0x08004246 p_serial_mgr_start+18 add.w r2, r3, r2, lsl #2 + 0x0800424a p_serial_mgr_start+22 add r0, r2 + 0x0800424c p_serial_mgr_start+24 ldrb.w r2, [r0, #260] ; 0x104 +~ +~ +~ +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000be8 r5 0x200009c8 r10 0x00000000 pc 0x0800424a primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000519 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000005 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 163 { + 164 return &serial_pkt_cb.buffer[ind]; + 165 } + 166 } + 167 return NULL; + 168 } + 169 + 170 void p_serial_mgr_start() + 171 { + 172 HAL_UART_Receive_IT(_serial_huart_inst, rxc, 256); + 173 } +~ +~ +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x0800424a in p_serial_mgr_start+22 at shared/drivers/p_serial_mgr.c:173 +[1] from 0x20001684 in heap_end +### Threads ######################################################################################################### +[1] id 0 from 0x0800424a in p_serial_mgr_start+22 at shared/drivers/p_serial_mgr.c:173 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9668 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009828 +Loading section .ARM, size 0x8 lma 0x8009cf0 +Loading section .init_array, size 0x8 lma 0x8009cf8 +Loading section .fini_array, size 0x8 lma 0x8009d00 +Loading section .data, size 0x9a8 lma 0x8009d08 +Start address 0x0800427c, load size 42624 +Transfer rate: 29 KB/sec, 4736 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] +HardFault_Handler () at Core/Src/stm32l4xx_it.c:91 +91 while (1) +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ + 0x08001536 HardFault_Handler+0 b.n 0x8001536 +~ +~ +~ +~ +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x0f02017e r5 0x200009c8 r10 0x00000000 pc 0x08001536 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21070003 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000004 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000ff88 msp 0x2000ff88 control 0x00 + r4 0x20000697 r9 0x00000000 lr 0xffffffe9 psp 0x00000000 +### Source ########################################################################################################## + 81 } + 82 + 83 /** + 84 * @brief This function handles Hard fault interrupt. + 85 */ + 86 void HardFault_Handler(void) + 87 { + 88 /* USER CODE BEGIN HardFault_IRQn 0 */ + 89 + 90 /* USER CODE END HardFault_IRQn 0 */ + 91 while (1) + 92 { + 93 /* USER CODE BEGIN W1_HardFault_IRQn 0 */ + 94 /* USER CODE END W1_HardFault_IRQn 0 */ + 95 } + 96 } + 97 + 98 /** + 99 * @brief This function handles Memory management fault. + 100 */ +### Stack ########################################################################################################### +[0] from 0x08001536 in HardFault_Handler+0 at Core/Src/stm32l4xx_it.c:91 +[1] from 0xffffffe9 +[2] from 0x08004220 in p_serial_mgr_service+28 at shared/drivers/p_serial_mgr.c:162 +[3] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08001536 in HardFault_Handler+0 at Core/Src/stm32l4xx_it.c:91 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9668 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009828 +Loading section .ARM, size 0x8 lma 0x8009cf0 +Loading section .init_array, size 0x8 lma 0x8009cf8 +Loading section .fini_array, size 0x8 lma 0x8009d00 +Loading section .data, size 0x9a8 lma 0x8009d08 +Start address 0x0800427c, load size 42624 +Transfer rate: 29 KB/sec, 4736 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] +0x0800421e in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:163 +163 if (serial_pkt_cb.buffer[ind].b_ready) +### Assembly ######################################################################################################## + 0x08004210 p_serial_mgr_service+12 ble.n 0x800422a + 0x08004212 p_serial_mgr_service+14 ldr r2, [pc, #28] ; (0x8004230 ) + 0x08004214 p_serial_mgr_service+16 ldr r0, [r2, #0] + 0x08004216 p_serial_mgr_service+18 add.w r2, r3, r3, lsl #6 + 0x0800421a p_serial_mgr_service+22 add.w r2, r3, r2, lsl #2 + 0x0800421e p_serial_mgr_service+26 add r0, r2 + 0x08004220 p_serial_mgr_service+28 ldrb.w r2, [r0, #260] ; 0x104 + 0x08004224 p_serial_mgr_service+32 cmp r2, #0 + 0x08004226 p_serial_mgr_service+34 beq.n 0x8004208 + 0x08004228 p_serial_mgr_service+36 b.n 0x800422c +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000be8 r5 0x200009c8 r10 0x00000000 pc 0x0800421e primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x0000061e r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000006 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 153 + 154 memset(pkt_bank, 0, sizeof(serial_pkt_t) * 10); + 155 p_cb_serial_pkt_init(&serial_pkt_cb, pkt_bank, 10); + 156 } + 157 + 158 serial_pkt_t *p_serial_mgr_service(void) + 159 { + 160 // this will be less garbage when i switch to a queue + 161 for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 162 { + 163 if (serial_pkt_cb.buffer[ind].b_ready) + 164 { + 165 return &serial_pkt_cb.buffer[ind]; + 166 } + 167 } + 168 return NULL; + 169 } + 170 + 171 void p_serial_mgr_start() + 172 { +### Stack ########################################################################################################### +[0] from 0x0800421e in p_serial_mgr_service+26 at shared/drivers/p_serial_mgr.c:163 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x0800421e in p_serial_mgr_service+26 at shared/drivers/p_serial_mgr.c:163 +### Variables ####################################################################################################### +loc ind = 6 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9670 lma 0x80001c0 +Loading section .rodata, size 0x4c0 lma 0x8009830 +Loading section .ARM, size 0x8 lma 0x8009cf0 +Loading section .init_array, size 0x8 lma 0x8009cf8 +Loading section .fini_array, size 0x8 lma 0x8009d00 +Loading section .data, size 0x9a8 lma 0x8009d08 +Start address 0x08004284, load size 42624 +Transfer rate: 29 KB/sec, 4736 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_init (huart=0x2000130b) at shared/drivers/p_serial_mgr.c:48 +48 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; +### Assembly ######################################################################################################## +~ +~ +~ + 0x0800421c p_serial_mgr_init+0 lsls r2, r0, #10 + 0x0800421e p_serial_mgr_init+2 add r0, r2 + 0x08004220 p_serial_mgr_init+4 ldrb.w r2, [r0, #260] ; 0x104 + 0x08004224 p_serial_mgr_init+8 cmp r2, #0 + 0x08004226 p_serial_mgr_init+10 beq.n 0x8004208 + 0x08004228 p_serial_mgr_init+12 b.n 0x800422c + 0x0800422a p_serial_mgr_init+14 movs r0, #0 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x2000130b r5 0x200009c8 r10 0x00000000 pc 0x08004220 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000723 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000007 r8 0x00000000 sp 0x2000fff0 msp 0x2000fff0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x080014bf psp 0x00000000 +### Source ########################################################################################################## + 38 for (int ind = 0; ind < 256; ind++) + 39 { + 40 p_uart_async_write_byte(rxb[ind]); + 41 } + 42 } + 43 p_serial_mgr_start(); + 44 } + 45 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 46 { + 47 _serial_huart_inst = huart; + 48 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 49 } + 50 + 51 serial_pkt_t *p_serial_mgr_service(void) + 52 { + 53 // // this will be less garbage when i switch to a queue + 54 // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 55 // { + 56 // if (serial_pkt_cb.buffer[ind].b_ready) + 57 // { +### Stack ########################################################################################################### +[0] from 0x08004220 in p_serial_mgr_init+4 at shared/drivers/p_serial_mgr.c:48 +[1] from 0x080014be in main+126 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08004220 in p_serial_mgr_init+4 at shared/drivers/p_serial_mgr.c:48 +### Variables ####################################################################################################### +arg huart = 0x2000130b: {Instance = 0x0,Init = {BaudRate = 0,WordLength = 0,StopBits = 0,Parity = 0,Mod… +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9680 lma 0x80001c0 +Loading section .rodata, size 0x4c0 lma 0x8009840 +Loading section .ARM, size 0x8 lma 0x8009d00 +Loading section .init_array, size 0x8 lma 0x8009d08 +Loading section .fini_array, size 0x8 lma 0x8009d10 +Loading section .data, size 0x9a8 lma 0x8009d18 +Start address 0x08004298, load size 42640 +Transfer rate: 29 KB/sec, 4737 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] +0x08003bf8 in UART_WaitOnFlagUntilTimeout (huart=huart@entry=0x20000a60 , Flag=Flag@entry=32, Status=Status@entry=RESET, Tickstart=Tickstart@entry=2725, Timeout=Timeout@entry=50) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +3536 if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) +### Assembly ######################################################################################################## + 0x08003be8 UART_WaitOnFlagUntilTimeout+34 cmp.w r8, #4294967295 ; 0xffffffff + 0x08003bec UART_WaitOnFlagUntilTimeout+38 beq.n 0x8003bd6 + 0x08003bee UART_WaitOnFlagUntilTimeout+40 bl 0x8002180 + 0x08003bf2 UART_WaitOnFlagUntilTimeout+44 sub.w r0, r0, r9 + 0x08003bf6 UART_WaitOnFlagUntilTimeout+48 cmp r0, r8 + 0x08003bf8 UART_WaitOnFlagUntilTimeout+50 bhi.n 0x8003c56 + 0x08003bfa UART_WaitOnFlagUntilTimeout+52 cmp.w r8, #0 + 0x08003bfe UART_WaitOnFlagUntilTimeout+56 beq.n 0x8003c56 + 0x08003c00 UART_WaitOnFlagUntilTimeout+58 ldr r3, [r5, #0] + 0x08003c02 UART_WaitOnFlagUntilTimeout+60 ldr r2, [r3, #0] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x20000a60 r10 0x00000000 pc 0x08003bf8 primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x006010d0 r7 0x00000020 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000bd0 r8 0x00000032 sp 0x2000ff18 msp 0x2000ff18 control 0x00 + r4 0x00000000 r9 0x00000aa5 lr 0x08003bf3 psp 0x00000000 +### Source ########################################################################################################## + 3526 */ + 3527 HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, + 3528 uint32_t Tickstart, uint32_t Timeout) + 3529 { + 3530 /* Wait until flag is set */ + 3531 while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) + 3532 { + 3533 /* Check for the Timeout */ + 3534 if (Timeout != HAL_MAX_DELAY) + 3535 { + 3536 if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) + 3537 { + 3538 /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) + 3539 interrupts for the interrupt process */ + 3540 #if defined(USART_CR1_FIFOEN) + 3541 ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE_RXFNEIE | USART_CR1_PEIE | + 3542 USART_CR1_TXEIE_TXFNFIE)); + 3543 #else + 3544 ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_TXEIE)); + 3545 #endif /* USART_CR1_FIFOEN */ +### Stack ########################################################################################################### +[0] from 0x08003bf8 in UART_WaitOnFlagUntilTimeout+50 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +[1] from 0x08003e5c in HAL_UART_Receive+238 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1286 +[2] from 0x0800426c in UART1_RxCpltCallback+32 at shared/drivers/p_serial_mgr.c:37 +[3] from 0x0800345e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[4] from 0x080035b0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[5] from 0x08001554 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[6] from 0xffffffe9 +[7] from 0x080014ba in main+122 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08003bf8 in UART_WaitOnFlagUntilTimeout+50 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +### Variables ####################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi…, Flag = 32, Status = RESET, Tickstart = 2725, Timeout = 50 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9690 lma 0x80001c0 +Loading section .rodata, size 0x4c0 lma 0x8009850 +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 0x080042a4, 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] +0x08003c08 in UART_WaitOnFlagUntilTimeout (huart=huart@entry=0x20000a60 , Flag=Flag@entry=32, Status=Status@entry=RESET, Tickstart=Tickstart@entry=980, Timeout=Timeout@entry=50) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3556 +3556 if (READ_BIT(huart->Instance->CR1, USART_CR1_RE) != 0U) +### Assembly ######################################################################################################## + 0x08003bfa UART_WaitOnFlagUntilTimeout+52 cmp.w r8, #0 + 0x08003bfe UART_WaitOnFlagUntilTimeout+56 beq.n 0x8003c56 + 0x08003c00 UART_WaitOnFlagUntilTimeout+58 ldr r3, [r5, #0] + 0x08003c02 UART_WaitOnFlagUntilTimeout+60 ldr r2, [r3, #0] + 0x08003c04 UART_WaitOnFlagUntilTimeout+62 tst.w r2, #4 + 0x08003c08 UART_WaitOnFlagUntilTimeout+66 beq.n 0x8003bd6 + 0x08003c0a UART_WaitOnFlagUntilTimeout+68 ldr r2, [r3, #28] + 0x08003c0c UART_WaitOnFlagUntilTimeout+70 tst.w r2, #2048 ; 0x800 + 0x08003c10 UART_WaitOnFlagUntilTimeout+74 beq.n 0x8003bd6 + 0x08003c12 UART_WaitOnFlagUntilTimeout+76 mov.w r2, #2048 ; 0x800 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x20000a60 r10 0x00000000 pc 0x08003c08 primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x21000035 basepri 0x00 + r2 0x0000000d r7 0x00000020 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40013800 r8 0x00000032 sp 0x2000ff18 msp 0x2000ff18 control 0x00 + r4 0x00000000 r9 0x000003d4 lr 0x08003bf3 psp 0x00000000 +### Source ########################################################################################################## + 3546 ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + 3547 + 3548 huart->gState = HAL_UART_STATE_READY; + 3549 huart->RxState = HAL_UART_STATE_READY; + 3550 + 3551 __HAL_UNLOCK(huart); + 3552 + 3553 return HAL_TIMEOUT; + 3554 } + 3555 + 3556 if (READ_BIT(huart->Instance->CR1, USART_CR1_RE) != 0U) + 3557 { + 3558 if (__HAL_UART_GET_FLAG(huart, UART_FLAG_RTOF) == SET) + 3559 { + 3560 /* Clear Receiver Timeout flag*/ + 3561 __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_RTOF); + 3562 + 3563 /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) + 3564 interrupts for the interrupt process */ + 3565 #if defined(USART_CR1_FIFOEN) +### Stack ########################################################################################################### +[0] from 0x08003c08 in UART_WaitOnFlagUntilTimeout+66 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3556 +[1] from 0x08003e5c in HAL_UART_Receive+238 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1286 +[2] from 0x0800426c in UART1_RxCpltCallback+32 at shared/drivers/p_serial_mgr.c:37 +[3] from 0x0800345e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[4] from 0x080035b0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[5] from 0x08001554 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[6] from 0xffffffe9 +[7] from 0x080014ba in main+122 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08003c08 in UART_WaitOnFlagUntilTimeout+66 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3556 +### Variables ####################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi…, Flag = 32, Status = RESET, Tickstart = 980, Timeout = 50 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9698 lma 0x80001c0 +Loading section .rodata, size 0x4c0 lma 0x8009858 +Loading section .ARM, size 0x8 lma 0x8009d18 +Loading section .init_array, size 0x8 lma 0x8009d20 +Loading section .fini_array, size 0x8 lma 0x8009d28 +Loading section .data, size 0x9a8 lma 0x8009d30 +Start address 0x080042b0, load size 42664 +Transfer rate: 29 KB/sec, 4740 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] +0x08002184 in HAL_GetTick () at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c:341 +341 } +### Assembly ######################################################################################################## +~ +~ +~ + 0x08002180 HAL_GetTick+0 ldr r3, [pc, #4] ; (0x8002188 ) + 0x08002182 HAL_GetTick+2 ldr r0, [r3, #0] + 0x08002184 HAL_GetTick+4 bx lr + 0x08002186 HAL_GetTick+6 nop + 0x08002188 HAL_GetTick+8 lsrs r0, r2, #15 + 0x0800218a HAL_GetTick+10 movs r0, #0 +~ +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x000043b7 r5 0x20000a60 r10 0x00000000 pc 0x08002184 primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x01000035 basepri 0x00 + r2 0x006010d0 r7 0x00000020 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000bd0 r8 0x00000032 sp 0x2000ff18 msp 0x2000ff18 control 0x00 + r4 0x00000000 r9 0x000043b7 lr 0x08003bf3 psp 0x00000000 +### Source ########################################################################################################## + 331 + 332 /** + 333 * @brief Provide a tick value in millisecond. + 334 * @note This function is declared as __weak to be overwritten in case of other + 335 * implementations in user file. + 336 * @retval tick value + 337 */ + 338 __weak uint32_t HAL_GetTick(void) + 339 { + 340 return uwTick; + 341 } + 342 + 343 /** + 344 * @brief This function returns a tick priority. + 345 * @retval tick priority + 346 */ + 347 uint32_t HAL_GetTickPrio(void) + 348 { + 349 return uwTickPrio; + 350 } +### Stack ########################################################################################################### +[0] from 0x08002184 in HAL_GetTick+4 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c:341 +[1] from 0x08003bf2 in UART_WaitOnFlagUntilTimeout+44 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +[2] from 0x08003e5c in HAL_UART_Receive+238 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1286 +[3] from 0x0800426c in UART1_RxCpltCallback+32 at shared/drivers/p_serial_mgr.c:37 +[4] from 0x0800345e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[5] from 0x080035b0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[6] from 0x08001554 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[7] from 0xffffffe9 +[8] from 0x080014c0 in main+128 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08002184 in HAL_GetTick+4 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c:341 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9698 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009858 +Loading section .ARM, size 0x8 lma 0x8009d20 +Loading section .init_array, size 0x8 lma 0x8009d28 +Loading section .fini_array, size 0x8 lma 0x8009d30 +Loading section .data, size 0x9a8 lma 0x8009d38 +Start address 0x080042b0, load size 42672 +Transfer rate: 29 KB/sec, 4741 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] +0x08003bfe in UART_WaitOnFlagUntilTimeout (huart=huart@entry=0x20000b14 , Flag=Flag@entry=64, Status=Status@entry=RESET, Tickstart=Tickstart@entry=11090, Timeout=Timeout@entry=100) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +3536 if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) +### Assembly ######################################################################################################## + 0x08003bee UART_WaitOnFlagUntilTimeout+40 bl 0x8002180 + 0x08003bf2 UART_WaitOnFlagUntilTimeout+44 sub.w r0, r0, r9 + 0x08003bf6 UART_WaitOnFlagUntilTimeout+48 cmp r0, r8 + 0x08003bf8 UART_WaitOnFlagUntilTimeout+50 bhi.n 0x8003c56 + 0x08003bfa UART_WaitOnFlagUntilTimeout+52 cmp.w r8, #0 + 0x08003bfe UART_WaitOnFlagUntilTimeout+56 beq.n 0x8003c56 + 0x08003c00 UART_WaitOnFlagUntilTimeout+58 ldr r3, [r5, #0] + 0x08003c02 UART_WaitOnFlagUntilTimeout+60 ldr r2, [r3, #0] + 0x08003c04 UART_WaitOnFlagUntilTimeout+62 tst.w r2, #4 + 0x08003c08 UART_WaitOnFlagUntilTimeout+66 beq.n 0x8003bd6 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x20000b14 r10 0x00000000 pc 0x08003bfe primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0035 basepri 0x00 + r2 0x00600010 r7 0x00000040 r12 0x0800988d fpscr 0x00000000 faultmask 0x00 + r3 0x20000bd0 r8 0x00000064 sp 0x2000ff10 msp 0x2000ff10 control 0x04 + r4 0x00000000 r9 0x00002b52 lr 0x08003bf3 psp 0x00000000 +### Source ########################################################################################################## + 3526 */ + 3527 HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, + 3528 uint32_t Tickstart, uint32_t Timeout) + 3529 { + 3530 /* Wait until flag is set */ + 3531 while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) + 3532 { + 3533 /* Check for the Timeout */ + 3534 if (Timeout != HAL_MAX_DELAY) + 3535 { + 3536 if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) + 3537 { + 3538 /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) + 3539 interrupts for the interrupt process */ + 3540 #if defined(USART_CR1_FIFOEN) + 3541 ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE_RXFNEIE | USART_CR1_PEIE | + 3542 USART_CR1_TXEIE_TXFNFIE)); + 3543 #else + 3544 ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_TXEIE)); + 3545 #endif /* USART_CR1_FIFOEN */ +### Stack ########################################################################################################### +[0] from 0x08003bfe in UART_WaitOnFlagUntilTimeout+56 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +[1] from 0x08003d4a in HAL_UART_Transmit+180 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1207 +[2] from 0x0800420a in p_uart_async_write_byte+34 at shared/util/putil.c:36 +[3] from 0x08004278 in UART1_RxCpltCallback+44 at shared/drivers/p_serial_mgr.c:40 +[4] from 0x0800345e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[5] from 0x080035b0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[6] from 0x08001554 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[7] from 0xffffffe9 +[8] from 0x080014ba in main+122 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x08003bfe in UART_WaitOnFlagUntilTimeout+56 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +### Variables ####################################################################################################### +arg huart = 0x20000b14 : {Instance = 0x40004400,Init = {BaudRate = 115200,WordLength = 0,StopBi…, Flag = 64, Status = RESET, Tickstart = 11090, Timeout = 100 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9698 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009858 +Loading section .ARM, size 0x8 lma 0x8009d20 +Loading section .init_array, size 0x8 lma 0x8009d28 +Loading section .fini_array, size 0x8 lma 0x8009d30 +Loading section .data, size 0x9a8 lma 0x8009d38 +Start address 0x080042b0, load size 42672 +Transfer rate: 29 KB/sec, 4741 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] +0x08003c02 in UART_WaitOnFlagUntilTimeout (huart=0x20000a60 , Flag=32, Status=, Tickstart=21542, Timeout=1) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +3536 if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) +### Assembly ######################################################################################################## + 0x08003bf6 UART_WaitOnFlagUntilTimeout+32 cmp r0, r8 + 0x08003bf8 UART_WaitOnFlagUntilTimeout+34 bhi.n 0x8003c56 + 0x08003bfa UART_WaitOnFlagUntilTimeout+36 cmp.w r8, #0 + 0x08003bfe UART_WaitOnFlagUntilTimeout+40 beq.n 0x8003c56 + 0x08003c00 UART_WaitOnFlagUntilTimeout+42 ldr r3, [r5, #0] + 0x08003c02 UART_WaitOnFlagUntilTimeout+44 ldr r2, [r3, #0] + 0x08003c04 UART_WaitOnFlagUntilTimeout+46 tst.w r2, #4 + 0x08003c08 UART_WaitOnFlagUntilTimeout+50 beq.n 0x8003bd6 + 0x08003c0a UART_WaitOnFlagUntilTimeout+52 ldr r2, [r3, #28] + 0x08003c0c UART_WaitOnFlagUntilTimeout+54 tst.w r2, #2048 ; 0x800 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x20000a60 r10 0x00000000 pc 0x08003c02 primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x21000035 basepri 0x00 + r2 0x006010d0 r7 0x00000020 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40013800 r8 0x00000001 sp 0x2000ff18 msp 0x2000ff18 control 0x00 + r4 0x00000000 r9 0x00005426 lr 0x08003bf3 psp 0x00000000 +### Source ########################################################################################################## + 3526 */ + 3527 HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, + 3528 uint32_t Tickstart, uint32_t Timeout) + 3529 { + 3530 /* Wait until flag is set */ + 3531 while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) + 3532 { + 3533 /* Check for the Timeout */ + 3534 if (Timeout != HAL_MAX_DELAY) + 3535 { + 3536 if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) + 3537 { + 3538 /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) + 3539 interrupts for the interrupt process */ + 3540 #if defined(USART_CR1_FIFOEN) + 3541 ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE_RXFNEIE | USART_CR1_PEIE | + 3542 USART_CR1_TXEIE_TXFNFIE)); + 3543 #else + 3544 ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_TXEIE)); + 3545 #endif /* USART_CR1_FIFOEN */ +### Stack ########################################################################################################### +[0] from 0x08003c02 in UART_WaitOnFlagUntilTimeout+44 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +[1] from 0x08003e5c in HAL_UART_Receive+222 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1284 +[2] from 0x0800426c in UART1_RxCpltCallback+16 at shared/drivers/p_serial_mgr.c:46 +[3] from 0x0800345e in UART_RxISR_8BIT+114 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4397 +[4] from 0x080035b0 in HAL_UART_IRQHandler+92 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2639 +[5] from 0x08001554 in PendSV_Handler+2 at Core/Src/stm32l4xx_it.c:180 +### Threads ######################################################################################################### +[1] id 0 from 0x08003c02 in UART_WaitOnFlagUntilTimeout+44 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +### Variables ####################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi…, Flag = 32, Status = , Tickstart = 21542, Timeout = 1 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x96a8 lma 0x80001c0 +Loading section .rodata, size 0x4c8 lma 0x8009868 +Loading section .ARM, size 0x8 lma 0x8009d30 +Loading section .init_array, size 0x8 lma 0x8009d38 +Loading section .fini_array, size 0x8 lma 0x8009d40 +Loading section .data, size 0x9a8 lma 0x8009d48 +Start address 0x080042c0, load size 42688 +Transfer rate: 29 KB/sec, 4743 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] +0x08003c1a in UART_WaitOnFlagUntilTimeout (huart=0x20000a60 , Flag=32, Status=, Tickstart=17846, Timeout=1) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3558 +3558 if (__HAL_UART_GET_FLAG(huart, UART_FLAG_RTOF) == SET) +### Assembly ######################################################################################################## + 0x08003c0e UART_WaitOnFlagUntilTimeout+60 beq.n 0x8003c66 + 0x08003c10 UART_WaitOnFlagUntilTimeout+62 ldr r3, [r5, #0] + 0x08003c12 UART_WaitOnFlagUntilTimeout+64 ldr r2, [r3, #0] + 0x08003c14 UART_WaitOnFlagUntilTimeout+66 tst.w r2, #4 + 0x08003c18 UART_WaitOnFlagUntilTimeout+70 beq.n 0x8003be6 + 0x08003c1a UART_WaitOnFlagUntilTimeout+72 ldr r2, [r3, #28] + 0x08003c1c UART_WaitOnFlagUntilTimeout+74 tst.w r2, #2048 ; 0x800 + 0x08003c20 UART_WaitOnFlagUntilTimeout+78 beq.n 0x8003be6 + 0x08003c22 UART_WaitOnFlagUntilTimeout+80 mov.w r2, #2048 ; 0x800 + 0x08003c26 UART_WaitOnFlagUntilTimeout+84 str r2, [r3, #32] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x20000a60 r10 0x00000000 pc 0x08003c1a primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x21030035 basepri 0x00 + r2 0x0000000d r7 0x00000020 r12 0xffffffff fpscr 0x00000010 faultmask 0x00 + r3 0x40013800 r8 0x00000001 sp 0x2000fda8 msp 0x2000fda8 control 0x00 + r4 0x00000000 r9 0x000045b6 lr 0x08003c03 psp 0x00000000 +### Source ########################################################################################################## + 3548 huart->gState = HAL_UART_STATE_READY; + 3549 huart->RxState = HAL_UART_STATE_READY; + 3550 + 3551 __HAL_UNLOCK(huart); + 3552 + 3553 return HAL_TIMEOUT; + 3554 } + 3555 + 3556 if (READ_BIT(huart->Instance->CR1, USART_CR1_RE) != 0U) + 3557 { + 3558 if (__HAL_UART_GET_FLAG(huart, UART_FLAG_RTOF) == SET) + 3559 { + 3560 /* Clear Receiver Timeout flag*/ + 3561 __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_RTOF); + 3562 + 3563 /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) + 3564 interrupts for the interrupt process */ + 3565 #if defined(USART_CR1_FIFOEN) + 3566 ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE_RXFNEIE | USART_CR1_PEIE | + 3567 USART_CR1_TXEIE_TXFNFIE)); +### Stack ########################################################################################################### +[0] from 0x08003c1a in UART_WaitOnFlagUntilTimeout+72 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3558 +[1] from 0x08003e6c in HAL_UART_Receive+242 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1290 +[2] from 0x0800427c in p_serial_mgr_start+24 at shared/drivers/p_serial_mgr.c:62 +[3] from 0x0800346e in UART_RxISR_8BIT+134 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4407 +[4] from 0x080035c0 in HAL_UART_IRQHandler+112 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2365 +[5] from 0x08001564 in USART1_IRQHandler+12 at Core/Src/stm32l4xx_it.c:215 +[6] from 0xffffffe9 +[7] from 0x08003c1a in UART_WaitOnFlagUntilTimeout+72 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3558 +[8] from 0x08003d3c in HAL_UART_Transmit+154 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1194 +[9] from 0x080041c2 in p_printf+74 at shared/util/putil.c:26 +[+] +### Threads ######################################################################################################### +[1] id 0 from 0x08003c1a in UART_WaitOnFlagUntilTimeout+72 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3558 +### Variables ####################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi…, Flag = 32, Status = , Tickstart = 17846, Timeout = 1 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9670 lma 0x80001c0 +Loading section .rodata, size 0x488 lma 0x8009830 +Loading section .ARM, size 0x8 lma 0x8009cb8 +Loading section .init_array, size 0x8 lma 0x8009cc0 +Loading section .fini_array, size 0x8 lma 0x8009cc8 +Loading section .data, size 0x9a8 lma 0x8009cd0 +Start address 0x08004288, load size 42568 +Transfer rate: 29 KB/sec, 4729 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] +RCC_SetFlashLatencyFromMSIRange (msirange=0) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c:1795 +1795 { +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ + 0x0800218c RCC_SetFlashLatencyFromMSIRange+0 ldr r3, [pc, #4] ; (0x8002194 ) + 0x0800218e RCC_SetFlashLatencyFromMSIRange+2 ldr r0, [r3, #0] + 0x08002190 RCC_SetFlashLatencyFromMSIRange+4 bx lr + 0x08002192 RCC_SetFlashLatencyFromMSIRange+6 nop + 0x08002194 RCC_SetFlashLatencyFromMSIRange+8 lsrs r0, r2, #15 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x20000b14 r10 0x00000000 pc 0x0800218c primask 0x00 + r1 0x00000080 r6 0x00000000 r11 0x00000000 xPSR 0x01070000 basepri 0x00 + r2 0x00600010 r7 0x00000080 r12 0xffffffff fpscr 0x00000010 faultmask 0x00 + r3 0x40004400 r8 0x00000064 sp 0x2000fd80 msp 0x2000fd80 control 0x04 + r4 0x00000000 r9 0x00024e31 lr 0x08003bff psp 0x00000000 +### Source ########################################################################################################## + 1785 /** @addtogroup RCC_Private_Functions + 1786 * @{ + 1787 */ + 1788 /** + 1789 * @brief Update number of Flash wait states in line with MSI range and current + 1790 voltage range. + 1791 * @param msirange MSI range value from RCC_MSIRANGE_0 to RCC_MSIRANGE_11 + 1792 * @retval HAL status + 1793 */ + 1794 static HAL_StatusTypeDef RCC_SetFlashLatencyFromMSIRange(uint32_t msirange) + 1795 { + 1796 uint32_t vos; + 1797 uint32_t latency = FLASH_LATENCY_0; /* default value 0WS */ + 1798 + 1799 if(__HAL_RCC_PWR_IS_CLK_ENABLED()) + 1800 { + 1801 vos = HAL_PWREx_GetVoltageRange(); + 1802 } + 1803 else + 1804 { +### Stack ########################################################################################################### +[0] from 0x0800218c in RCC_SetFlashLatencyFromMSIRange+0 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c:1795 +[1] from 0x08003bfe in UART_WaitOnFlagUntilTimeout+56 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3536 +[2] from 0x08003d38 in HAL_UART_Transmit+162 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1201 +[3] from 0x080041be in p_printf+82 at shared/util/putil.c:26 +### Threads ######################################################################################################### +[1] id 0 from 0x0800218c in RCC_SetFlashLatencyFromMSIRange+0 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c:1795 +### Variables ####################################################################################################### +arg msirange = 0 +loc vos = , latency = +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9678 lma 0x80001c0 +Loading section .rodata, size 0x488 lma 0x8009838 +Loading section .ARM, size 0x8 lma 0x8009cc0 +Loading section .init_array, size 0x8 lma 0x8009cc8 +Loading section .fini_array, size 0x8 lma 0x8009cd0 +Loading section .data, size 0x9a8 lma 0x8009cd8 +Start address 0x08004290, load size 42576 +Transfer rate: 29 KB/sec, 4730 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] +0x08003bd6 in UART_WaitOnFlagUntilTimeout (huart=0x20000b14 , Flag=128, Status=, Tickstart=17636, Timeout=100) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3531 +3531 while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) +### Assembly ######################################################################################################## + 0x08003bca UART_WaitOnFlagUntilTimeout+20 mov r5, r0 + 0x08003bcc UART_WaitOnFlagUntilTimeout+22 mov r7, r1 + 0x08003bce UART_WaitOnFlagUntilTimeout+24 mov r6, r2 + 0x08003bd0 UART_WaitOnFlagUntilTimeout+26 mov r9, r3 + 0x08003bd2 UART_WaitOnFlagUntilTimeout+28 ldr.w r8, [sp, #32] + 0x08003bd6 UART_WaitOnFlagUntilTimeout+32 ldr r3, [r5, #0] + 0x08003bd8 UART_WaitOnFlagUntilTimeout+34 ldr r4, [r3, #28] + 0x08003bda UART_WaitOnFlagUntilTimeout+36 bics.w r4, r7, r4 + 0x08003bde UART_WaitOnFlagUntilTimeout+40 ite eq + 0x08003be0 UART_WaitOnFlagUntilTimeout+42 moveq r4, #1 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x20000b14 r10 0x00000000 pc 0x08003bd6 primask 0x00 + r1 0x00000080 r6 0x00000000 r11 0x00000000 xPSR 0x41030000 basepri 0x00 + r2 0x00600010 r7 0x00000080 r12 0xffffffff fpscr 0x00000010 faultmask 0x00 + r3 0x40004400 r8 0x00000064 sp 0x2000fd80 msp 0x2000fd80 control 0x04 + r4 0x00000000 r9 0x000044e4 lr 0x08003bf3 psp 0x00000000 +### Source ########################################################################################################## + 3521 * @param Flag Specifies the UART flag to check + 3522 * @param Status The actual Flag status (SET or RESET) + 3523 * @param Tickstart Tick start value + 3524 * @param Timeout Timeout duration + 3525 * @retval HAL status + 3526 */ + 3527 HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, + 3528 uint32_t Tickstart, uint32_t Timeout) + 3529 { + 3530 /* Wait until flag is set */ + 3531 while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) + 3532 { + 3533 /* Check for the Timeout */ + 3534 if (Timeout != HAL_MAX_DELAY) + 3535 { + 3536 if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) + 3537 { + 3538 /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) + 3539 interrupts for the interrupt process */ + 3540 #if defined(USART_CR1_FIFOEN) +### Stack ########################################################################################################### +[0] from 0x08003bd6 in UART_WaitOnFlagUntilTimeout+32 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3531 +[1] from 0x08003d2c in HAL_UART_Transmit+166 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1202 +[2] from 0x080041b2 in p_printf+86 at shared/util/putil.c:16 +[3] from 0x080014fa in main+186 at Core/Src/main.c:141 +### Threads ######################################################################################################### +[1] id 0 from 0x08003bd6 in UART_WaitOnFlagUntilTimeout+32 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3531 +### Variables ####################################################################################################### +arg huart = 0x20000b14 : {Instance = 0x40004400,Init = {BaudRate = 115200,WordLength = 0,StopBi…, Flag = 128, Status = , Tickstart = 17636, Timeout = 100 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9668 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009828 +Loading section .ARM, size 0x8 lma 0x8009ca8 +Loading section .init_array, size 0x8 lma 0x8009cb0 +Loading section .fini_array, size 0x8 lma 0x8009cb8 +Loading section .data, size 0x9a8 lma 0x8009cc0 +Start address 0x08004280, load size 42552 +Transfer rate: 29 KB/sec, 4728 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] +0x0800424c in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:56 +56 if (b_go) +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004248 p_serial_mgr_service+0 ldr r3, [pc, #12] ; (0x8004258 ) + 0x0800424a p_serial_mgr_service+2 ldrb r0, [r3, #0] + 0x0800424c p_serial_mgr_service+4 cbnz r0, 0x8004250 + 0x0800424e p_serial_mgr_service+6 bx lr + 0x08004250 p_serial_mgr_service+8 movs r2, #0 + 0x08004252 p_serial_mgr_service+10 strb r2, [r3, #0] + 0x08004254 p_serial_mgr_service+12 b.n 0x800424e +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x0800424c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40013800 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000100 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 46 bool p_serial_mgr_service(void) + 47 { + 48 // // this will be less garbage when i switch to a queue + 49 // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 50 // { + 51 // if (serial_pkt_cb.buffer[ind].b_ready) + 52 // { + 53 // return &serial_pkt_cb.buffer[ind]; + 54 // } + 55 // } + 56 if (b_go) + 57 { + 58 b_go = false; + 59 return true; + 60 } + 61 return false; + 62 } + 63 + 64 void p_serial_mgr_start() + 65 { +### Stack ########################################################################################################### +[0] from 0x0800424c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:56 +[1] from 0x080014f2 in main+178 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800424c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:56 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9668 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009828 +Loading section .ARM, size 0x8 lma 0x8009ca8 +Loading section .init_array, size 0x8 lma 0x8009cb0 +Loading section .fini_array, size 0x8 lma 0x8009cb8 +Loading section .data, size 0x9a8 lma 0x8009cc0 +Start address 0x08004280, load size 42552 +Transfer rate: 29 KB/sec, 4728 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] +0x0800424c in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:56 +56 return b_go; +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004248 p_serial_mgr_service+0 ldr r3, [pc, #12] ; (0x8004258 ) + 0x0800424a p_serial_mgr_service+2 ldrb r0, [r3, #0] + 0x0800424c p_serial_mgr_service+4 cbnz r0, 0x8004250 + 0x0800424e p_serial_mgr_service+6 bx lr + 0x08004250 p_serial_mgr_service+8 movs r2, #0 + 0x08004252 p_serial_mgr_service+10 strb r2, [r3, #0] +~ +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x0800424c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40013800 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000100 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 46 bool p_serial_mgr_service(void) + 47 { + 48 // // this will be less garbage when i switch to a queue + 49 // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 50 // { + 51 // if (serial_pkt_cb.buffer[ind].b_ready) + 52 // { + 53 // return &serial_pkt_cb.buffer[ind]; + 54 // } + 55 // } + 56 return b_go; + 57 } + 58 + 59 void p_serial_mgr_start() + 60 { + 61 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 62 b_go = false; + 63 } +~ +~ +### Stack ########################################################################################################### +[0] from 0x0800424c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:56 +[1] from 0x080014f2 in main+178 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800424c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:56 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9670 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009830 +Loading section .ARM, size 0x8 lma 0x8009cb0 +Loading section .init_array, size 0x8 lma 0x8009cb8 +Loading section .fini_array, size 0x8 lma 0x8009cc0 +Loading section .data, size 0x9a8 lma 0x8009cc8 +Start address 0x08004284, load size 42560 +Transfer rate: 29 KB/sec, 4728 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] +0x0800424a in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:56 +56 return b_go; +### Assembly ######################################################################################################## +~ +~ +~ +~ + 0x08004248 p_serial_mgr_service+0 ldr r3, [pc, #4] ; (0x8004250 ) + 0x0800424a p_serial_mgr_service+2 ldrb r0, [r3, #0] + 0x0800424c p_serial_mgr_service+4 bx lr + 0x0800424e p_serial_mgr_service+6 nop + 0x08004250 p_serial_mgr_service+8 lsrs r0, r5, #15 + 0x08004252 p_serial_mgr_service+10 movs r0, #0 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x0800424a primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000100 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 46 bool p_serial_mgr_service(void) + 47 { + 48 // // this will be less garbage when i switch to a queue + 49 // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 50 // { + 51 // if (serial_pkt_cb.buffer[ind].b_ready) + 52 // { + 53 // return &serial_pkt_cb.buffer[ind]; + 54 // } + 55 // } + 56 return b_go; + 57 } + 58 + 59 void p_serial_mgr_start() + 60 { + 61 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 62 b_go = false; + 63 } +~ +~ +### Stack ########################################################################################################### +[0] from 0x0800424a in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:56 +[1] from 0x080014f2 in main+178 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800424a in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:56 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9670 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009830 +Loading section .ARM, size 0x8 lma 0x8009cb0 +Loading section .init_array, size 0x8 lma 0x8009cb8 +Loading section .fini_array, size 0x8 lma 0x8009cc0 +Loading section .data, size 0x9a8 lma 0x8009cc8 +Start address 0x08004284, load size 42560 +Transfer rate: 29 KB/sec, 4728 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:139 +139 if (p_serial_mgr_service()) +### Assembly ######################################################################################################## + 0x080014de main+158 mov.w r2, #256 ; 0x100 + 0x080014e2 main+162 movs r1, #0 + 0x080014e4 main+164 mov r0, sp + 0x080014e6 main+166 bl 0x8004320 + 0x080014ea main+170 bl 0x8004254 + 0x080014ee main+174 bl 0x8004248 + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee + 0x080014f6 main+182 movs r3, #50 ; 0x32 + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ee primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 129 p_serial_mgr_start(); + 130 + 131 uint16_t motor_degrees = 0; + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); +### Stack ########################################################################################################### +[0] from 0x080014ee in main+174 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ee in main+174 at Core/Src/main.c:139 +### Variables ####################################################################################################### +loc rxb = '\000' +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9660 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009820 +Loading section .ARM, size 0x8 lma 0x8009ca0 +Loading section .init_array, size 0x8 lma 0x8009ca8 +Loading section .fini_array, size 0x8 lma 0x8009cb0 +Loading section .data, size 0x9a8 lma 0x8009cb8 +Start address 0x08004274, load size 42544 +Transfer rate: 29 KB/sec, 4727 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] +0x0800423a in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:53 +53 return b_go; +### Assembly ######################################################################################################## +~ +~ +~ +~ + 0x08004238 p_serial_mgr_service+0 ldr r3, [pc, #4] ; (0x8004240 ) + 0x0800423a p_serial_mgr_service+2 ldrb r0, [r3, #0] + 0x0800423c p_serial_mgr_service+4 bx lr + 0x0800423e p_serial_mgr_service+6 nop + 0x08004240 p_serial_mgr_service+8 lsrs r0, r5, #15 + 0x08004242 p_serial_mgr_service+10 movs r0, #0 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x0800423a primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 43 bool p_serial_mgr_service(void) + 44 { + 45 // // this will be less garbage when i switch to a queue + 46 // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 47 // { + 48 // if (serial_pkt_cb.buffer[ind].b_ready) + 49 // { + 50 // return &serial_pkt_cb.buffer[ind]; + 51 // } + 52 // } + 53 return b_go; + 54 } + 55 + 56 void p_serial_mgr_start() + 57 { + 58 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 59 b_go = false; + 60 } +~ +~ +### Stack ########################################################################################################### +[0] from 0x0800423a in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:53 +[1] from 0x080014f2 in main+178 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800423a in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:53 +### 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: 0x08004274 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9660 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009820 +Loading section .ARM, size 0x8 lma 0x8009ca0 +Loading section .init_array, size 0x8 lma 0x8009ca8 +Loading section .fini_array, size 0x8 lma 0x8009cb0 +Loading section .data, size 0x9a8 lma 0x8009cb8 +Start address 0x08004274, load size 42544 +Transfer rate: 29 KB/sec, 4727 bytes/write. +Breakpoint 1 at 0x800420c: file shared/drivers/p_serial_mgr.c, line 34. +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:34 +34 b_go = true; +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x0800420c UART1_RxCpltCallback+0 ldr r3, [pc, #4] ; (0x8004214 ) + 0x0800420e UART1_RxCpltCallback+2 movs r2, #1 + 0x08004210 UART1_RxCpltCallback+4 strb r2, [r3, #0] + 0x08004212 UART1_RxCpltCallback+6 bx lr + 0x08004214 UART1_RxCpltCallback+8 lsrs r0, r5, #15 +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000a60 r5 0x00004001 r10 0x00000000 pc 0x0800420c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x0800420d r8 0x00000000 sp 0x2000fe68 msp 0x2000fe68 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x0800344f psp 0x00000000 +### Source ########################################################################################################## + 24 SS_ESC = 3, // get byte, dont increment number left + 25 SS_CHECKSUM = 4 // done + 26 } serial_state_t; + 27 + 28 static UART_HandleTypeDef *_serial_huart_inst = NULL; + 29 + 30 static uint8_t rxc = '\0'; + 31 static bool b_go = false; + 32 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 33 { +!34 b_go = true; + 35 } + 36 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 37 { + 38 _serial_huart_inst = huart; + 39 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 40 b_go = false; + 41 } + 42 + 43 bool p_serial_mgr_service(void) +### Stack ########################################################################################################### +[0] from 0x0800420c in UART1_RxCpltCallback+0 at shared/drivers/p_serial_mgr.c:34 +[1] from 0x0800344e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035a0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001544 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x080014ee in main+174 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800420c in UART1_RxCpltCallback+0 at shared/drivers/p_serial_mgr.c:34 +### Variables ####################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +##################################################################################################################### +Continuing. +### Output/messages ################################################################################################# +halted: PC: 0x0800420e + +Program received signal SIGINT, Interrupt. +0x0800423c in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:53 +53 return b_go; +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004238 p_serial_mgr_service+0 ldr r3, [pc, #4] ; (0x8004240 ) + 0x0800423a p_serial_mgr_service+2 ldrb r0, [r3, #0] + 0x0800423c p_serial_mgr_service+4 bx lr + 0x0800423e p_serial_mgr_service+6 nop + 0x08004240 p_serial_mgr_service+8 lsrs r0, r5, #15 + 0x08004242 p_serial_mgr_service+10 movs r0, #0 +~ +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x0800423c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 43 bool p_serial_mgr_service(void) + 44 { + 45 // // this will be less garbage when i switch to a queue + 46 // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 47 // { + 48 // if (serial_pkt_cb.buffer[ind].b_ready) + 49 // { + 50 // return &serial_pkt_cb.buffer[ind]; + 51 // } + 52 // } + 53 return b_go; + 54 } + 55 + 56 void p_serial_mgr_start() + 57 { + 58 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 59 b_go = false; + 60 } +~ +~ +### Stack ########################################################################################################### +[0] from 0x0800423c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:53 +[1] from 0x080014f2 in main+178 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800423c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:53 +### Variables ####################################################################################################### +##################################################################################################################### +$1 = false +Breakpoint 2 at 0x80014f6: file Core/Src/main.c, line 141. +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:34 +34 b_go = true; +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x0800420c UART1_RxCpltCallback+0 ldr r3, [pc, #4] ; (0x8004214 ) + 0x0800420e UART1_RxCpltCallback+2 movs r2, #1 + 0x08004210 UART1_RxCpltCallback+4 strb r2, [r3, #0] + 0x08004212 UART1_RxCpltCallback+6 bx lr + 0x08004214 UART1_RxCpltCallback+8 lsrs r0, r5, #15 +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000a60 r5 0x00004001 r10 0x00000000 pc 0x0800420c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x81000035 basepri 0x00 + r2 0x40013808 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x0800420d r8 0x00000000 sp 0x2000fe68 msp 0x2000fe68 control 0x00 + r4 0x20000a60 r9 0x00000000 lr 0x0800344f psp 0x00000000 +### Source ########################################################################################################## + 24 SS_ESC = 3, // get byte, dont increment number left + 25 SS_CHECKSUM = 4 // done + 26 } serial_state_t; + 27 + 28 static UART_HandleTypeDef *_serial_huart_inst = NULL; + 29 + 30 static uint8_t rxc = '\0'; + 31 static bool b_go = false; + 32 void UART1_RxCpltCallback(UART_HandleTypeDef *huart) + 33 { +!34 b_go = true; + 35 } + 36 void p_serial_mgr_init(UART_HandleTypeDef *huart) + 37 { + 38 _serial_huart_inst = huart; + 39 _serial_huart_inst->RxCpltCallback = UART1_RxCpltCallback; + 40 b_go = false; + 41 } + 42 + 43 bool p_serial_mgr_service(void) +### Stack ########################################################################################################### +[0] from 0x0800420c in UART1_RxCpltCallback+0 at shared/drivers/p_serial_mgr.c:34 +[1] from 0x0800344e in UART_RxISR_8BIT+130 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:4430 +[2] from 0x080035a0 in HAL_UART_IRQHandler+108 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:2347 +[3] from 0x08001544 in USART1_IRQHandler+8 at Core/Src/stm32l4xx_it.c:211 +[4] from 0xffffffe9 +[5] from 0x080014f4 in main+180 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800420c in UART1_RxCpltCallback+0 at shared/drivers/p_serial_mgr.c:34 +### Variables ####################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi… +##################################################################################################################### +Continuing. +### Output/messages ################################################################################################# +halted: PC: 0x0800420e + +Breakpoint 2, main () at Core/Src/main.c:141 +141 HAL_UART_Receive(&huart2, rxb, 256, 50); +### Assembly ######################################################################################################## + 0x080014e6 main+166 bl 0x8004310 + 0x080014ea main+170 bl 0x8004244 + 0x080014ee main+174 bl 0x8004238 + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee +!0x080014f6 main+182 movs r3, #50 ; 0x32 + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 + 0x080014fc main+188 mov r1, sp + 0x080014fe main+190 ldr r0, [pc, #8] ; (0x8001508 ) + 0x08001500 main+192 bl 0x8003d5e +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000001 r5 0x200009c8 r10 0x00000000 pc 0x080014f6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x2000fff0 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 131 uint16_t motor_degrees = 0; + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) +### Stack ########################################################################################################### +[0] from 0x080014f6 in main+182 at Core/Src/main.c:141 +### Threads ######################################################################################################### +[1] id 0 from 0x080014f6 in main+182 at Core/Src/main.c:141 +### Variables ####################################################################################################### +loc rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014f8 +halted: PC: 0x080014fc +halted: PC: 0x080014fe +halted: PC: 0x08001500 +halted: PC: 0x08003d5e +142 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## +!0x080014f6 main+182 movs r3, #50 ; 0x32 + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 + 0x080014fc main+188 mov r1, sp + 0x080014fe main+190 ldr r0, [pc, #8] ; (0x8001508 ) + 0x08001500 main+192 bl 0x8003d5e + 0x08001504 main+196 movs r4, #0 + 0x08001506 main+198 b.n 0x80014d4 + 0x08001508 main+200 lsrs r4, r2, #12 + 0x0800150a main+202 movs r0, #0 + 0x0800150c main+204 asrs r5, r6, #4 +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000002 r5 0x200009c8 r10 0x00000000 pc 0x08001504 primask 0x00 + r1 0x2000fef0 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000100 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x00000022 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x08001505 psp 0x00000000 +### Source ########################################################################################################## + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { +### Stack ########################################################################################################### +[0] from 0x08001504 in main+196 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x08001504 in main+196 at Core/Src/main.c:142 +### Variables ####################################################################################################### +loc ind = 0, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08001506 +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +144 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #0] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000002 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x2000fef0 r6 0x00000000 r11 0x00000000 xPSR 0x81000000 basepri 0x00 + r2 0x00000100 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x00000022 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x08001505 psp 0x00000000 +### Source ########################################################################################################## + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { + 152 // // PDEBUG("%d\n", sys_time); + 153 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:144 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:144 +### Variables ####################################################################################################### +loc ind = 0, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014ce +halted: PC: 0x080041d8 +142 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca + 0x080014d8 main+152 ldr r0, [pc, #68] ; (0x8001520 ) + 0x080014da main+154 bl 0x800415c +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014d2 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { +### Stack ########################################################################################################### +[0] from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Variables ####################################################################################################### +loc ind = 0, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +144 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #0] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000001 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { + 152 // // PDEBUG("%d\n", sys_time); + 153 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:144 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:144 +### Variables ####################################################################################################### +loc ind = 1, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014ce +halted: PC: 0x080041d8 +142 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca + 0x080014d8 main+152 ldr r0, [pc, #68] ; (0x8001520 ) + 0x080014da main+154 bl 0x800415c +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014d2 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000001 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { +### Stack ########################################################################################################### +[0] from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Variables ####################################################################################################### +loc ind = 1, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +144 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #0] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000002 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { + 152 // // PDEBUG("%d\n", sys_time); + 153 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:144 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:144 +### Variables ####################################################################################################### +loc ind = 2, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014ce +halted: PC: 0x080041d8 +p_uart_async_write_byte (byte=0 '\000') at shared/util/putil.c:34 +34 { +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ + 0x080041d8 p_uart_async_write_byte+0 push {r4, lr} + 0x080041da p_uart_async_write_byte+2 sub sp, #8 + 0x080041dc p_uart_async_write_byte+4 ldr r4, [pc, #32] ; (0x8004200 ) + 0x080041de p_uart_async_write_byte+6 str r0, [sp, #0] + 0x080041e0 p_uart_async_write_byte+8 ldr r3, [pc, #32] ; (0x8004204 ) +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080041d8 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000002 r9 0x00000000 lr 0x080014d3 psp 0x00000000 +### Source ########################################################################################################## + 24 HAL_UART_Transmit(huart_inst, printf_buffer, strlen(printf_buffer), 100); + 25 return 0; + 26 } + 27 void p_uart_init(UART_HandleTypeDef *huart) + 28 { + 29 huart_inst = huart; + 30 PDEBUG("...\n"); + 31 PDEBUG("UART2 Initialized\n"); + 32 } + 33 void p_uart_async_write_byte(uint8_t byte) + 34 { + 35 sprintf(send, "%02x\n", byte); + 36 HAL_UART_Transmit(huart_inst, send, 3, 100); + 37 } +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x080041d8 in p_uart_async_write_byte+0 at shared/util/putil.c:34 +[1] from 0x080014d2 in main+146 at Core/Src/main.c:144 +### Threads ######################################################################################################### +[1] id 0 from 0x080041d8 in p_uart_async_write_byte+0 at shared/util/putil.c:34 +### Variables ####################################################################################################### +arg byte = 0 '\000' +##################################################################################################################### +#0 p_uart_async_write_byte (byte=0 '\000') at shared/util/putil.c:34 +34 { +Run till exit from #0 p_uart_async_write_byte (byte=0 '\000') at shared/util/putil.c:34 +### Output/messages ################################################################################################# +main () at Core/Src/main.c:142 +142 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca + 0x080014d8 main+152 ldr r0, [pc, #68] ; (0x8001520 ) + 0x080014da main+154 bl 0x800415c +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014d2 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000002 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { +### Stack ########################################################################################################### +[0] from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Variables ####################################################################################################### +loc ind = 2, rxb = '\000' +##################################################################################################################### +"finish" not meaningful in the outermost frame. +### Output/messages ################################################################################################# +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +144 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #0] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000003 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { + 152 // // PDEBUG("%d\n", sys_time); + 153 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:144 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:144 +### Variables ####################################################################################################### +loc ind = 3, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014ce +halted: PC: 0x080041d8 +142 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca + 0x080014d8 main+152 ldr r0, [pc, #68] ; (0x8001520 ) + 0x080014da main+154 bl 0x800415c +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014d2 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000003 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { +### Stack ########################################################################################################### +[0] from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Variables ####################################################################################################### +loc ind = 3, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +144 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #0] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000004 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { + 152 // // PDEBUG("%d\n", sys_time); + 153 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:144 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:144 +### Variables ####################################################################################################### +loc ind = 4, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014ce +halted: PC: 0x080041d8 +142 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca + 0x080014d8 main+152 ldr r0, [pc, #68] ; (0x8001520 ) + 0x080014da main+154 bl 0x800415c +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014d2 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000004 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { +### Stack ########################################################################################################### +[0] from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Variables ####################################################################################################### +loc ind = 4, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +144 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #0] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000005 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { + 152 // // PDEBUG("%d\n", sys_time); + 153 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:144 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:144 +### Variables ####################################################################################################### +loc ind = 5, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014ce +halted: PC: 0x080041d8 +142 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca + 0x080014d8 main+152 ldr r0, [pc, #68] ; (0x8001520 ) + 0x080014da main+154 bl 0x800415c +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014d2 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000005 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { +### Stack ########################################################################################################### +[0] from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Variables ####################################################################################################### +loc ind = 5, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +144 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #0] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000006 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { + 152 // // PDEBUG("%d\n", sys_time); + 153 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:144 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:144 +### Variables ####################################################################################################### +loc ind = 6, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014ce +halted: PC: 0x080041d8 +142 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca + 0x080014d8 main+152 ldr r0, [pc, #68] ; (0x8001520 ) + 0x080014da main+154 bl 0x800415c +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014d2 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000006 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { +### Stack ########################################################################################################### +[0] from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x080014d2 in main+146 at Core/Src/main.c:142 +### Variables ####################################################################################################### +loc ind = 6, rxb = '\000' +##################################################################################################################### +"finish" not meaningful in the outermost frame. +### Output/messages ################################################################################################# +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +144 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #0] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #4 + 0x080014c4 main+132 bl 0x8004310 + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 ldrb.w r0, [sp, r4] + 0x080014ce main+142 bl 0x80041d8 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009891 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000007 r9 0x00000000 lr 0x08003be3 psp 0x00000000 +### Source ########################################################################################################## + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 for (int ind = 0; ind < 20; ind++) + 143 { + 144 p_uart_async_write_byte(rxb[ind]); + 145 } + 146 PDEBUG("\n\n\n\n"); + 147 memset(rxb, 0, 256); + 148 p_serial_mgr_start(); + 149 } + 150 // if (b_timer_struck) + 151 // { + 152 // // PDEBUG("%d\n", sys_time); + 153 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:144 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:144 +### Variables ####################################################################################################### +loc ind = 7, rxb = '\000' +##################################################################################################################### +"finish" not meaningful in the outermost frame. +Not stopped at any breakpoint; argument ignored. +Continuing. +### Output/messages ################################################################################################# + +Program received signal SIGINT, Interrupt. +0x0800423c in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:53 +53 return b_go; +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004238 p_serial_mgr_service+0 ldr r3, [pc, #4] ; (0x8004240 ) + 0x0800423a p_serial_mgr_service+2 ldrb r0, [r3, #0] + 0x0800423c p_serial_mgr_service+4 bx lr + 0x0800423e p_serial_mgr_service+6 nop + 0x08004240 p_serial_mgr_service+8 lsrs r0, r5, #15 + 0x08004242 p_serial_mgr_service+10 movs r0, #0 +~ +### Breakpoints ##################################################################################################### +[1] break at 0x0800420c in shared/drivers/p_serial_mgr.c:34 for UART1_RxCpltCallback hit 1 time +[2] break at 0x080014f6 in Core/Src/main.c:141 for main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = false +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x0800423c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 43 bool p_serial_mgr_service(void) + 44 { + 45 // // this will be less garbage when i switch to a queue + 46 // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 47 // { + 48 // if (serial_pkt_cb.buffer[ind].b_ready) + 49 // { + 50 // return &serial_pkt_cb.buffer[ind]; + 51 // } + 52 // } + 53 return b_go; + 54 } + 55 + 56 void p_serial_mgr_start() + 57 { + 58 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 59 b_go = false; + 60 } +~ +~ +### Stack ########################################################################################################### +[0] from 0x0800423c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:53 +[1] from 0x080014f2 in main+178 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800423c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:53 +### Variables ####################################################################################################### +##################################################################################################################### +$2 = false +Detaching from program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x0800423c in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:53 +53 return b_go; +### Assembly ######################################################################################################## +~ +~ +~ + 0x08004238 p_serial_mgr_service+0 ldr r3, [pc, #4] ; (0x8004240 ) + 0x0800423a p_serial_mgr_service+2 ldrb r0, [r3, #0] + 0x0800423c p_serial_mgr_service+4 bx lr + 0x0800423e p_serial_mgr_service+6 nop + 0x08004240 p_serial_mgr_service+8 lsrs r0, r5, #15 + 0x08004242 p_serial_mgr_service+10 movs r0, #0 +~ +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x0800423c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 43 bool p_serial_mgr_service(void) + 44 { + 45 // // this will be less garbage when i switch to a queue + 46 // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 47 // { + 48 // if (serial_pkt_cb.buffer[ind].b_ready) + 49 // { + 50 // return &serial_pkt_cb.buffer[ind]; + 51 // } + 52 // } + 53 return b_go; + 54 } + 55 + 56 void p_serial_mgr_start() + 57 { + 58 b_go = false; + 59 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 60 } +~ +~ +### Stack ########################################################################################################### +[0] from 0x0800423c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:53 +[1] from 0x080014f2 in main+178 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800423c in p_serial_mgr_service+4 at shared/drivers/p_serial_mgr.c:53 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9660 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009820 +Loading section .ARM, size 0x8 lma 0x8009ca0 +Loading section .init_array, size 0x8 lma 0x8009ca8 +Loading section .fini_array, size 0x8 lma 0x8009cb0 +Loading section .data, size 0x9a8 lma 0x8009cb8 +Start address 0x08004274, load size 42544 +Transfer rate: 29 KB/sec, 4727 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:139 +139 if (p_serial_mgr_service()) +### Assembly ######################################################################################################## + 0x080014de main+158 mov.w r2, #256 ; 0x100 + 0x080014e2 main+162 movs r1, #0 + 0x080014e4 main+164 mov r0, sp + 0x080014e6 main+166 bl 0x8004310 + 0x080014ea main+170 bl 0x8004244 + 0x080014ee main+174 bl 0x8004238 + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee + 0x080014f6 main+182 movs r3, #50 ; 0x32 + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ee primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40013800 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 129 p_serial_mgr_start(); + 130 + 131 uint16_t motor_degrees = 0; + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 + 143 for (int ind = 0; ind < 20; ind++) + 144 { + 145 p_uart_async_write_byte(rxb[ind]); + 146 } + 147 PDEBUG("\n\n\n\n"); + 148 memset(rxb, 0, 256); +### Stack ########################################################################################################### +[0] from 0x080014ee in main+174 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ee in main+174 at Core/Src/main.c:139 +### Variables ####################################################################################################### +loc rxb = '\000' +##################################################################################################################### +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: 0x08004274 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9660 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009820 +Loading section .ARM, size 0x8 lma 0x8009ca0 +Loading section .init_array, size 0x8 lma 0x8009ca8 +Loading section .fini_array, size 0x8 lma 0x8009cb0 +Loading section .data, size 0x9a8 lma 0x8009cb8 +Start address 0x08004274, load size 42544 +Transfer rate: 29 KB/sec, 4727 bytes/write. +Breakpoint 1 at 0x80014f6: file Core/Src/main.c, line 141. +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:141 +141 HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 50); +### Assembly ######################################################################################################## + 0x080014e6 main+166 bl 0x8004310 + 0x080014ea main+170 bl 0x8004244 + 0x080014ee main+174 bl 0x8004238 + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee +!0x080014f6 main+182 movs r3, #50 ; 0x32 + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 + 0x080014fc main+188 mov r1, sp + 0x080014fe main+190 ldr r0, [pc, #8] ; (0x8001508 ) + 0x08001500 main+192 bl 0x8003d5e +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:141 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000001 r5 0x200009c8 r10 0x00000000 pc 0x080014f6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x2000fff0 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 131 uint16_t motor_degrees = 0; + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 + 143 for (int ind = 0; ind < 20; ind++) + 144 { + 145 p_uart_async_write_byte(rxb[ind]); + 146 } + 147 PDEBUG("\n\n\n\n"); + 148 memset(rxb, 0, 256); + 149 p_serial_mgr_start(); + 150 } +### Stack ########################################################################################################### +[0] from 0x080014f6 in main+182 at Core/Src/main.c:141 +### Threads ######################################################################################################### +[1] id 0 from 0x080014f6 in main+182 at Core/Src/main.c:141 +### Variables ####################################################################################################### +loc rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014f8 +halted: PC: 0x080014fc +halted: PC: 0x080014fe +halted: PC: 0x08001500 +halted: PC: 0x08003d5e +143 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## +!0x080014f6 main+182 movs r3, #50 ; 0x32 + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 + 0x080014fc main+188 mov r1, sp + 0x080014fe main+190 ldr r0, [pc, #8] ; (0x8001508 ) + 0x08001500 main+192 bl 0x8003d5e + 0x08001504 main+196 movs r4, #0 + 0x08001506 main+198 b.n 0x80014d4 + 0x08001508 main+200 lsrs r4, r2, #12 + 0x0800150a main+202 movs r0, #0 + 0x0800150c main+204 asrs r5, r6, #4 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:141 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000002 r5 0x200009c8 r10 0x00000000 pc 0x08001504 primask 0x00 + r1 0x2000fef0 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000100 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x00000022 r8 0x00000000 sp 0x2000fef0 msp 0x2000fef0 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x08001505 psp 0x00000000 +### Source ########################################################################################################## + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 + 143 for (int ind = 0; ind < 20; ind++) + 144 { + 145 p_uart_async_write_byte(rxb[ind]); + 146 } + 147 PDEBUG("\n\n\n\n"); + 148 memset(rxb, 0, 256); + 149 p_serial_mgr_start(); + 150 } + 151 // if (b_timer_struck) + 152 // { +### Stack ########################################################################################################### +[0] from 0x08001504 in main+196 at Core/Src/main.c:143 +### Threads ######################################################################################################### +[1] id 0 from 0x08001504 in main+196 at Core/Src/main.c:143 +### Variables ####################################################################################################### +loc ind = 0, rxb = '\000' +##################################################################################################################### +$1 = +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9660 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009820 +Loading section .ARM, size 0x8 lma 0x8009ca0 +Loading section .init_array, size 0x8 lma 0x8009ca8 +Loading section .fini_array, size 0x8 lma 0x8009cb0 +Loading section .data, size 0x9a8 lma 0x8009cb8 +Start address 0x08004278, load size 42544 +Transfer rate: 29 KB/sec, 4727 bytes/write. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 1, main () at Core/Src/main.c:141 +141 volatile HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 50); +### Assembly ######################################################################################################## + 0x080014e6 main+166 bl 0x8004314 + 0x080014ea main+170 bl 0x8004248 + 0x080014ee main+174 bl 0x800423c + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee +!0x080014f6 main+182 movs r3, #50 ; 0x32 + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 + 0x080014fc main+188 add r1, sp, #8 + 0x080014fe main+190 ldr r0, [pc, #12] ; (0x800150c ) + 0x08001500 main+192 bl 0x8003d62 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:141 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000001 r5 0x200009c8 r10 0x00000000 pc 0x080014f6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x2000fff0 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 131 uint16_t motor_degrees = 0; + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 volatile HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 + 143 for (int ind = 0; ind < 20; ind++) + 144 { + 145 p_uart_async_write_byte(rxb[ind]); + 146 } + 147 PDEBUG("\n\n\n\n"); + 148 memset(rxb, 0, 256); + 149 p_serial_mgr_start(); + 150 } +### Stack ########################################################################################################### +[0] from 0x080014f6 in main+182 at Core/Src/main.c:141 +### Threads ######################################################################################################### +[1] id 0 from 0x080014f6 in main+182 at Core/Src/main.c:141 +### Variables ####################################################################################################### +loc ret = 8, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014f8 +halted: PC: 0x080014fc +halted: PC: 0x080014fe +halted: PC: 0x08001500 +halted: PC: 0x08003d62 +halted: PC: 0x08001508 +143 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 + 0x080014fc main+188 add r1, sp, #8 + 0x080014fe main+190 ldr r0, [pc, #12] ; (0x800150c ) + 0x08001500 main+192 bl 0x8003d62 + 0x08001504 main+196 strb.w r0, [sp, #7] + 0x08001508 main+200 movs r4, #0 + 0x0800150a main+202 b.n 0x80014d4 + 0x0800150c main+204 lsrs r4, r2, #12 + 0x0800150e main+206 movs r0, #0 + 0x08001510 main+208 asrs r5, r6, #4 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:141 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$0 = +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000002 r5 0x200009c8 r10 0x00000000 pc 0x08001508 primask 0x00 + r1 0x2000fef0 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000100 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x00000022 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x08001505 psp 0x00000000 +### Source ########################################################################################################## + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 volatile HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 50); + 142 + 143 for (int ind = 0; ind < 20; ind++) + 144 { + 145 p_uart_async_write_byte(rxb[ind]); + 146 } + 147 PDEBUG("\n\n\n\n"); + 148 memset(rxb, 0, 256); + 149 p_serial_mgr_start(); + 150 } + 151 // if (b_timer_struck) + 152 // { +### Stack ########################################################################################################### +[0] from 0x08001508 in main+200 at Core/Src/main.c:143 +### Threads ######################################################################################################### +[1] id 0 from 0x08001508 in main+200 at Core/Src/main.c:143 +### Variables ####################################################################################################### +loc ind = 0, ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +$2 = HAL_BUSY +Quit +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9668 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009828 +Loading section .ARM, size 0x8 lma 0x8009ca8 +Loading section .init_array, size 0x8 lma 0x8009cb0 +Loading section .fini_array, size 0x8 lma 0x8009cb8 +Loading section .data, size 0x9a8 lma 0x8009cc0 +Start address 0x0800427c, load size 42552 +Transfer rate: 29 KB/sec, 4728 bytes/write. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 1, main () at Core/Src/main.c:141 +141 volatile HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 1000); +### Assembly ######################################################################################################## + 0x080014e6 main+166 bl 0x8004318 + 0x080014ea main+170 bl 0x800424c + 0x080014ee main+174 bl 0x8004240 + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee +!0x080014f6 main+182 mov.w r3, #1000 ; 0x3e8 + 0x080014fa main+186 mov.w r2, #256 ; 0x100 + 0x080014fe main+190 add r1, sp, #8 + 0x08001500 main+192 ldr r0, [pc, #12] ; (0x8001510 ) + 0x08001502 main+194 bl 0x8003d66 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:141 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = +$$0 = HAL_BUSY +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000001 r5 0x200009c8 r10 0x00000000 pc 0x080014f6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x2000fff0 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 131 uint16_t motor_degrees = 0; + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 volatile HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 1000); + 142 + 143 for (int ind = 0; ind < 20; ind++) + 144 { + 145 p_uart_async_write_byte(rxb[ind]); + 146 } + 147 PDEBUG("\n\n\n\n"); + 148 memset(rxb, 0, 256); + 149 p_serial_mgr_start(); + 150 } +### Stack ########################################################################################################### +[0] from 0x080014f6 in main+182 at Core/Src/main.c:141 +### Threads ######################################################################################################### +[1] id 0 from 0x080014f6 in main+182 at Core/Src/main.c:141 +### Variables ####################################################################################################### +loc ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014fa +halted: PC: 0x080014fe +halted: PC: 0x08001500 +halted: PC: 0x08001502 +halted: PC: 0x08003d66 +halted: PC: 0x0800150a +143 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014fa main+186 mov.w r2, #256 ; 0x100 + 0x080014fe main+190 add r1, sp, #8 + 0x08001500 main+192 ldr r0, [pc, #12] ; (0x8001510 ) + 0x08001502 main+194 bl 0x8003d66 + 0x08001506 main+198 strb.w r0, [sp, #7] + 0x0800150a main+202 movs r4, #0 + 0x0800150c main+204 b.n 0x80014d4 + 0x0800150e main+206 nop + 0x08001510 main+208 lsrs r4, r2, #12 + 0x08001512 main+210 movs r0, #0 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:141 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = +$$0 = HAL_BUSY +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000002 r5 0x200009c8 r10 0x00000000 pc 0x0800150a primask 0x00 + r1 0x2000fef0 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x00000100 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x00000022 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x08001507 psp 0x00000000 +### Source ########################################################################################################## + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { +!141 volatile HAL_StatusTypeDef ret = HAL_UART_Receive(&huart2, rxb, 256, 1000); + 142 + 143 for (int ind = 0; ind < 20; ind++) + 144 { + 145 p_uart_async_write_byte(rxb[ind]); + 146 } + 147 PDEBUG("\n\n\n\n"); + 148 memset(rxb, 0, 256); + 149 p_serial_mgr_start(); + 150 } + 151 // if (b_timer_struck) + 152 // { +### Stack ########################################################################################################### +[0] from 0x0800150a in main+202 at Core/Src/main.c:143 +### Threads ######################################################################################################### +[1] id 0 from 0x0800150a in main+202 at Core/Src/main.c:143 +### Variables ####################################################################################################### +loc ind = 0, ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +`/storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf' has changed; re-reading symbols. +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9668 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009828 +Loading section .ARM, size 0x8 lma 0x8009ca8 +Loading section .init_array, size 0x8 lma 0x8009cb0 +Loading section .fini_array, size 0x8 lma 0x8009cb8 +Loading section .data, size 0x9a8 lma 0x8009cc0 +Start address 0x08004280, load size 42552 +Transfer rate: 29 KB/sec, 4728 bytes/write. +Starting program: /storage/Shared/Projects/Penguinator/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 1, main () at Core/Src/main.c:142 +142 while ((ret = HAL_UART_Receive(&huart2, rxb, 256, 1000)) != HAL_BUSY) +### Assembly ######################################################################################################## + 0x080014e6 main+166 bl 0x800431c + 0x080014ea main+170 bl 0x8004250 + 0x080014ee main+174 bl 0x8004244 + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee +!0x080014f6 main+182 mov.w r3, #1000 ; 0x3e8 + 0x080014fa main+186 mov.w r2, #256 ; 0x100 + 0x080014fe main+190 add r1, sp, #8 + 0x08001500 main+192 ldr r0, [pc, #16] ; (0x8001514 ) + 0x08001502 main+194 bl 0x8003d6a +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:142 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = +$$0 = HAL_BUSY +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000001 r5 0x200009c8 r10 0x00000000 pc 0x080014f6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x2000fff0 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x20000b14 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; +!142 while ((ret = HAL_UART_Receive(&huart2, rxb, 256, 1000)) != HAL_BUSY) + 143 ; + 144 + 145 for (int ind = 0; ind < 20; ind++) + 146 { + 147 p_uart_async_write_byte(rxb[ind]); + 148 } + 149 PDEBUG("\n\n\n\n"); + 150 memset(rxb, 0, 256); + 151 p_serial_mgr_start(); +### Stack ########################################################################################################### +[0] from 0x080014f6 in main+182 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x080014f6 in main+182 at Core/Src/main.c:142 +### Variables ####################################################################################################### +loc ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014fa +halted: PC: 0x080014fe +halted: PC: 0x08001500 +halted: PC: 0x08001502 +halted: PC: 0x08003d6a +halted: PC: 0x0800150a +halted: PC: 0x0800150c +halted: PC: 0x0800150e +halted: PC: 0x08001510 +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +147 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #8] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #12 + 0x080014c4 main+132 bl 0x800431c + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 add r3, sp, #8 + 0x080014cc main+140 ldrb r0, [r3, r4] + 0x080014ce main+142 bl 0x80041e4 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:142 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = +$$0 = HAL_BUSY +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000002 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x2000fef0 r6 0x00000000 r11 0x00000000 xPSR 0x81000000 basepri 0x00 + r2 0x00000100 r7 0x00000000 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x00000022 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x08001507 psp 0x00000000 +### Source ########################################################################################################## + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; +!142 while ((ret = HAL_UART_Receive(&huart2, rxb, 256, 1000)) != HAL_BUSY) + 143 ; + 144 + 145 for (int ind = 0; ind < 20; ind++) + 146 { + 147 p_uart_async_write_byte(rxb[ind]); + 148 } + 149 PDEBUG("\n\n\n\n"); + 150 memset(rxb, 0, 256); + 151 p_serial_mgr_start(); + 152 } + 153 // if (b_timer_struck) + 154 // { + 155 // // PDEBUG("%d\n", sys_time); + 156 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:147 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:147 +### Variables ####################################################################################################### +loc ind = 0, ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014cc +halted: PC: 0x080014ce +halted: PC: 0x080041e4 +145 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014c4 main+132 bl 0x800431c + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 add r3, sp, #8 + 0x080014cc main+140 ldrb r0, [r3, r4] + 0x080014ce main+142 bl 0x80041e4 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca + 0x080014d8 main+152 ldr r0, [pc, #80] ; (0x800152c ) + 0x080014da main+154 bl 0x8004168 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:142 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = +$$0 = HAL_BUSY +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014d2 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009899 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000000 r9 0x00000000 lr 0x08003bef psp 0x00000000 +### Source ########################################################################################################## + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; +!142 while ((ret = HAL_UART_Receive(&huart2, rxb, 256, 1000)) != HAL_BUSY) + 143 ; + 144 + 145 for (int ind = 0; ind < 20; ind++) + 146 { + 147 p_uart_async_write_byte(rxb[ind]); + 148 } + 149 PDEBUG("\n\n\n\n"); + 150 memset(rxb, 0, 256); + 151 p_serial_mgr_start(); + 152 } + 153 // if (b_timer_struck) + 154 // { +### Stack ########################################################################################################### +[0] from 0x080014d2 in main+146 at Core/Src/main.c:145 +### Threads ######################################################################################################### +[1] id 0 from 0x080014d2 in main+146 at Core/Src/main.c:145 +### Variables ####################################################################################################### +loc ind = 0, ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +147 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #8] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #12 + 0x080014c4 main+132 bl 0x800431c + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 add r3, sp, #8 + 0x080014cc main+140 ldrb r0, [r3, r4] + 0x080014ce main+142 bl 0x80041e4 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:142 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = +$$0 = HAL_BUSY +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009899 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000001 r9 0x00000000 lr 0x08003bef psp 0x00000000 +### Source ########################################################################################################## + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; +!142 while ((ret = HAL_UART_Receive(&huart2, rxb, 256, 1000)) != HAL_BUSY) + 143 ; + 144 + 145 for (int ind = 0; ind < 20; ind++) + 146 { + 147 p_uart_async_write_byte(rxb[ind]); + 148 } + 149 PDEBUG("\n\n\n\n"); + 150 memset(rxb, 0, 256); + 151 p_serial_mgr_start(); + 152 } + 153 // if (b_timer_struck) + 154 // { + 155 // // PDEBUG("%d\n", sys_time); + 156 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:147 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:147 +### Variables ####################################################################################################### +loc ind = 1, ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014cc +halted: PC: 0x080014ce +halted: PC: 0x080041e4 +145 for (int ind = 0; ind < 20; ind++) +### Assembly ######################################################################################################## + 0x080014c4 main+132 bl 0x800431c + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 add r3, sp, #8 + 0x080014cc main+140 ldrb r0, [r3, r4] + 0x080014ce main+142 bl 0x80041e4 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 + 0x080014d6 main+150 ble.n 0x80014ca + 0x080014d8 main+152 ldr r0, [pc, #80] ; (0x800152c ) + 0x080014da main+154 bl 0x8004168 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:142 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = +$$0 = HAL_BUSY +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014d2 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x210f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009899 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000001 r9 0x00000000 lr 0x08003bef psp 0x00000000 +### Source ########################################################################################################## + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; +!142 while ((ret = HAL_UART_Receive(&huart2, rxb, 256, 1000)) != HAL_BUSY) + 143 ; + 144 + 145 for (int ind = 0; ind < 20; ind++) + 146 { + 147 p_uart_async_write_byte(rxb[ind]); + 148 } + 149 PDEBUG("\n\n\n\n"); + 150 memset(rxb, 0, 256); + 151 p_serial_mgr_start(); + 152 } + 153 // if (b_timer_struck) + 154 // { +### Stack ########################################################################################################### +[0] from 0x080014d2 in main+146 at Core/Src/main.c:145 +### Threads ######################################################################################################### +[1] id 0 from 0x080014d2 in main+146 at Core/Src/main.c:145 +### Variables ####################################################################################################### +loc ind = 1, ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014d4 +halted: PC: 0x080014d6 +halted: PC: 0x080014ca +147 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #8] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #12 + 0x080014c4 main+132 bl 0x800431c + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 add r3, sp, #8 + 0x080014cc main+140 ldrb r0, [r3, r4] + 0x080014ce main+142 bl 0x80041e4 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 +### Breakpoints ##################################################################################################### +[1] break at 0x080014f6 in Core/Src/main.c:142 for /storage/Shared/Projects/Penguinator/motor_controller/Core/Src/main.c:141 hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +$$1 = +$$0 = HAL_BUSY +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009899 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000002 r9 0x00000000 lr 0x08003bef psp 0x00000000 +### Source ########################################################################################################## + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; +!142 while ((ret = HAL_UART_Receive(&huart2, rxb, 256, 1000)) != HAL_BUSY) + 143 ; + 144 + 145 for (int ind = 0; ind < 20; ind++) + 146 { + 147 p_uart_async_write_byte(rxb[ind]); + 148 } + 149 PDEBUG("\n\n\n\n"); + 150 memset(rxb, 0, 256); + 151 p_serial_mgr_start(); + 152 } + 153 // if (b_timer_struck) + 154 // { + 155 // // PDEBUG("%d\n", sys_time); + 156 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:147 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:147 +### Variables ####################################################################################################### +loc ind = 2, ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +$3 = HAL_BUSY +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 p_uart_async_write_byte(rxb[ind]); +### Assembly ######################################################################################################## + 0x080014be main+126 str r1, [sp, #8] + 0x080014c0 main+128 movs r2, #252 ; 0xfc + 0x080014c2 main+130 add r0, sp, #12 + 0x080014c4 main+132 bl 0x800431c + 0x080014c8 main+136 b.n 0x80014ee + 0x080014ca main+138 add r3, sp, #8 + 0x080014cc main+140 ldrb r0, [r3, r4] + 0x080014ce main+142 bl 0x80041e4 + 0x080014d2 main+146 adds r4, #1 + 0x080014d4 main+148 cmp r4, #19 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ca primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x810f0000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x08009899 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000002 r9 0x00000000 lr 0x08003bef psp 0x00000000 +### Source ########################################################################################################## + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; + 142 while ((ret = HAL_UART_Receive(&huart2, rxb, 256, 1000)) != HAL_BUSY) {} + 143 + 144 for (int ind = 0; ind < 20; ind++) + 145 { + 146 p_uart_async_write_byte(rxb[ind]); + 147 } + 148 PDEBUG("\n\n\n\n"); + 149 memset(rxb, 0, 256); + 150 p_serial_mgr_start(); + 151 } + 152 // if (b_timer_struck) + 153 // { + 154 // // PDEBUG("%d\n", sys_time); + 155 // b_timer_struck = false; +### Stack ########################################################################################################### +[0] from 0x080014ca in main+138 at Core/Src/main.c:146 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ca in main+138 at Core/Src/main.c:146 +### Variables ####################################################################################################### +loc ind = 2, ret = HAL_BUSY, rxb = '\000' +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9668 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009828 +Loading section .ARM, size 0x8 lma 0x8009ca8 +Loading section .init_array, size 0x8 lma 0x8009cb0 +Loading section .fini_array, size 0x8 lma 0x8009cb8 +Loading section .data, size 0x9a8 lma 0x8009cc0 +Start address 0x08004280, load size 42552 +Transfer rate: 29 KB/sec, 4728 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:139 +139 if (p_serial_mgr_service()) +### Assembly ######################################################################################################## + 0x080014de main+158 mov.w r2, #256 ; 0x100 + 0x080014e2 main+162 movs r1, #0 + 0x080014e4 main+164 add r0, sp, #8 + 0x080014e6 main+166 bl 0x800431c + 0x080014ea main+170 bl 0x8004250 + 0x080014ee main+174 bl 0x8004244 + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee + 0x080014f6 main+182 mov.w r3, #1000 ; 0x3e8 + 0x080014fa main+186 mov.w r2, #256 ; 0x100 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ee primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40013800 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 129 p_serial_mgr_start(); + 130 + 131 uint16_t motor_degrees = 0; + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; + 142 while ((ret = HAL_UART_Receive(&huart1, rxb, 256, 1000)) != HAL_BUSY) {} + 143 + 144 for (int ind = 0; ind < 20; ind++) + 145 { + 146 p_uart_async_write_byte(rxb[ind]); + 147 } + 148 PDEBUG("\n\n\n\n"); +### Stack ########################################################################################################### +[0] from 0x080014ee in main+174 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ee in main+174 at Core/Src/main.c:139 +### Variables ####################################################################################################### +loc rxb = '\000' +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9668 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009828 +Loading section .ARM, size 0x8 lma 0x8009ca8 +Loading section .init_array, size 0x8 lma 0x8009cb0 +Loading section .fini_array, size 0x8 lma 0x8009cb8 +Loading section .data, size 0x9a8 lma 0x8009cc0 +Start address 0x08004280, load size 42552 +Transfer rate: 29 KB/sec, 4728 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] +0x08003c04 in UART_WaitOnFlagUntilTimeout (huart=0x20000a60 , Flag=32, Status=, Tickstart=31862, Timeout=1000) at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3558 +3558 if (__HAL_UART_GET_FLAG(huart, UART_FLAG_RTOF) == SET) +### Assembly ######################################################################################################## + 0x08003bf6 UART_WaitOnFlagUntilTimeout+60 cmp.w r8, #0 + 0x08003bfa UART_WaitOnFlagUntilTimeout+64 beq.n 0x8003c52 + 0x08003bfc UART_WaitOnFlagUntilTimeout+66 ldr r3, [r5, #0] + 0x08003bfe UART_WaitOnFlagUntilTimeout+68 ldr r2, [r3, #0] + 0x08003c00 UART_WaitOnFlagUntilTimeout+70 tst.w r2, #4 + 0x08003c04 UART_WaitOnFlagUntilTimeout+74 beq.n 0x8003bd2 + 0x08003c06 UART_WaitOnFlagUntilTimeout+76 ldr r2, [r3, #28] + 0x08003c08 UART_WaitOnFlagUntilTimeout+78 tst.w r2, #2048 ; 0x800 + 0x08003c0c UART_WaitOnFlagUntilTimeout+82 beq.n 0x8003bd2 + 0x08003c0e UART_WaitOnFlagUntilTimeout+84 mov.w r2, #2048 ; 0x800 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000016 r5 0x20000a60 r10 0x00000000 pc 0x08003c04 primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x21000000 basepri 0x00 + r2 0x0000000d r7 0x00000020 r12 0x0000000c fpscr 0x00000010 faultmask 0x00 + r3 0x40013800 r8 0x000003e8 sp 0x2000fea0 msp 0x2000fea0 control 0x04 + r4 0x00000000 r9 0x00007c76 lr 0x08003bef psp 0x00000000 +### Source ########################################################################################################## + 3548 huart->gState = HAL_UART_STATE_READY; + 3549 huart->RxState = HAL_UART_STATE_READY; + 3550 + 3551 __HAL_UNLOCK(huart); + 3552 + 3553 return HAL_TIMEOUT; + 3554 } + 3555 + 3556 if (READ_BIT(huart->Instance->CR1, USART_CR1_RE) != 0U) + 3557 { + 3558 if (__HAL_UART_GET_FLAG(huart, UART_FLAG_RTOF) == SET) + 3559 { + 3560 /* Clear Receiver Timeout flag*/ + 3561 __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_RTOF); + 3562 + 3563 /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) + 3564 interrupts for the interrupt process */ + 3565 #if defined(USART_CR1_FIFOEN) + 3566 ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE_RXFNEIE | USART_CR1_PEIE | + 3567 USART_CR1_TXEIE_TXFNFIE)); +### Stack ########################################################################################################### +[0] from 0x08003c04 in UART_WaitOnFlagUntilTimeout+74 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3558 +[1] from 0x08003e58 in HAL_UART_Receive+246 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:1297 +[2] from 0x08001506 in main+198 at Core/Src/main.c:142 +### Threads ######################################################################################################### +[1] id 0 from 0x08003c04 in UART_WaitOnFlagUntilTimeout+74 at Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c:3558 +### Variables ####################################################################################################### +arg huart = 0x20000a60 : {Instance = 0x40013800,Init = {BaudRate = 115200,WordLength = 0,StopBi…, Flag = 32, Status = , Tickstart = 31862, Timeout = 1000 +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9660 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009820 +Loading section .ARM, size 0x8 lma 0x8009ca0 +Loading section .init_array, size 0x8 lma 0x8009ca8 +Loading section .fini_array, size 0x8 lma 0x8009cb0 +Loading section .data, size 0x9a8 lma 0x8009cb8 +Start address 0x08004278, load size 42544 +Transfer rate: 29 KB/sec, 4727 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:139 +139 if (p_serial_mgr_service()) +### Assembly ######################################################################################################## + 0x080014de main+158 mov.w r2, #256 ; 0x100 + 0x080014e2 main+162 movs r1, #0 + 0x080014e4 main+164 add r0, sp, #8 + 0x080014e6 main+166 bl 0x8004314 + 0x080014ea main+170 bl 0x8004248 + 0x080014ee main+174 bl 0x800423c + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee + 0x080014f6 main+182 movs r3, #50 ; 0x32 + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ee primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40013800 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 129 p_serial_mgr_start(); + 130 + 131 uint16_t motor_degrees = 0; + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; + 142 ret = HAL_UART_Receive(&huart1, rxb, 256, 1); + 143 + 144 for (int ind = 0; ind < 20; ind++) + 145 { + 146 p_uart_async_write_byte(rxb[ind]); + 147 } + 148 PDEBUG("\n\n\n\n"); +### Stack ########################################################################################################### +[0] from 0x080014ee in main+174 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ee in main+174 at Core/Src/main.c:139 +### Variables ####################################################################################################### +loc rxb = '\000' +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9660 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009820 +Loading section .ARM, size 0x8 lma 0x8009ca0 +Loading section .init_array, size 0x8 lma 0x8009ca8 +Loading section .fini_array, size 0x8 lma 0x8009cb0 +Loading section .data, size 0x9a8 lma 0x8009cb8 +Start address 0x08004278, load size 42544 +Transfer rate: 29 KB/sec, 4727 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] +0x0800423e in p_serial_mgr_service () at shared/drivers/p_serial_mgr.c:53 +53 return b_go; +### Assembly ######################################################################################################## +~ +~ +~ +~ + 0x0800423c p_serial_mgr_service+0 ldr r3, [pc, #4] ; (0x8004244 ) + 0x0800423e p_serial_mgr_service+2 ldrb r0, [r3, #0] + 0x08004240 p_serial_mgr_service+4 bx lr + 0x08004242 p_serial_mgr_service+6 nop + 0x08004244 p_serial_mgr_service+8 lsrs r0, r5, #15 + 0x08004246 p_serial_mgr_service+10 movs r0, #0 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x0800423e primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40013800 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 43 bool p_serial_mgr_service(void) + 44 { + 45 // // this will be less garbage when i switch to a queue + 46 // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + 47 // { + 48 // if (serial_pkt_cb.buffer[ind].b_ready) + 49 // { + 50 // return &serial_pkt_cb.buffer[ind]; + 51 // } + 52 // } + 53 return b_go; + 54 } + 55 + 56 void p_serial_mgr_start() + 57 { + 58 b_go = false; + 59 HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); + 60 } +~ +~ +### Stack ########################################################################################################### +[0] from 0x0800423e in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:53 +[1] from 0x080014f2 in main+178 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x0800423e in p_serial_mgr_service+2 at shared/drivers/p_serial_mgr.c:53 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9660 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009820 +Loading section .ARM, size 0x8 lma 0x8009ca0 +Loading section .init_array, size 0x8 lma 0x8009ca8 +Loading section .fini_array, size 0x8 lma 0x8009cb0 +Loading section .data, size 0x9a8 lma 0x8009cb8 +Start address 0x08004278, load size 42544 +Transfer rate: 29 KB/sec, 4727 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:139 +139 if (p_serial_mgr_service()) +### Assembly ######################################################################################################## + 0x080014de main+158 mov.w r2, #256 ; 0x100 + 0x080014e2 main+162 movs r1, #0 + 0x080014e4 main+164 add r0, sp, #8 + 0x080014e6 main+166 bl 0x8004314 + 0x080014ea main+170 bl 0x8004248 + 0x080014ee main+174 bl 0x800423c + 0x080014f2 main+178 cmp r0, #0 + 0x080014f4 main+180 beq.n 0x80014ee + 0x080014f6 main+182 movs r3, #10 + 0x080014f8 main+184 mov.w r2, #256 ; 0x100 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200009c8 r10 0x00000000 pc 0x080014ee primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40013800 r7 0x00000000 r12 0x00000000 fpscr 0x00000010 faultmask 0x00 + r3 0x20000be8 r8 0x00000000 sp 0x2000fee8 msp 0x2000fee8 control 0x04 + r4 0x00000014 r9 0x00000000 lr 0x080014f3 psp 0x00000000 +### Source ########################################################################################################## + 129 p_serial_mgr_start(); + 130 + 131 uint16_t motor_degrees = 0; + 132 /* USER CODE END 2 */ + 133 + 134 /* Infinite loop */ + 135 /* USER CODE BEGIN WHILE */ + 136 uint8_t rxb[256] = {0}; + 137 while (1) + 138 { + 139 if (p_serial_mgr_service()) + 140 { + 141 volatile HAL_StatusTypeDef ret; + 142 ret = HAL_UART_Receive(&huart1, rxb, 256, 5); + 143 + 144 for (int ind = 0; ind < 20; ind++) + 145 { + 146 p_uart_async_write_byte(rxb[ind]); + 147 } + 148 PDEBUG("\n\n\n\n"); +### Stack ########################################################################################################### +[0] from 0x080014ee in main+174 at Core/Src/main.c:139 +### Threads ######################################################################################################### +[1] id 0 from 0x080014ee in main+174 at Core/Src/main.c:139 +### Variables ####################################################################################################### +loc rxb = '\000' +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x9660 lma 0x80001c0 +Loading section .rodata, size 0x480 lma 0x8009820 +Loading section .ARM, size 0x8 lma 0x8009ca0 +Loading section .init_array, size 0x8 lma 0x8009ca8 +Loading section .fini_array, size 0x8 lma 0x8009cb0 +Loading section .data, size 0x9a8 lma 0x8009cb8 +Start address 0x08004278, load size 42544 +Transfer rate: 29 KB/sec, 4727 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] diff --git a/shared/drivers/p_serial_mgr.c b/shared/drivers/p_serial_mgr.c index a5f3fb9..8bb64ab 100644 --- a/shared/drivers/p_serial_mgr.c +++ b/shared/drivers/p_serial_mgr.c @@ -26,144 +26,35 @@ typedef enum serial_state_t } serial_state_t; static UART_HandleTypeDef *_serial_huart_inst = NULL; -static serial_state_t sstate = SS_IDLE; -static uint8_t rxc = '\0'; - -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; - -#pragma message(Reminder "Move away from cirular buffer to a managed queue") +static uint8_t rxc = '\0'; +static bool b_go = false; void UART1_RxCpltCallback(UART_HandleTypeDef *huart) { - switch (sstate) - { - case SS_IDLE: // packet start - { - if (rxc == 0x7E) - { - sstate = SS_START; - } - } - break; - case SS_START: - { - switch (start_index_tracker) - { - 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: - { - 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 - asm volatile("nop"); - } - }; - } - break; - case SS_FRAME: - { - 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) - { - sstate = SS_ESC; - } - else - { - serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc; - if (frame_index_tracker >= serial_pkt_cb.buffer[serial_pkt_cb.head].len) - { - sstate = SS_CHECKSUM; - } - } - } - break; - case SS_ESC: - { - serial_pkt_cb.buffer[serial_pkt_cb.head].frame_data[frame_index_tracker++] = rxc ^ 0x20; - 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: - { - PDEBUG("Shouldn't have hit this!\n"); - } - }; - HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); - // serial_cb.push(&serial_cb, serial_cb_rxc); - // HAL_GPIO_WritePin(USART1_DE_GPIO_Port, USART1_DE_Pin, 1); - // huart2_rxc = huart1_rxc; - - // HAL_UART_Transmit(&huart2, &huart2_rxc, 1, 500); - // HAL_UART_Receive_IT(&huart1, &huart1_rxc, 1); - // HAL_GPIO_WritePin(USART1_DE_GPIO_Port, USART1_DE_Pin, 0); + b_go = true; } 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); + b_go = false; } -serial_pkt_t *p_serial_mgr_service(void) +bool p_serial_mgr_service(void) { - // this will be less garbage when i switch to a queue - for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) - { - if (serial_pkt_cb.buffer[ind].b_ready) - { - return &serial_pkt_cb.buffer[ind]; - } - } - return NULL; + // // this will be less garbage when i switch to a queue + // for (int ind = 0; ind < serial_pkt_cb.max_len; ind++) + // { + // if (serial_pkt_cb.buffer[ind].b_ready) + // { + // return &serial_pkt_cb.buffer[ind]; + // } + // } + return b_go; } void p_serial_mgr_start() { + b_go = false; HAL_UART_Receive_IT(_serial_huart_inst, &rxc, 1); } diff --git a/shared/drivers/p_serial_mgr.h b/shared/drivers/p_serial_mgr.h index 3d09ca0..5a3b66b 100644 --- a/shared/drivers/p_serial_mgr.h +++ b/shared/drivers/p_serial_mgr.h @@ -16,7 +16,7 @@ typedef struct serial_pkt_t void p_serial_mgr_init(UART_HandleTypeDef *huart); -serial_pkt_t *p_serial_mgr_service(void); +bool p_serial_mgr_service(void); void p_serial_mgr_start(); diff --git a/shared/util/PCircularBuffer.c b/shared/util/PCircularBuffer.c index a08199f..121d6a9 100644 --- a/shared/util/PCircularBuffer.c +++ b/shared/util/PCircularBuffer.c @@ -109,14 +109,12 @@ PB_CB_STATUS p_cb_serial_pkt_init(p_cb_serial_pkt_t *inst, serial_pkt_t *buff, u PB_CB_STATUS ret = PB_CB_GOOD; do { - // Make sure the buffer isn't bad (null) if (!buff) { ret = PB_CB_NULL_BUFFER; break; } - // Make sure the max buffer is a useable size if (max_length > PB_CB_MAX_BUFFER_SIZE || max_length <= 0) { ret = PB_CB_BAD_BUFFER_SIZE; @@ -126,6 +124,12 @@ PB_CB_STATUS p_cb_serial_pkt_init(p_cb_serial_pkt_t *inst, serial_pkt_t *buff, u { memset(inst->buffer[ind].frame_data, 0, 256); } + inst->buffer = buff; + inst->max_len = (uint16_t)max_length; + inst->head = 0; + inst->push = p_cb_serial_pkt_push; + inst->empty = p_cb_serial_pkt_empty; + inst->empty(inst); } while (0); // Debugging diff --git a/shared/util/PCircularBuffer.h b/shared/util/PCircularBuffer.h index eff2410..81797c5 100644 --- a/shared/util/PCircularBuffer.h +++ b/shared/util/PCircularBuffer.h @@ -80,8 +80,8 @@ typedef struct p_cb_serial_pkt_t // Useful for knowing if data is being received bool b_empty; - PB_CB_STATUS (*push)(struct p_cb_u8 *cbuffer, uint8_t value); - PB_CB_STATUS (*empty)(struct p_cb_u8 *cbuffer); + PB_CB_STATUS (*push)(struct p_cb_serial_pkt_t *cbuffer, serial_pkt_t value); + PB_CB_STATUS (*empty)(struct p_cb_serial_pkt_t *cbuffer); } p_cb_serial_pkt_t; PB_CB_STATUS p_cb_serial_pkt_init(p_cb_serial_pkt_t *inst, serial_pkt_t *buff, uint32_t max_length); diff --git a/shared/util/putil.c b/shared/util/putil.c index 67983f5..07637b5 100644 --- a/shared/util/putil.c +++ b/shared/util/putil.c @@ -1,13 +1,14 @@ #include "putil.h" -#include #include +#include #include #define MAX_PRINTF_BUFFER (256) -UART_HandleTypeDef* huart_inst = NULL; +UART_HandleTypeDef *huart_inst = NULL; -int p_printf(const char* fmt, ...) +static char send[10] = {'\0'}; +int p_printf(const char *fmt, ...) { size_t size_str = strlen(fmt); if (size_str >= MAX_PRINTF_BUFFER) @@ -18,16 +19,19 @@ int p_printf(const char* fmt, ...) memset(printf_buffer, '\0', MAX_PRINTF_BUFFER); va_list args; va_start(args, fmt); - vsprintf((char*)printf_buffer, fmt, args); + vsprintf((char *)printf_buffer, fmt, args); va_end(args); HAL_UART_Transmit(huart_inst, printf_buffer, strlen(printf_buffer), 100); return 0; - - } -void p_uart_init(UART_HandleTypeDef* huart) +void p_uart_init(UART_HandleTypeDef *huart) { huart_inst = huart; PDEBUG("...\n"); PDEBUG("UART2 Initialized\n"); } +void p_uart_async_write_byte(uint8_t byte) +{ + sprintf(send, "%02x\n", byte); + HAL_UART_Transmit(huart_inst, send, 3, 100); +} diff --git a/shared/util/putil.h b/shared/util/putil.h index 16b74c0..ad0df62 100644 --- a/shared/util/putil.h +++ b/shared/util/putil.h @@ -5,6 +5,7 @@ int p_printf(const char *fmt, ...); void p_uart_init(UART_HandleTypeDef *huart); +void p_uart_async_write_byte(uint8_t byte); #define Stringize(L) #L #define MakeString(M, L) M(L)