rs485 testing with max3070e. working

stable
Penguin 2 years ago
parent 25d46974e3
commit f4a88df448

@ -1,145 +1,3 @@
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
@ -254,3 +112,145 @@ p sbuffer[active_buffer][0]
c
p sbuffer[active_buffer][0]
q
q
q
b p_serial_mgr.c:35
r
p sbuffer[active_buffer][0]
p/x sbuffer[active_buffer][0]
c
p/x sbuffer[active_buffer][0]
c
s
s
p sstate
c
r
p/x sbuffer[active_buffer][0]
s
s
s
s
s
n
n
n
n
n
n
n
n
n
finish
s
s
s
c
r
del
b p_serial_mgr.c:52 if sstate == SS_START
r
b p_serial_mgr.c:53 if sstate == SS_START
r
n
n
finish
r
n
n
advance
advance 59
n
n
n
p active_buffer
n
c
q
b p_serial_mgr.c:35
r
p/x sbuffer[active_buffer][0]
c
p/x sbuffer[active_buffer][0]
s
s
s
s
s
s
n
advance 61
s
n
r
p/x sbuffer[active_buffer][0]
p/x sbuffer[active_buffer]
s
q
r
s
s
s
s
s
s
s
p sstate
q
r
s
s
s
s
s
s
s
p p_serial_mgr.c:41
b p_serial_mgr.c:41
r
p/x sbuffer[active_buffer][0]
c
c
del
b p_serial_mgr.c:73
r
n
q
b p_serial_mgr.c:73
r
n
n
c
n
c
q
b p_serial_mgr.c:82
r
s
make
load
r
s
b p_serial_mgr.c:83
del 1
r
p ret
c
p ret
c
make
load
del
b p_serial_mgr.c:83 if ret != HAL_OK
r
p _serial_huart_inst->RxState
p/x _serial_huart_inst->RxState
p/b _serial_huart_inst->RxState
p/o _serial_huart_inst->RxState
p/x _serial_huart_inst->RxState
q
b UART1RxCpltCallback
b UART1_RxCpltCallback
r
n
q

@ -119,15 +119,15 @@ int main(void)
// HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2);
// HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4);
// setPWM(&htim2, TIM_CHANNEL_2, 50);
// setPWM(&htim2, TIM_CHANNEL_4, 25);
setPWM(&htim2, TIM_CHANNEL_2, 50);
setPWM(&htim2, TIM_CHANNEL_4, 25);
HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1);
HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1);
// mc_init(&htim2);
mc_init(&htim2);
HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1);
// HAL_TIM_Base_Start_IT(&htim6);
HAL_TIM_Base_Start_IT(&htim6);
p_serial_mgr_start();
@ -431,7 +431,7 @@ static void MX_GPIO_Init(void)
void UART2_RxCpltCallback(UART_HandleTypeDef *huart)
{
HAL_UART_Transmit(&huart2, &huart2_rxc, 1, 100);
HAL_UART_Transmit(&huart1, &huart2_rxc, 1, 100);
HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1);
}
// void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)

@ -22,7 +22,7 @@ TARGET = motor_controller
# debug build?
DEBUG = 1
# optimization
OPT = -Og
OPT = -O0
#######################################
@ -71,7 +71,7 @@ startup_stm32l432xx.s
#######################################
# binaries
#######################################
PREFIX = arm-none-eabi-
PREFIX = /usr/bin/arm-none-eabi-
# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
# either it can be added to the PATH environment variable.
ifdef GCC_PATH

@ -1,7 +1,7 @@
[
{
"arguments": [
"arm-none-eabi-gcc",
"/usr/bin/arm-none-eabi-gcc",
"-c",
"-mcpu=cortex-m4",
"-mthumb",
@ -19,7 +19,7 @@
"-Ishared/drivers",
"-Ishared/util",
"-IPenguinBuffer",
"-Og",
"-O0",
"-Wall",
"-fdata-sections",
"-ffunction-sections",

@ -0,0 +1,975 @@
[
{
"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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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"
},
{
"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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-Wall",
"-fdata-sections",
"-ffunction-sections",
"-g3",
"-gdwarf-2",
"-D_DEBUG",
"-MFbuild/main.d",
"-Wa,-a,-ad,-alms=build/main.lst",
"-o",
"build/main.o",
"Core/Src/main.c"
],
"directory": "/storage/Shared/Projects/Penguinator/motor_controller",
"file": "Core/Src/main.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",
"-IPenguinBuffer",
"-O0",
"-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",
"-IPenguinBuffer",
"-O0",
"-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"
}
]

7628
gdb.txt

File diff suppressed because it is too large Load Diff

@ -1,5 +1,6 @@
#include "p_serial_mgr.h"
#include "putil.h"
#include "stm32l4xx_hal_def.h"
#include "stm32l4xx_hal_uart.h"
#define NUM_BUFFERS (10)
@ -23,6 +24,7 @@ typedef enum serial_state_t
{
SS_IDLE = 0, // waiting
SS_START = 1, // get start byte, interrupt after 4 more bytes
SS_ERR = 2
} serial_state_t;
static UART_HandleTypeDef *_serial_huart_inst = NULL;
@ -30,15 +32,22 @@ static UART_HandleTypeDef *_serial_huart_inst = NULL;
static uint8_t rxc = '\0';
static serial_state_t sstate = SS_IDLE;
static void p_serial_mgr_flush()
{
HAL_UART_Receive(_serial_huart_inst, sbuffer[active_buffer], MAX_MESSAGE_LEN, 10);
}
void UART1_RxCpltCallback(UART_HandleTypeDef *huart)
{
PDEBUG("%c", sbuffer[active_buffer][0]);
p_serial_mgr_start();
return;
if (sstate == SS_IDLE && sbuffer[active_buffer][0] == 0x7E)
{
sstate = SS_START;
}
else
{
HAL_UART_Receive_IT(_serial_huart_inst, sbuffer[active_buffer], 1);
sstate = SS_ERR;
}
}
@ -51,20 +60,28 @@ void p_serial_mgr_service(void)
{
if (sstate == SS_START)
{
HAL_UART_Receive(_serial_huart_inst, &sbuffer[active_buffer][1], MAX_MESSAGE_LEN, 10);
while (HAL_UART_Receive(_serial_huart_inst, &sbuffer[active_buffer][1], MAX_MESSAGE_LEN - 2, 20) != HAL_OK) {}
for (int ind = 0; ind < 24; ind++)
{
PDEBUG("[%d]: 0x%02x\n", ind, sbuffer[active_buffer][ind]);
}
PDEBUG("\n\n");
sstate = SS_IDLE;
memset(sbuffer[active_buffer], 0, MAX_MESSAGE_LEN);
active_buffer = (active_buffer + 1) % NUM_BUFFERS;
HAL_UART_Receive_IT(_serial_huart_inst, sbuffer[active_buffer], 1);
uint8_t sendbuffer[9] = {0x7E, DEVICE_ADDR, MASTER_ADDR, 4, 0x01, 0x02, 0x03, 0x04, 0xFF};
// HAL_UART_Transmit(_serial_huart_inst, sendbuffer, 9, 10);
p_serial_mgr_start();
}
else if (sstate == SS_ERR)
{
PDEBUG("MISSED BYTE 0x%02x\n", sbuffer[active_buffer][0]);
p_serial_mgr_start();
}
}
void p_serial_mgr_start()
{
sstate = SS_IDLE;
HAL_UART_Receive_IT(_serial_huart_inst, sbuffer[active_buffer], 1);
volatile HAL_StatusTypeDef ret = HAL_UART_Receive_IT(_serial_huart_inst, &sbuffer[active_buffer][0], 1);
asm volatile("nop");
}

Loading…
Cancel
Save