Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Debugging

    • printf() does not work if you are using a ST-link v2 (blue usb adapter). This is because there is no SWO output pin, and thus we cannot create a SWV.

    • Error No ST-LINK with the specified serial number detected: sometimes a project is linked to a specific debugger serial number, and you can unlink it from the debug configuration menu.

  • MCU Configuration

    • Timer

      • No timer/DShot output

        • See latest working commit in firmware repository for valid configurations (specifically the .ioc file). The important parameters include: ARR/CCR, counter period, DMA (direction, mode, increment address, data width, ids), timer mode, timer tree (HSE output)

      • Inverted timer output: see PWM mode 1 vs PWM mode 2

    • CAN

      • CAN interrupt not triggering

        • Make sure CAN is initialized properly (HAL_CAN_*)

        • See latest working commit in firmware repository for valid configurations (specifically the .ioc file). The important parameters include:

          • NVIC CAN interrupt, GPIO pullup, prescaler, time quanta

  • Timing Issues

    • DShot output timing is off

      • The function for setting DShot throttle values needs to be called continuous in an infinite while loop, and any delay in between could affect time timing. At the time of writing, the current implementation exposes a global throttle value that gets changed whenever a CAN message is handled by the CAN interrupt. This way, the DShot function call in the continuous while look loop continues to run indefinitely.

      • There also needs to be a slight delay after calling the DShot write function each time it is called, currently the delay is set to 1000ms. Removing this delay causes unknown behavior in the DShot output.

  • ArduPilot not sending CAN messages

  • Motors not spinning with correct Dshot output

...