Go to file
Ethan Zonca 9fddea4ad1 Sanitize remote URL 2023-06-29 21:33:17 -04:00
Drivers Add missing files. Default to using the internal oscillator. 2020-04-14 21:49:42 -04:00
Middlewares/ST/STM32_USB_Device_Library Add data buffering: backport of major buffering features from g4: CAN TX buffering, CDC RX buffering. No USB TX buffering yet. 2021-02-21 13:03:27 -05:00
cube Increase flash latency to 1. This may have caused some previous intermittent issues. Increase USB buffer size to accomodate version string. Add fault ISRs for debugging. 2021-02-21 16:02:21 -05:00
inc Wait on USB TX busy instead of abort. Add error register reporting over USB. Update flash cmdline to leave bootloader after complete. 2023-01-21 14:56:37 -05:00
src Wait on USB TX busy instead of abort. Add error register reporting over USB. Update flash cmdline to leave bootloader after complete. 2023-01-21 14:56:37 -05:00
windows-driver added windows driver 2015-05-13 17:14:43 -04:00
.gitignore Add data buffering: backport of major buffering features from g4: CAN TX buffering, CDC RX buffering. No USB TX buffering yet. 2021-02-21 13:03:27 -05:00
.travis.yml added silent mode, moved GPIO init 2015-05-14 17:41:28 -04:00
LICENSE.md first commit 2015-01-14 10:09:08 -05:00
Makefile Sanitize remote URL 2023-06-29 21:33:17 -04:00
README.md Add data buffering: backport of major buffering features from g4: CAN TX buffering, CDC RX buffering. No USB TX buffering yet. 2021-02-21 13:03:27 -05:00
STM32F042C6_FLASH.ld first commit 2015-01-14 10:09:08 -05:00
stm32f0x.cfg first commit 2015-01-14 10:09:08 -05:00

README.md

CANable Firmware

This repository contains sources for the slcan CANable firmware, based off of the CANtact firwmare. This firmware may still compile and run on the CANtact.

Supported Commands

  • O - Open channel
  • C - Close channel
  • S0 - Set bitrate to 10k
  • S1 - Set bitrate to 20k
  • S2 - Set bitrate to 50k
  • S3 - Set bitrate to 100k
  • S4 - Set bitrate to 125k
  • S5 - Set bitrate to 250k
  • S6 - Set bitrate to 500k
  • S7 - Set bitrate to 750k
  • S8 - Set bitrate to 1M
  • M0 - Set mode to normal mode (default)
  • M1 - Set mode to silent mode
  • A0 - Disable automatic retransmission
  • A1 - Enable automatic retransmission (default)
  • TIIIIIIIILDD... - Transmit data frame (Extended ID) [ID, length, data]
  • tIIILDD... - Transmit data frame (Standard ID) [ID, length, data]
  • RIIIIIIIIL - Transmit remote frame (Extended ID) [ID, length]
  • rIIIL - Transmit remote frame (Standard ID) [ID, length]
  • V - Returns firmware version and remote path as a string

Note: Channel configuration commands must be sent before opening the channel. The channel must be opened before transmitting frames.

This firmware currently does not provide any ACK/NACK feedback for serial commands.

Building

Firmware builds with GCC. Specifically, you will need gcc-arm-none-eabi, which is packaged for Windows, OS X, and Linux on Launchpad. Download for your system and add the bin folder to your PATH.

Your Linux distribution may also have a prebuilt package for arm-none-eabi-gcc, check your distro's repositories to see if a build exists.

  • If you have a CANable device, you can compile using make.
  • If you have a CANtact or other device with external oscillator, you can compile using make INTERNAL_OSCILLATOR=1

Flashing with the Bootloader

Simply plug in your CANable with the BOOT jumper enabled (or depress the boot button on the CANable Pro while plugging in). Next, type make flash and your CANable will be updated to the latest firwmare. Unplug/replug the device after moving the boot jumper back, and your CANable will be up and running.

Debugging

Debugging and flashing can be done with any STM32 Discovery board as a programmer, or an st-link. You can also use other tools that support SWD.

To use an STM32 Discovery, run OpenOCD using the stm32f0x.cfg file: openocd -f fw/stm32f0x.cfg.

With OpenOCD running, arm-none-eabi-gdb can be used to load code and debug.

Contributors

  • Ethan Zonca - New features, HAL updates, Makefile fixes and code size optimization, updates for CANable
  • onejope - Fixes to extended ID handling
  • Phil Wise - Added dfu-util compatibility to Makefile

License

See LICENSE.md