Troubleshooting
Common issues and solutions for the TMC9660 driver.
Bootloader Initialization Fails
Symptom
bootloaderInit() returns BootloaderInitResult::Failure
Solutions
- Check Hardware Reset
- Ensure RST pin is properly toggled
- Verify FAULTN pin monitoring during reset
- Wait at least 100ms after reset
- Verify Communication Interface
- Check SPI/UART wiring
- Verify CS pin (SPI) or TX/RX pins (UART)
- Confirm clock speed ≤ 4 MHz (SPI)
- Check Bootloader Configuration
1 2
// CRITICAL: Must set boot mode to Parameter cfg.boot.boot_mode = tmc9660::bootcfg::BootMode::Parameter;
- Verify Power Supply
- Ensure stable power to TMC9660
- Check voltage levels (12V-48V for motor supply)
No Reply from Device
Symptom
Communication timeouts, no response to commands
Solutions
- SPI Issues
- Verify MOSI/MISO not swapped
- Check CS pin polarity (active LOW)
- Confirm SPI mode (Mode 0 or 3)
- Reduce clock speed
- UART Issues
- Verify TX/RX pins not swapped
- Check baud rate matches configuration
- Ensure GPIO pins match bootloader config
- Try autobaud mode
- Check Connections
- Verify all connections are secure
- Check for loose wires
- Verify common ground
Motor Not Starting
Symptom
Motor configured but not rotating
Solutions
- Verify Bootloader Initialization
1 2 3
// Must initialize bootloader first cfg.boot.start_motor_control = true; auto result = driver.bootloaderInit(&cfg);
- Check Motor Configuration
1 2 3 4 5 6
// Verify motor type is set driver.motorConfig.setType(tmc9660::tmcl::MotorType::BLDC_MOTOR, 7); // Verify commutation mode driver.motorConfig.setCommutationMode( tmc9660::tmcl::CommutationMode::FOC_HALL);
- Check Current Limits
1 2
// Ensure current limits are set driver.motorConfig.setMaxTorqueCurrent(2000);
- Verify Target Values
1 2
// Set target velocity or torque driver.focControl.setTargetVelocity(1000);
Communication Errors
Symptom
CRC errors, checksum failures, invalid replies
Solutions
- Check Timing
- Add delays between commands
- Respect SPI delayed reply timing
- Wait for UART reply before next command
- Verify Protocol
- Check CRC/checksum calculation
- Verify frame format (8 bytes SPI, 9 bytes UART)
- Confirm address encoding
- Reduce Noise
- Use shorter cables
- Add pull-up/pull-down resistors
- Check for ground loops
Sensor Issues
Symptom
Hall sensors or encoder not working
Solutions
- Check Sensor Wiring
- Verify Hall sensor connections
- Check encoder A/B signals
- Confirm sensor power supply
- Verify Sensor Configuration
1 2 3 4 5
// For Hall sensors driver.feedbackSense.configureHall(); // For encoder driver.feedbackSense.configureABNEncoder(2048);
- Check Commutation Mode
1 2 3
// Must match sensor type driver.motorConfig.setCommutationMode( tmc9660::tmcl::CommutationMode::FOC_HALL); // or FOC_ENCODER
Protection Faults
Symptom
Overcurrent, undervoltage, or overtemperature faults
Solutions
- Check Current Limits
1 2
// Reduce current limits if overcurrent driver.motorConfig.setMaxTorqueCurrent(1500);
- Verify Power Supply
- Check voltage levels
- Ensure adequate current capacity
- Check for voltage drops
- Check Temperature
- Ensure adequate cooling
- Monitor temperature via telemetry
- Reduce load if overheating
Debugging Tips
- Enable Debug Logging
- Remove
TMC9660_DISABLE_DEBUG_LOGGINGdefine - Check serial output for detailed logs
- Remove
- Verify Communication
1 2 3 4 5
// Test basic communication auto version = driver.bootloaderGetVersion(); if (version.has_value()) { printf("Communication OK\n"); }
- Check Telemetry
1 2 3 4
// Monitor device status int16_t temp; driver.telemetry.getTemperature(temp); printf("Temperature: %d\n", temp);
Getting Help
- Check the Bootloader Initialization guide
- Review Platform Integration for interface issues
- See Examples for working code
- Consult the API Reference for method details