CAP1Sup / Intellistep

A rework of the terribly coded firmware from the BTT S42B v2 boards
GNU General Public License v3.0
45 stars 10 forks source link

HAlL_GetTick() returns 0, causing endless loop #122

Open jlmxyz opened 2 years ago

jlmxyz commented 2 years ago

the call stack :

HAL_SPI_TransmitReceive@0x080023fc (/home/jlm/.platformio/packages/framework-arduinoststm32/system/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c:1304)
Encoder::readRegister@0x080050c6 (/home/jlm/crypt/Devel/3Dprinter/Intellistep-clean/src/hardware/encoder.cpp:241)
Encoder::getRawRev@0x080051b2 (/home/jlm/crypt/Devel/3Dprinter/Intellistep-clean/src/hardware/encoder.cpp:849)
Encoder::Encoder@0x08005714 (/home/jlm/crypt/Devel/3Dprinter/Intellistep-clean/src/hardware/encoder.cpp:174)
StepperMotor::StepperMotor@0x080066be (/home/jlm/crypt/Devel/3Dprinter/Intellistep-clean/src/hardware/motor.cpp:12)
__static_initialization_and_destruction_0@0x080080da (/home/jlm/crypt/Devel/3Dprinter/Intellistep-clean/src/main/main.cpp:337)
_GLOBAL__sub_I_motor@0x08008128 (/home/jlm/crypt/Devel/3Dprinter/Intellistep-clean/src/main/main.cpp:337)
__libc_init_array@0x0800bb08 (/__libc_init_array.dbgasm:24)
Reset_Handler@0x08001262 (/home/jlm/.platformio/packages/framework-arduinoststm32/variants/STM32F1xx/F103C8T_F103CB(T-U)/startup_M200_f103xb.S:125)

from what I see, when HAL_GetTick() is called, it always return zero...

but on // I don't understand what cause the encoder not to success the readRegister(ENCODER_ANGLE_REV_REG)

only on s42bv2 hardware (works on s57bv2)

CAP1Sup commented 2 years ago

Hmm... try building the firmware with the 72 MHz system clock. See if that fixes the issue. Sometimes the 128 MHz clock is actually too fast for the silicon of the STM32... it was never meant to be able to clock that fast. It actually tells you not to, but I haven't had any issues so far and it has a major speed improvement over 72 MHz.

Sorry for the delay in responding, I just returned from Spain