You have Java script turned off.
You cannot view the images in full size.
CANable 2.5 Firmware from ElmüSoft - Slcan & Candlelight
While I added support for CANable adapters to
HUD ECU Hacker I found so
many issues that I ended up writing a new firmware.
The official firmware that you find on Github and that comes with the adapters bought in China is of low quality .
Here you find the first CANable firmware that can be used for professional CAN bus applications.
I united 2 formerly separate firmware projects Slcan and Candlelight into one project with a common code base .
The new CANable 2.5 firmware is high quality and open-source .
If you noticed in the legacy firmware that CAN communication did not work you had no chance to find out why.
Here you find the first CANable firmware with correctly implemented error handling telling you what is wrong.
Although many new features were added, the new firmware is 100% backward compatible with legacy software.
The firmware has been tested successfully with CAN FD baudrates up to 10 Mega baud .
The firmware has been designed to be easily expandable for future requirements.
The firmware has been written by a software developer with 40+ years of programming, reverse engineering and electronic experience.
Additionally with
HUD ECU Hacker you get a powerfull tool with lots of features, the
swiss knife for CAN bus.
With the
Firmware Updater you can upload the new firmware to your CANable with one click.
Additionally you get a high speed
CAN Raw Terminal that supports all the new features, but works also with legacy adapters.
You can grab logfiles of CAN bus traffic.
You can decode the CAN bus protocols ISO 15765 , J1939 and NMEA 2000 that are used in motorbikes, cars, trucks and vessels.
You can write ultra fast macro scripts that communicate with devices on CAN bus.
1.) User Manual
CANable Adapters
Show Full Size
Show Full Size
The CANable is a very cheap ($15 US) CAN bus adapter with CAN FD support.
If you buy one make sure that it is a CANable 2.0 and has the STM32G431 processor.
Do not buy the older CANable 1.0 adapters which are obsolete because they don't support CAN FD.
I recommend the MKS Makerbase because it has a robust case and CAN bus is electrically isolated from USB.
It uses an ADM3050E isolated CAN Transceiver (
Datasheet )
and a B05050S-1WR3 isolated DC-DC Converter (
Datasheet ).
It has a manual switch that can connect a 120 Ω termination resistor to CAN bus.
I tested it thoroughly and it works perfectly up to 10 Mega baud .
Hardware Misdesign
CANable adapters have an extremely stupid hardware design:
They use the same processor pin for CAN RX and for BOOT0.
Show Full Size
When the pin BOOT0 is High during power ON the processor goes into Bootloader Mode .
In a correctly designed hardware this would only happen when the Boot Mode jumper is set.
But in this misdesign they must make sure that the CAN RX pin is Low when the processor is reset.
Therefore they use the transistors Q1 and Q2 which delay the power supply for the CAN transceiver.
Without these transistors the processor would always start in Boot Mode.
In Boot Mode the processor runs it's internal bootloader and is ready to receive a firmware update .
In Boot Mode only the red LED is on and you see a "STM Device in DFU mode" in Device Manager.
(DFU stands for "Device Firmware Updgrade")
In Boot Mode you cannot use the adapter to connect to CAN bus.
The consequence of this misdesign is that short interruptions of the 5V USB power will immediately enter Boot Mode.
This happens when you merely move the USB plug a little bit or when you reboot the computer.
During a reboot the mainboard interrupts the USB power supply for a short time.
Finally the Boot Mode jumper is not required to enter Boot Mode.
If you want to enter Boot Mode you only have to quickly disconnect and reconnect the USB cable.
If you want to leave Boot Mode you must disconnect the USB cable, wait 5 seconds, and reconnect USB.
If you don't wait 5 seconds you will get Boot Mode again. The condensator C3 must be discharged first.
This misdesign really sucks .
Therefore my CANable 2.5 firmware comes with a solution : You can disable the pin BOOT0.
Official Firmware for STM32G431
The CANable adpters use an open source firmware that was first developed by Geschwister Schneider .
Later it was adapted on Github to multiple processors and CAN FD support was added.
There are 2 versions: CANable 1.0 for older processors and version 2.0 with CAN FD support.
A big problem is the low quality and low speed of the officially available firmware.
Here you see the web updater on canable.io that offers 2 different firmware types.
canable.io Web Updater
Show Full Size
This web updater works only in Chrome and requires that you install a driver which gives a website access to your USB devices.
I would never do that. This opens a security hole.
Slcan Protocol
When you connect a CANable with Slcan firmware a COM port will appear on Windows.
The entire communcation with CAN bus is transferred as ASCII characters.
This is a highly inefficient way to transmit binary data over a USB cable.
For each byte that you send to CAN bus two bytes must be transferred over USB.
The USB speed is limited to 12 Mbit/s but CAN bus can reach speeds up to 10 Mbaud.
The only advantage of the Slcan protocol is that it is simple .
There are even people who send commands manually to the adapter in Teraterm.
Slcan is for people who play around with CAN bus at the hobby level.
But Slcan is slow and not recommended for any professional use.
Candlelight Protocol
The Candlelight protocol sends binary data over USB and could theoretically make the best use of the USB speed.
But the official firmware from canable.io does not even implement CAN FD .
A correctly working Candlelight firmware for the STM32G431 processor did not exist nowhere.
I'am the first one who releases a functional Candlelight firmware for the STM32G431.
And my Candlelight 2.5 firmware implements a new protocol that optimizes USB data transfer to the maximum.
However, my firmware is still 100% backward compatible with the legacy protocol.
Inefficient USB Data Transfer
The following table compares the efficiency of different firmware versions receiving a CAN FD packet.
The payload in this example consists of a 29 bit CAN ID + 16 data bytes + flags = 21 byte.
19F50C02: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F (FDF, BRS)
Firmware Payload Transferred over USB Efficiency
Legacy Official Slcan 21 byte Payload x 2 + 2 = 44 byte 48 %
ElmüSoft Slcan 2.5 21 byte Payload x 2 + 2 = 44 byte 48 %
Legacy Official Candlelight 21 byte CAN FD not implemented 0 %
ElmüSoft Candlelight 2.5 21 byte Payload + 2 = 23 byte 91 %
Legacy Candlelight Installation not working
When you connect a CANable with Candlelight firmware, Windows should install the WinUSB driver automatically.
This works only if the firmware responds correctly to the Microsoft OS descriptor request.
Windows asks the firmware which driver it needs and the firmware tells Windows that it needs a WinUSB driver.
As simple as this is, you will not find any official firmware where this is implemented 100% correctly.
And the official firmware from canable.io is even such a crap that no driver is installed at all.
This was another reason why I had to write a new firmware.
When you upload the new Candlelight 2.5 firmware from ElmüSoft, Windows will instantly install 2 drivers.
This happens so fast that you don't even notice it. There will be no window telling you that a driver is installed.
Windows installs the driver invisibly in the background in one second.
Microsoft OS Descriptor Request
The new Candlelight 2.5 firmware is the first Candlelight firmware that works 100% correctly on Windows.
Now you can test this on your own: Open your adapter with HUD ECU Hacker and you see all details in the Trace pane.
HUD ECU Hacker sends the Microsoft OS descriptor requests to the adapter and shows the adapter responses .
There are 3 requests that the adapter must answer correctly for 2 interfaces.
1.)
Here you see the correct response of the CANable 2.5 firmware:
String ID: 0xEE, Signature: "MSFT100", VendorCode: 0x20
Interface: 0, Version: 1.00, MS Compatible ID: "USB\MS_COMP_WINUSB"
Interface: 1, Version: 1.00, MS Compatible ID: "USB\MS_COMP_WINUSB"
Interface: 0, Property: "DeviceInterfaceGUIDs", Type: MultiString, Data: "{c15b4308-04d3-11e6-b3ea-6057189e6443}\0\0"
Interface: 1, Property: "DeviceInterfaceGUIDs", Type: MultiString, Data: "{c25b4308-04d3-11e6-b3ea-6057189e6443}\0\0"
Interface 0 is the Candlelight interface and Interface 1 is the DFU Firmware Update interface.
Both interfaces need a unique identifier (GUID) so Windows can install a driver for each interface.
2.)
This is the response of a legacy Candlelight 1.0 firmware that does not have a version number:
String ID: 0xEE, Signature: "MSFT100", VendorCode: 0x20
Interface: 0, Version: 1.00, MS Compatible ID: "USB\MS_COMP_WINUSB"
Interface: 1, Version: 1.00, MS Compatible ID: "USB\MS_COMP_WINUSB"
Interface: 0, Property: "DeviceInterfaceGUIDs", Type: MultiString, Data: "{c15b4308-04d3-11e6-b3ea-6057189e6443}\0\0"
Interface: 1, Error requesting MS OS Extended Properties descriptor.
The device has a buggy firmware. The driver for the firmware update (DFU) interface cannot be installed automatically.
3.)
And the worst is the Candlelight firmware
ba6b1dd from the canable.io
Web Updater .
No driver is installed at all because the firmware does not respond to the request. This firmware is garbage.
The new Firmware Updater
HUD ECU Hacker has a built-in
Firmware Updater for all types of STM32 processors from ST Microelectronics.
HUD ECU Hacker
Show Full Size
Firmware Updater
Show Full Size
When you install HUD ECU Hacker you can chose between 4 different CANable 2.5 firmware versions:
File Name Destination Adapters
STM32G431 - Slcan2.5 - MksMakerbase.dfu MKS Makerbase, DSD Tech, Walfront
STM32G431 - Slcan2.5 - OpenlightLabs.dfu Openlight Labs
STM32G431 - Candlelight2.5 - MksMakerbase.dfu MKS Makerbase, DSD Tech, Walfront
STM32G431 - Candlelight2.5 - OpenlightLabs.dfu Openlight Labs
The only difference between the adapters is the pin that is used for the green LED .
Openlight Labs uses processor pin B11, while the other companies use pin A0.
If you install the wrong firmware the green LED will always be off.
If you have another adapter with a different pin assignment, send me an email, this can easily be adapted.
The firmware has been tested on the STM32G431 processor. But it should work on all processors of this serie:
STM32G441, STM32G471, STM32G473, STM32G474, STM32G483, STM32G484, STM32G491, STM32G4A1.
The HUD ECU Hacker Firmware Updater can flash any STM32 processor, also in older CANable 1.0 adapters.
Flashing the CANable is no risk. The processor has a hard-coded bootloader that cannot be destroyed.
When you connect the USB cable and the blue and green LED are not blinking alternatingly, the firmware is not working.
This may happen when you upload the firmware to the wrong processor. In this case you can simply flash it again.
Therefore it is strongly recommended that you first make a backup of the current firmware in the adapter.
With the button 'Download' you can store the current firmware into a DFU file.
This allows you to always revert the adapter to it's original state.
The firmware updater works with the DFU file format that has been developed by ST Microelectronics.
Apart from the flash data the DFU file contains additional information like name, target, version, memory address,...
If you have other firmware formats, like BIN , HEX or S19 you can copy them into the subfolder 'Firmware'.
The firmware updater will convert the files automatically into DFU files that match the currently selected device.
Before clicking the button 'Upload' you must select the target 'Internal Flash' .
The Firmware Updater can also write the Option Bytes and the One Time Programmable memory. But this is only for experts.
When you click the button 'Identify' the LED's on the CANable will blink, and with the next click they stop blinking.
This allows to distinguish with which adapter you are communicating if multiple adapters are connected at the same time.
The processor will ignore the pin Boot0 and not enter bootloader mode alone when you only reboot the computer.
But this means that the processor will also NOT enter bootloader mode when you set the Boot Mode jumper .
You can easily revert this by clicking the button 'Enter DFU mode' .
The firmware will first activate the pin Boot0 again before you can upload any other firmware.
The new CANable 2.5 firmware has a command to enter the bootloader .
This means with the new firmware you just click a button and don't need to put a jumper on the board.
Meaning of the LED's
The red LED is connected to 5 Volt from USB. It cannot be controlled by the firmware. It is always On.
LED's Meaning LED's Meaning
The adapter is ready and closed.
1.) The adapter is open: No CAN bus traffic.
2.) The adapter is in Firmware Update mode.
3.) The USB bus is suspended in sleep mode.
1.) The adapter is open: RX CAN bus traffic.
2.) The adapter is closed: USB command received.
The adapter is blocked after a severe error
buffer overflow or bus off.
The adapter is open: TX CAN bus traffic.
1.) After Power-On both LED's flash alternatingly.
2.) Also when you click the button 'Identify'.
The adapter is open: RX+TX CAN bus traffic.
NOTE: The behaviour of the LED's has been fixed by ElmüSoft.
The legacy Slcan firmware did not show TX CAN bus traffic at all.
The legacy Candlelight firmware flashed the TX LED even if there was an error and the packet was never sent.
With the new CANable 2.5 firmware both LED's show exactly what is happening on CAN bus.
The green TX LED will only flash if a CAN packet has been sent successfully and acknowledged by the recipient.
The blue RX LED will always flash when a CAN packet was received even if the packet is blocked by a filter.
Cangaroo
People are told to use the Cangaroo software to connect to their CANable.
But the developer of Cangaroo was not able to calculate the settings for any given baudrate / samplepoint combination.
Instead he implemented hard-coded tables only for processors with 16 Mhz, 48 MHz and 170 MHz clock .
Cangaroo gives you very few options for CAN bus baudrates and much less options for the samplepoint.
When you connect an adapter with any other clock (for example 160 MHz) you cannot select any baudrate.
Cangaroo is not even able to show you an error message. It simply does not work and you don't know why you see nothing.
Cangaroo uses WinUSB in the wrong way which may result in wrong packet order at a high bus load.
Cangaroo may suddenly hang eternally and even crash .
Cangaroo is low quality software, as many projects on Github that have never been finished and that have bugs that never get fixed.
HUD ECU Hacker
The good news is that now you can use your CANable with
HUD ECU Hacker , a
high quality software.
HUD ECU Hacker is
charityware , which means that the author does not earn any money with it.
If you like the software you are asked to give a donation to a charity organization of your choice.
CAN Raw Terminal
Show Full Size
J1939 Protocol
Show Full Size
NMEA 2000 Protocol
Show Full Size
HUD ECU Hacker is a powerful tool with lots of features, like the swiss knife for CAN bus and ECU's.
The CAN Raw Terminal allows you to see CAN bus traffic and send packets manually.
You can open multiple Terminal windows at once, one for each adapter.
You can also write
macro scripts that receive packets and send responses and
simulate any CAN controller.
You can grab logfiles from CAN bus traffic.
You can send the content of an entire logfile to CAN bus.
The CAN Raw Terminal is designed to communicate with a device on CAN bus.
There is another Terminal, the Sniff Terminal which allows to sniff CAN bus traffic silently without interference.
In the Sniff Terminal packets are normally not ACKnowledged, the adapter works in Silent Mode .
But HUD ECU Hacker would not be very useful if it would only show the raw packets that are transferred over CAN bus.
HUD ECU Hacker can
decode the protocols
ISO 15765 ,
J1939 and
NMEA 2000 .
The
J1939 protocol is used in on-highway, construction, agriculture and forestry vehicles.
And if you provide a
DBC file HUD ECU Hacker can decode the CAN packets of any vehicle, like for example from your car.
CAN bus Settings
Here you can configure how HUD ECU Hacker connects to CAN bus.
Send always 8 data bytes
If you send classic packets with less than 8 bytes they are padded to 8 bytes,
while CAN FD packets are always padded to the next possible data length.
Show all packets on the bus
This checkbox turns off all filters and also the combobox "ID Length" is ignored.
No matter if you selected '11 Bit' or '29 Bit', you will see all packets on the bus.
Automatic Retransmission if no ACK received
If this checkbox is On the processor tries to send a packet until it is achnowledged.
After trying it 128 times in vain the processor goes into error state Bus Passive .
If the checkbox is Off the processor sends the packet in One shot mode .
If the packet is not acknowledged the processor does not send it again.
Show sent packets in Trace if ACK received
When a packet was acknowledeged you see the 'echo' of the Tx packet in olive color.
You see the exact timestamp when the packet has been acknowledged.
If the packet is not acknowledged you will not see any echo and the green LED does not flash.
This allows you to verify that a packet has been sent and received successfully.
The CANable 2.5 firmware is the first firmware where this is implemented correctly.
The legacy Slcan firmware did not implement this feature.
The legacy Candlelight firmware showed a fake echo , also for not acknowledged packets.
Suppress repeating identical CAN bus packets
CAN bus traffic is often very repetitive.
Here you can hide all packets that have already been shown with the same ID and data bytes.
You see each unique packet only once.
CAN Filter
Filters are a new feature that was missing in the legacy firmware.
CAN bus filters can drastically reduce the traffic over USB.
This is important because the USB speed is limited to 12 Mbit/s while CAN data may come with up to 10 Mbaud.
All traffic that does not interest you will not be sent over USB.
The screenshot above shows a filter that lets only pass the CAN ID's from 18EE0000 to 18EEFFFF .
Please read the chapter about
CAN filters in the HUD ECU Hacker manual.
NOTE: The blue LED flashes when a CAN packet is received. It also flashes for packets that are blocked by the filters.
This means that the green and blue LEDs always show the entire CAN bus traffic, even if your filter blocks everything.
Samplepoint
The samplepoint is not really important for classic CAN.
But if you plan to use CAN FD you must enter the correct samplepoints, otherwise you will get problems
because on a CAN bus many controllers must synchronize to each other using the exactly same settings.
One bit of a CAN packet is sub-divided into multiple Time Quantums , in this example sixteen.
The samplepoint is the exact moment when the processor measures the state of the CAN bus: High or Low.
The samplepoint must be a fraction of 2 integers: 1/2 = 50% , 3/4 = 75% , 5/8 = 62.5% , 4/5 = 80% , 7/8 = 87.5%
A later samplepoint has the advantage that it allows longer cables, to compensate for the delay of distant controllers.
An earlier samplepoint has the advantage that it is more robust against cheap, unprecise oscillators and jitter.
But the major problem is that CAN FD switches the baudrate exactly at the samplepoint of the BRS bit.
If you did not enter the two samplepoints correctly you will not be able to communicate with the CAN bus.
Baudrates
The processor needs 3 settings to configure baudrate and samplepoint:
Bitrate Prescaler : the CAN clock is divided by the prescaler which gives the clock for one Time Quantum.
Segment1 : defines the count of time quantums before the samplepoint (in the above example = 11).
Segment2 : defines the count of time quantums after the samplepoint (in the above example = 4).
The STM32 processors treat the Synchronization segment separately. Therefore you must add 1 to Segment 1.
Example: CAN Clock = 160 MHz, Baudrate = 500 kBaud, Samplepoint = 75%, Time Quantums (TQ) per bit = 16.
This can be achieved by passing the following settings to the processor: Prescaler = 20 , Segment1 = 11 , Segment2 = 4 .
Baudrate = 160 MHz / 20 / (1 + 11 + 4 ) = 500 kbaud
Samplepoint = (1 + 11 ) / (1 + 11 + 4 ) = 0.75 = 75%
The legacy Slcan firmware gives poor options for the CAN FD baudrates: only 2 and 5 Mega baud.
The legacy Candlelight firmware can theoretically set any baudrate that is possible.
But for the calculation the host application must know the limits for the settings Prescaler, Segment1 and Segment2.
Every processor has a different range for these values.
The legacy Candlelight firmware reports wrong limits and so a correct calculation is impossible.
Summary: With none of the legacy firmware's can you set a precise baudrate/samplepoint as needed.
Additionally the legacy firmware uses a CAN clock frequency of 170 Mhz which is not an intelligent choice.
It is not possible to derive baudrates like 2, 4, 5 or 8 Mbaud with 50%, 62.5%, 75% or 87.5% samplepoint from 170 Mhz.
Therefore the new CANable 2.5 firmware changes the CAN clock to 160 MHz .
It is recommended by ST Microelectronics that the nominal and the data baudrate use the same prescaler .
The baudrate is switched exactly at the samplepoint of the BRS bit.
If the baudrates do not use the same prescaler, a phase shift will be the consequence which may corrupt the timing.
Another recommendation is that the prescaler should be as low as possible.
And the Synchronization Jump Width should be: SJW = min(Segment1, Segment2).
For more details read the PDF documents in subfolder
Documentation .
All this baudrate / samplepoint stuff is quite complex and I have found many bugs in legacy code, so I implemented a check.
The host application sends the values for Prescaler, Segment 1 + 2 for the nominal and the data baudrate to the firmware.
And the firmware calculates the exact values and reports them in a debug message back to the host application.
When you open the adapter you see this debug message from the firmware:
Nominal: 500k baud, 87.5%; Data: 2M baud, 50.0%; Perfect match: Yes
When you see Perfect Match: Yes , this means that both baudrates use the same prescaler.
HUD ECU Hacker implements a complex algorithm that does all this calculation for you.
HUD ECU Hacker tries to find the perfect settings for your nominal/data baudrates/samplepoints.
If a samplepoint cannot be matched exactly, it shows a warning and uses the nearest value that is possible.
If a baudrate cannot be matched it shows an error .
CAN bus Errors
The legacy Slcan firmware has no error reporting at all.
When you send a packet to CAN bus you have no idea if the packet was really sent or not.
After sending an invalid parameter, for example when setting the baudrate, you will never know why you cannot connect to CAN bus.
And the legacy Candlelight firmware has an error reporting, but only for CAN bus errors and there are many issues.
I implemented a proper error reporting for CAN bus errors and also for command errors.
Whenever a software or firmware does not work, but shows no error, be sure that it was written by a sloppy programmer.
With the new firmware it will never again happen that something does not work and you have no idea why.
The first error on CAN bus is always reported immediately.
A second error is only reported after 100 ms have elapsed and only if the second error is different from the
previously reported. This is important to avoid flooding the host with thousands of errors as the legacy firmware did.
If the same error stays present for a long time, it is reported in intervals of 3 seconds .
21:20:14.788 Send Packet
21:20:14.788 18EEFF01: 01 02 03 04 05 06 07 08 <—— this packet was sent successfully
21:20:14.790 18EEFF01: 01 02 03 04 05 06 07 08 <—— this is the Tx echo
21:20:18.119 Send Packet <—— send with auto-retransmission ON
21:20:18.119 14A90022: 01 02 03 04 05 06 07 08 <—— this packet was not acknowledged
21:20:18.120 Bus Active, Tx Errors: 8 <—— first error immediately
21:20:18.220 Bus Passive, No ACK received, Tx Errors: 128 <—— second error after 100 ms
21:20:18.738 Send Packet
21:20:18.738 14A90022: 01 02 03 04 05 06 07 08 <—— this packet was not acknowledged
21:20:21.216 Bus Passive, No ACK received, Tx Errors: 128
21:20:24.212 Bus Passive, No ACK received, Tx Errors: 128 <—— same error repeated every 3 seconds
21:20:27.208 Bus Passive, No ACK received, Tx Errors: 128
All controllers on CAN bus share the same two data wires.
If only one controller has a bug and breaks the rules of CAN bus, it will screw up the traffic of all the others.
Thefore it is fundamentally important that a controller turns off it's transmitter, when it has detected a problem.
This error detection must be implemented in hardware . It must be immediate and bullet proof.
Therefore all processors that have a CAN bus controller distinguish these 4 states:
Bus Actice (no errors or less than 96 errors)
Warning Level (between 96 and 128 errors)
Bus Passive (between 128 and 248 errors)
Bus Off (more than 248 errors)
In the arbitration phase it is allowed that multiple controllers send at the same time. One of them will win the arbitration.
But in the data phase there must be only one controller sending data.
If the processor detects a case of a severe data corruption it immediately stops transmitting and goes into Bus Off state.
Bus Off is a severe error that you can create by sending packets between two adapters configured for different baudrates.
22:21:24.187 Send Packet
22:21:24.187 170AA3CB: 01 02 03 04 05 06 07 08
22:21:24.623 Bus Passive, Bit stuffing error, Tx Errors: 128, Rx Errors: 8 <—— corruption while sending
22:21:27.618 Bus Passive, Recessive bit error, Tx Errors: 128, Rx Errors: 8
22:21:30.367 Bus Off, Frame format error, Tx Errors: 248, Rx Errors: 127 <—— corrupt packet received
With a little experience you can deduce what is wrong on CAN bus by understanding what these errors mean.
If there is a severe error like Bus Off of Buffer Overflow, the green and blue LED's are permanently On.
Transmit Timeout
If automatic retransmission is enabled and the processor does not receive an ACK it goes into Tx Bus Passive state.
In this state the processor re-transmits the first packet in the Tx FIFO eternally creating 95% bus load .
The name 'Bus Passive ' is totally misleading . The bus is not passive. In the opposite it is flooded with traffic.
On the
oscilloscope you see the same packet retransmitted with nearly no pauses in between.
Therefore I implemented a Tx timeout. Pending Tx requests are cancelled after 500 ms .
You see an error report:
Bus Passive, Tx Timeout, No ACK received, Tx Errors: 128
The error counter stops counting at 128, but without a timeout there may be thousands of failed transmit attempts.
Transmit Echo Markers
The legacy Slcan firmware never gave you any feedback if a packet was sent or not.
The legacy Candlelight firmware had a wrongly designed feedback mechanism for Tx packets:
When the firmware received a Tx packet it has sent the entire Tx packet in a fake event back to the host.
This feedback was immediate, no matter if the packet was really sent to CAN bus or not.
For a CAN FD packet with 8 data bytes the firmware sent a fake event of 80 bytes over USB back to the host.
These fake events produced a lot of useless USB traffic , could not be turned off and the timestamps were wrong.
The new firmware can receive an 8 bit marker with each transmit packet from the host application.
When the packet has been sent successfully to CAN bus the processor fires a Tx Event that contains the marker.
The host application must store the last sent packets in an internal array (study the code of the
Demo Application ).
The maximum count of packets that can be stored in the adapter is 64 + 3 = 67.
An 8 bit marker can have values from 0 to 255 which is more than enough to give each Tx packet a unique marker.
The advantage is that the user has a reliable feedback which packets have really been sent.
In One-Shot mode (no re-transmission) this is the only way to know if a packet has been acknowledged or not.
The user can also see the exact time when the packet has been dispatched to CAN bus.
By using markers
only one byte is transferred back to the host, rather than the entire packet (See
example ).
Timestamps
I have seen Slcan firmware that sends timestamps over USB to the host application.
A 32 bit timestamp is sent as 8 ASCII characters with each received packet.
Using an ASCII protocol is already inefficient. See
Comparison .
But making USB traffic even slower by inflating each packet with 8 additional bytes is a bad idea.
The CANable 2.5 firmware is speed optimized to the maximum that is possible.
Therefore timestamps are not implemented for Slcan , by purpose.
The Candlelight 2.5 firmware maintains 1 µs timestamps for backward compatibility.
These occupy only 4 bytes and can be turned off.
This 64 bit counter has a precision of nanoseconds.
When a packet arrives over USB you attach a timestamp to it.
The
C++ Demo Application shows both: How to use timestamps from firmware and from performance counter.
Enter DFU mode
The new Slcan and the new Candlelight firmware have a new command to enter DFU mode.
The boot mode jumper will not be required anymore.
Before entering boot mode the firmware enables the pin BOOT0 if it was disabled.
If the pin BOOT0 was disabled the processor will not enter boot mode before it receives a hardware reset .
This means the user must reconnect the USB cable . This is only required if the pin BOOT0 was disabled before.
Other than the legacy firmware, the new firmware waits a delay of 300 ms before entering boot mode.
This guarantees that always a feedback is sent back to the host telling if the command was successful or not.
Bugfixes
I fixed several bugs in the legacy firmware. The top worst bugs were:
The Candlelight firmware could crash completely after a buffer overflow.
Candlelight had a misdesign: it used only one buffer for CAN Rx and Tx.
The consequence was that after a CAN buffer overflow it could not even send the error status to the host.
Candlelight did not send USB traffic correctly. USB Packets with exactly 64 bytes arrived wrong.
Bus Load
The new firmware can calculate the bus load . It is displayed in percent in an interval that the user can define.
HUD ECU Hacker shows the bus load every 5 seconds in the Trace pane, if it is not zero.
The calculation of the bus load is quite complex. It may have a deviation of +/- 10%.
Transceiver Delay
The delay of the CAN bus transceiver chip is relevant for baudrates above 1 Mega baud.
The processor automatically measures the delay and the firmware reports it.
You see a debug message after the first CAN FD packet that you send with the BRS flag set:
23:32:21.069 19858A01: 0C 00 00 00 F0 18 51 0E (FDF, BRS)
23:32:21.073 Measured transceiver chip delay: 131 ns
23:32:21.073 19858A01: 0C 00 00 00 F0 18 51 0E (FDF, BRS)
Normally transceiver chips have a delay around 50 ns.
But the isolated chip in the MKS Makerbase that you see here is slower. (
Datasheet ).
2.) Application Developer Manual - Slcan
This manual is for software developers who want to communicate with the CANable 2.5 from a computer.
In Slcan all commands and responses are sent as
ASCII strings which is slow. See
Comparison .
For professional applications use Candlelight and not Slcan.
The first character is the command to execute. The last character is always a Carriage Return.
Slcan Commands
Command Condition Version Meaning Comment
"A1\r" Closed legacy Enable Auto Retransmission Retransmit packets until they are acknowledged
"A0\r" Closed legacy Disable Auto Retransmission Enable one shot mode
"C\r" Open/Closed legacy Close the adapter Shut down CAN connection, reset to default settings
"L7\r" Open/Closed 100 Enable Bus Load reports every 700 ms
L1: Report interval= 100 ms, L50: Interval= 5 seconds
Valid range of interval: 0 ... 100 (max 10 seconds)
"L0\r" Open/Closed 100 Disable Bus Load report
"O\r" Closed legacy Open adapter Connect to CAN bus with the mode set by M0 / M1
"ON\r" Closed 100 Open in normal mode Ignore settings with M0 / M1
"OS\r" Closed 100 Open in silent mode Ignore settings with M0 / M1
"OI\r" Closed 100 Open in internal loopback mode Ignore settings with M0 / M1
"OE\r" Closed 100 Open in external loopback mode Ignore settings with M0 / M1
"V\r" Open/Closed legacy Return detailed info: Version/Board/MCU/Limits Returns seven key/value pairs. See Version Info
Set Modes Condition Version Meaning Comment
"M1\r" Closed legacy Enable silent mode The next command "O\r" will open in bus monitoring mode
"M0\r" Closed legacy Disable silent mode The next command "O\r" will open in normal mode
"MA\r" Closed 100 Enable Auto Retransmission mode (same as A1) Retransmit packets until they are acknowledged
"Ma\r" Closed 100 Disable Auto Retransmission mode (same as A0) Enable one-shot mode
"MD\r" Open/Closed 100 Enable Debug Messages Firmware sends string messages to the host
"Md\r" Open/Closed 100 Disable Debug Messages Do not send debug messages
"ME\r" Open/Closed 100 Enable CAN Error reports CAN errors are sent to the host
"Me\r" Open/Closed 100 Disable CAN Error reports CAN error reporting is off (deprecated!)
"MF\r" Open/Closed 100 Enable Feedback mode For each command a success/error feedback is sent
"Mf\r" Open/Closed 100 Disable Feedback mode Command Feedback mode is off (deprecated!)
"MI\r" Open/Closed 100 Enable Identify mode The green/blue LED's start blinking
"Mi\r" Open/Closed 100 Disable Identify mode The LED's stop blinking
"MM\r" Open/Closed 100 Enable Tx echo report marker Report all successfully sent packets with a marker
"Mm\r" Open/Closed 100 Disable Tx echo report marker No Tx Echo report
"MR\r" Open/Closed 100 Enable 120 Ω Termination Resistor Supported only by few boards
"Mr\r" Open/Closed 100 Disable 120 Ω Termination Resistor
"MS\r" Open/Closed 100 Enable ESI report Report the ESI flag of received CAN FD messages
"Ms\r" Open/Closed 100 Disable ESI report No ESI report
"MDEFMS\r" Open/Closed 100 Enable Debug, Error, Feedback, Echo, ESI reports You can set all modes at once in one command
Set Baudrates Condition Version Meaning Comment
"S0\r" Closed legacy Set nominal baudrate 10 kbaud Samplepoint 87.5%
"S1\r" Closed legacy Set nominal baudrate 20 kbaud Samplepoint 87.5%
"S2\r" Closed legacy Set nominal baudrate 50 kbaud Samplepoint 87.5%
"S3\r" Closed legacy Set nominal baudrate 100 kbaud Samplepoint 87.5%
"S4\r" Closed legacy Set nominal baudrate 125 kbaud Samplepoint 87.5%
"S5\r" Closed legacy Set nominal baudrate 250 kbaud Samplepoint 87.5%
"S6\r" Closed legacy Set nominal baudrate 500 kbaud Samplepoint 87.5%
"S7\r" Closed legacy Set nominal baudrate 800 kbaud Samplepoint 87.5%
"S8\r" Closed legacy Set nominal baudrate 1 Mbaud Samplepoint 87.5%
"S9\r" Closed legacy Set nominal baudrate 83.333 kbaud Samplepoint 87.5%
"Y0\r" Closed 100 Set CAN FD data baudrate 500 kbaud Samplepoint 75%
"Y1\r" Closed 100 Set CAN FD data baudrate 1 Mbaud Samplepoint 75%
"Y2\r" Closed legacy Set CAN FD data baudrate 2 Mbaud Samplepoint 75%
"Y4\r" Closed 100 Set CAN FD data baudrate 4 Mbaud Samplepoint 75%
"Y5\r" Closed legacy Set CAN FD data baudrate 5 Mbaud Samplepoint 75%
"Y8\r" Closed 100 Set CAN FD data baudrate 8 Mbaud Samplepoint 50% (75% does not work on STM32G431)
"s4,69,10,7\r" Closed 100 Set nominal bitrate: Prescaler=4, Seg1=69, Seg2=10, Synchr. Jump Width=7 Set 500 kbaud, Samplepoint 87.5% See Samplepoint
"y4,9,10,7\r" Closed 100 Set data bitrate: Prescaler=4, Seg1=9, Seg2=10, Synchr. Jump Width=7 Set 2 Mbaud, Samplepoint 50% See Samplepoint
Set Filters Condition Version Meaning Comment
"F7E8,7FF\r" Closed 100 Set a mask filter for only one ID: 7E8 (11 bit)
You can set up to 8 mask filters separated by semicolons.
11 bit and 29 bit filters can be mixed.
"F18DA00F1,1FFF00FF\r" Closed 100 Set a mask filter for 256 IDs: 18DAXXF1 (29 bit)
"F7E0,7F0;720,7F0;730,7F0\r" Closed 100 Set 3 filters for 16 ID's each: 7EX, 72X and 73X
"f\r" Closed 100 Clear all filters Remove all filters
Boot Mode Condition Version Meaning Comment
"*Boot0:Off\r" Closed 100 Disable pin BOOT0 See Hardware Misdesign
"*Boot0:?\r" Open/Closed 100 Request status of pin BOOT0 returns "+1\r" if enabled or "+0\r" if disabled
"*DFU\r" Open/Closed 100 Enable pin BOOT0 and enter DFU mode If feedback = FBK_ResetRequired
: Reconnect USB cable!
Transmit Packets Condition Version Meaning Comment
"Txxxxxxxxx\r" Open legacy Send classic packet with 29 bit ID Bits: IDE See Slcan Packets
"txxxxxxxxx\r" Open legacy Send classic packet with 11 bit ID Bits: None
"Rxxxxxxxxx\r" Open legacy Send Remote Transmission Request with 29 bit ID Bits: RTR + IDE
"rxxxxxxxxx\r" Open legacy Send Remote Transmission Request with 11 bit ID Bits: RTR
"Dxxxxxxxxx\r" Open legacy Send CAN FD packet, 29 bit, no baudrate switch Bits: FDF + IDE
"dxxxxxxxxx\r" Open legacy Send CAN FD packet, 11 bit, no baudrate switch Bits: FDF
"Bxxxxxxxxx\r" Open legacy Send CAN FD packet, 29 bit with baudrate switch Bits: FDF + BRS + IDE
"bxxxxxxxxx\r" Open legacy Send CAN FD packet, 11 bit with baudrate switch Bits: FDF + BRS
Slcan Responses and Events
Feedback Version Meaning Comment
"#\r" 100 The command has executed successfully Requires Feedback mode to be enabled
"#1\r" 100 The command is invalid Requires Feedback mode to be enabled
"#2\r" 100 A parameter of the command is invalid Requires Feedback mode to be enabled
"#3\r" 100 The command reqires the adapter to be open Requires Feedback mode to be enabled
"#4\r" 100 The command reqires the adapter to be closed Requires Feedback mode to be enabled
"#5\r" 100 The HAL from ST Microelectronics reported an error Requires Feedback mode to be enabled
"#6\r" 100 The feature is not supported by the board / not implemented Requires Feedback mode to be enabled
"#7\r" 100 The CAN Tx Buffer is full (no ACK received, 67 packets waiting) Requires Feedback mode to be enabled
"#8\r" 100 CAN bus is off (a severe CAN error has occurred) Requires Feedback mode to be enabled
"#9\r" 100 Sending packets is not possible in silent mode Requires Feedback mode to be enabled
"#:\r" 100 The required baudrate has not been set Requires Feedback mode to be enabled
"#;\r" 100 Programming the Option Bytes in flash memory failed Requires Feedback mode to be enabled
"#<\r" 100 Please reconnect the USB cable, a hardware reset is required Requires Feedback mode to be enabled
Response Version Meaning Comment
"+Text\r" 100 The firmware sends a text response to a command Used by commands "*Boot0:?\r" and "V\r"
Event Version Meaning Comment
">Message\r" 100 The firmware sends a debug message (plain text) Requires Debug Messages to be enabled
"Exxxxxxxx\r" 100 The firmware reports the CAN Error Status (See Slcan Errors ) Requires CAN Error Reports to be enabled
"L27\r" 100 The firmware has calculated a bus load of 27%. If the bus load is zero, no report is sent. Requires Bus Load Reports to be enabled
"M3C\r" 100 The firmware reports the Tx echo marker 0x3C (See Slcan Packets ) Requires Tx Echo Report markers to be enabled
Rx Packets Version Meaning Comment
"Txxxxxxxxx\r" legacy Received classic packet with 29 bit ID Bits: IDE (See Slcan Packets )
"txxxxxxxxx\r" legacy Received classic packet with 11 bit ID Bits: None
"Rxxxxxxxxx\r" legacy Received Remote Transmission Request with 29 bit ID Bits: RTR + IDE
"rxxxxxxxxx\r" legacy Received Remote Transmission Request with 11 bit ID Bits: RTR
"Dxxxxxxxxx\r" legacy Received CAN FD packet, 29 bit, no baudrate switch Bits: FDF + IDE
"dxxxxxxxxx\r" legacy Received CAN FD packet, 11 bit, no baudrate switch Bits: FDF
"Bxxxxxxxxx\r" legacy Received CAN FD packet, 29 bit with baudrate switch Bits: FDF + BRS + IDE
"bxxxxxxxxx\r" legacy Received CAN FD packet, 11 bit with baudrate switch Bits: FDF + BRS
Slcan Version Info
In the new firmware the command "V\r" returns one string with seven key/value pairs separatad by tab characters .
It starts with a plus character that indicates a command response with text content, rather than a feedback response (#).
+Board: MksMakerbase\t
MCU: STM32G431\t
DevID: 1128\t
Firmware: 25.09.14\t
Slcan: 100\t
Clock: 160\t
Limits: 512,256,128,128,32,32,16,16\r
Split this string at each tab character ('\t') and then each part at the colon. You get 7 key/value pairs:
Key Value Comment
Board MksMakerbase
This defines for which board the firmware was compiled.
It may not match the real hardware if the user has uploaded the wrong firmware.
MCU STM32G431
This defines for which processor the firmware was compiled.
It may not match the real processor if the user has uploaded the wrong firmware.
DevID 1128
This is the "Device ID" of the real processor. Convert 1128 to hex and you get 0x468.
Each processor serie is identified by a unique "Device ID".
0x468 = Category 2 devices (STM32G431, STM32G441)
0x469 = Category 3 devices (STM32G471, STM32G473, STM32G474, STM32G483, STM32G484)
0x479 = Category 4 devices (STM32G491, STM32G4A1)
Firmware 25.09.14
The legacy firmware has returned completely meaningless version numbers like "ba6b1dd".
Here you get a version number that indicates the date when the firmware was created.
The version "25.09.14" means 14th september of 2025.
Slcan 100
This is the version of the Slcan module that you see in the tables above in column 'Version'.
The first version created by ElmüSoft is version 100 which contains all the features described here.
Future versions will be 101, 102, etc and contain new commands which will be documented here.
Use this version number to detect which features are supported by the firmware.
Clock 160 The CAN clock is 160 MHz
Limits 512,256,128,128, 32,32,16,16
These 8 values are the upper limits for the bitrate commands 's' and 'y'.
Each processor has different limits for Prescaler, Segment1, Segment2 and Synchr. Jump Width.
Nominal baudrate: max Prescaler= 512, max Seg1 = 256, max Seg2= 128, max SJW = 128
FD Data baudrate: max Prescaler= 32, max Seg1 = 32, max Seg2= 16, max SJW = 16
Slcan Packets
All packets are transmitted using this pattern:
Packet type : T, t, R, r, D, d, B or b (see tables above)
CAN ID : 3 digits for 11 bit or 8 digits for 29 bit CAN ID
DLC : 1 digit (count of data bytes)
Classic packets: DLC = '0' to '8',
CAN FD: '8'= 8 byte, '9'= 12 bytes, 'A'= 16 bytes, 'B'= 20 byte, 'C'= 24 bytes, 'D'= 32 bytes, 'E'= 48 byte, 'F'= 64 byte.
Data bytes : Classic packets: 0 to 8, CAN FD: 8 to 64 bytes.
only for Tx packets and only if Tx Echo Markers are enabled: a 2 digit marker.
only for Rx packets and only if ESI reporting is enabled: a character 'S' if the sending node is error passive.
Direction Packet Slcan Comment
Both 18AABBCC: 11 22 33 44 55 "T 18AABBCC 5 1122334455 \r" Classic, 29 bit ID
Both 7E0: 11 22 33 44 55 66 77 88 99 AA BB CC "d 7E0 9 112233445566778899AABBCC \r" CAN FD, 11 bit, FDF
Receive 7E0: 11 22 33 44 55 66 77 88 "b 7E0 8 1122334455667788 S \r" FDF, BRS, ESI
Transmit 7E0: 11 22 33 44 55 66 "t 7E0 6 112233445566 3F \r" Marker = 3F
Example:
Tx: "t7E061122334455663F\r" <—— send packet with marker 3F
Rx: "#\r" <—— receive command feedback (Success)
Rx: "M3F\r" <—— receive echo marker 3F
Slcan Error Reports
When CAN Error Reports are enabled you get an error report only if at least one error is present.
Errors are sent immediately, after 100 ms or after 3 seconds as explained
above .
An error report is always of the form "Exxxxxxxx\r" and consists of 5 parts:
Digit Meaning Value
1 Bus Status
'0' = Bus Active
'1' = Warning Level
'2' = Bus Passive
'3' = Bus Off
2 Last Protocol Error
'0' = None
'1' = Bit stuffing error
'2' = Frame format error
'3' = No ACK received
'4' = Recessive bit error
'5' = Dominant bit error
'6' = CRC error
3 + 4 Firmware Error Flags
0x00 = None
0x01 = Rx Failed
0x02 = Tx Failed
0x04 = CAN Tx buffer overflow
0x08 = USB IN buffer overflow
0x10 = Tx Timeout
Multiple flags may be combined
5 + 6 Tx Error Count 0 ... 255 errors
7 + 8 Rx Error Count 0 ... 255 errors
Example: "E2 3 10 80 0C \r" means:
Bus is passive, No ACK received, Tx Timeout, 128 Tx Errors, 12 Rx Errors
Slcan Initialization
When connecting to a CANable 2.5 adapter you should follow this sequence:
Send command "C\r" to close the device if it is till open.
But this command has also another purpose: It resets all internal variables in the firmware to their default.
Baudrates and all modes are reset (back to legacy), reports turned off, filters removed, Rx/Tx buffers are emptied.
ATTENTION: The command 'Close' is the only command that does not send a feedback , although feedbacks are enabled.
The purpose is that you can always send this as the first command and don't have to wait for a feedback.
When you connect to a CANable you don't know if the user has connected a legacy device or a CANable 2.5
Additionally the firmware cannot know at this moment if you will enable feedback mode later or not.
Therefore the command 'Close' behaves exactly as the legacy command: It never sends a feedback.
Split the response string at the tab characters .
When you get 7 parts or more you are communicating with a CANable 2.5, otherwise it is a legacy firmware.
If you don't support legacy devices show an error message, otherwise switch to legacy mode.
If it is a CANable 2.5 use the Slcan Version Number (100 or higher) to check which features are available.
Send command "MF\r" to enable feedback mode (or "MADEFMS\r" with all the other modes that you need)
This will be the first command that sends a feedback.
From now on you must wait for the feedback "#\r" and check for errors before sending the next command.
Send command 'S' or 's' to set the
nominal baudrate .
If you also send command 'Y' or 'y' to set the data baudrate , the firmware will switch automatically into CAN FD mode.
Finally execute command "ON\r" to open the device in normal mode.
RS232 Terminal
Show Full Size
Here you see the initialization sequence sent manually to the adapter.
Use the RS232 Terminal in HUD ECU Hacker.
The baudrate that you enter to open the COM port is irrelevant.
The port runs always with maximum USB speed (12 MBit).
3.) Application Developer Manual - Candlelight
The Candlelight 2.5 firmware can be used to build professional high speed CAN FD applications.
Controlling the Candlelight firmware is more complex than the Slcan firmware.
There are lots of structures and enums. Explaining them all here would explode this manual.
C++ Demo Application
Therefore I wrote a ready-to-use C++ Candlelight class that you can copy and paste into your project.
This robust and well tested class demonstrates all the features that the new firmware offers:
Detect and enumerate all connected Candlelight devices
Obtain details about the connected device: USB descriptor, board, processor, version numbers,.....
Set baudrate and samplepoint
Set mask filters
Open / Close / Start / Reset
Send packet / Receive packet / Process Tx echo marker
Decode and display CAN bus errors
Disable boot pin / Enter DFU mode
The
source code is full of
detailed comments so you can easily understand how it works.
The C++ demo also shows how to use WinUSB.dll correctly which is more complex than it seems at the first look.
For example in Cangaroo and in Candle.NET they use WinUSB wrongly which results in packet loss or wrong packet order.
WinUSB requires an unusal programming that is not documented by Microsoft.
The new ElmüSoft Protocol
The legacy Candlelight protocol had several design errors .
For example when a CAN FD packet was transmitted to the host they sent the timestamp behind a fix array of 64 data bytes.
Adding more unneccessary overhead resulted in sending always 80 bytes over USB, even for a packet with only 8 data bytes.
Additionally the legacy protocol was never designed to transmit anything else than CAN packets.
It was impossible to transfer other data to the host, like for example an ASCII debug string .
Therfore I had to design a new efficient protocol : The ElmüSoft protocol .
It adds only 2 additional bytes the CAN packet payload while transmitting over USB.
It uses a minimalistic data transfer and is additionally very easy to expand for any future requirements.
The new firmware 2.5 still implements the legacy Geschwister Schneider protocol, but can be switched to the new protocol.
The new protocol sends optimized structs for Tx and Rx packtes, Echo Markers, Debug Messages, Error reports, Busload events.
You can test all this in the demo application.
The screenshot above uses timestamps from the computer CPU. They are converted to local time with 1 µs precision.
When you set the flag GS_DevFlagTimestamp
the demo switches to firmware timestamps generated in the adapter.
They have no advantage at all. They produce more USB traffic and you will see several lines with "No Timestamp" .
The reason is that firmware timestamps are only available for events received from the firmware.
But when you send a packert to the firmware you don't get a timestamp.
Enter DFU mode
A SETUP request with DFU_Detach
to interface 1 (DFU) enables boot mode.
Then immediately send a SETUP request with DFU_GetStatus
to check if execution was successful.
If the state is DfuState_AppIdle
the adapter will enter boot mode 300 ms later.
If the state is DfuState_AppDetach
you must show a message to the user to reconnect the USB cable.
The USB reconnection is only required if the pin BOOT0 was disabled before.
The demo application shows the entire procedure.
See pages 17 and 22 in
DFU Functional Descriptor 1.1.pdf in subfolder
Documentation .
4.) Firmware Developer Manual
This is the first project that unites two firmware's, written by different persons, into one project.
The new CANable 2.5 firmware uses the same code base to compile Slcan and Candlelight.
The CAN interface, error handling, LED control, entering DFU mode, etc... use common code.
Only the USB interface and the command executer are implemented individually.
Each project has an own Make file that inculdes the corresponding subfolder: Slcan or Candlelight.
Caveat
The code in this project is not for beginners.
You need several years of embedded C programming experience and hardware knowledge.
Adding new boards
In the file settings.h you find the definitions for the boards.
Currently there are the pin defintions for the boards from MKS Makerbase and Openlight Labs.
The new board must be defined in a new Make file as TARGET_BOARD
Adding new processors
Also in settings.h are the includes of the HAL files (Hardware Abtraction Layer) from ST Microelectronics.
For another processor serie the required HAL files must be added into a new subfolder.
The new processor must be defined in a new Make file as TARGET_MCU
USB Interface
The USB interface is by far the most complicated code in the firmware.
ST Microelectronics gives us a HAL that is scatterd over eleven files calling from one file into another.
All the USB stuff is called from multiple interrupt handlers.
If you don't know what is a
SETUP request , what is an
OUT endpoint or what
stalling an endpoint means,
I recommend that you read the exellent
USB tutorial in subfolder
Documentation .
Compiling STM32 code on Windows
You find a lot of instructions in internet how to compile the firmware on Linux.
But there is nothing for Windows developers, although it is quite simple.
Cube Programmer
If you think that you can install the STM32 Cube Programmer from ST Microelectronics
and you will get a comfortable developer environment, you are completely wrong!
After downloading this Gigabyte monster you will find a very badly designed user interface,
an extremely slow software and you notice that it is not able to compile a Make file.
Several menu items are greyed out without an understandable reason and the help file is no help.
So don't waste your time with this.
ST Microelectronics has only hardware engineers, they have nobody who is able to write desktop software.
Intallation
From the drop down list on the ST website you can select the oldest version (300 MB).
The newer the version, the bigger it gets. The latest version is 1 Gigabyte. You don't need that.
Install
MinGW (Minimalist GNU for Windows)
The only files that you need from this installation are make.exe and mkdir.exe and their 6 DLLs:
libgcc_s_dw2-1.dll, libiconv-2.dll, libintl-8.dll, msys-1.0.dll, msys-iconv-2.dll, msys-intl-8.dll
Rename mkdir.exe into mmkdir.exe to avoid collision with the MKDIR command in the Windows console.
In the Advanced System Settings search the PATH variable and add two folders separated by semicolon:
The folder into which CubeCLT has installed the file arm-none-eabi-gcc.exe
The folder into which MinGW has installed the file make.exe
You can also copy make.exe and mmkdir.exe and their DLLs into the CubCLT directory and you need only one folder.
Now double click the file Build_Slcan.cmd in my project and the compilation should start.
This script copies the compiled BIN files automatically into the Firmware folder of HUD ECU Hacker.
The Firmware Updater will convert the BIN files automatically into DFU files that you can upload.
Source Code
You find the source code on
Github .
Version Numbers
When you add new features to the firmware don't forget to adapt FIRMWARE_VERSION_BCD
in settings.h
After adding new Slcan commands you must increase SLCAN_VERSION
and add the new commands to the documentation.
High Quality Software from ElmüSoft
Desktop Organizer & Event Calendar
My program PTBSync (in english + deutsch) has an event calendar / scheduler with lots of features,
calculates the holidays of 70 countries, can display multiple gadgets on the desktop (current weather, birthdays, moon phase,
menstruation calendar, world clocks,...) pins notes on the desktop, replaces the primitive Windows trayclock
and adds a detailed tooltip, synchronizes with an atomic clock, and much more.
ECU Scanner, ECU Hacker, ECU Tuner for motorbikes, cars, trucks, vessels
connects to ECU's (Engine Control Units) from motorbikes, cars and trucks, shows parameters, clears DTC's, has tuning for a Delphi ECU,
has an ECU emulator, can analyze the CAN bus using cheap adapters, supports many protocols, has a sniffer and manual data injection for K-Line and CAN Bus,
allows you to write your own macro scripts that communicate over K-Line and CAN Bus.
Oscilloscope Waveform Logicanalyzer
displays oscilloscope waveforms and has A/D converters, noise suppression, precise time measurement, logic analyzer with decoders
for UART, SPI, I²C, CAN bus (also CAN FD) and chip-specific decoders. Can split half-duplex communication.
Transfers signals over USB (SCPI) from the oscilloscope to the computer and remote controls the oscilloscope.
It is open-source and you can extend it with new features.
Subtitle Tuner
calculates the display duration of the subtitles based on the count of characters in the text.
This avoids that badly created subtitles disappear before you could read them. Can remove deaf texts, lyrics, italic/bold.
Can resynchronize a subtile to a movie with different framerate or change the subtitle offset.
Secure Doorlock with RFID Cards
is a project with an RFID antenna and a Teensy processor that opens a door with Mifare Desfire cards.
The RFID cards of up to 64 users can be stored in the flash memory.
It is extremely secure because it uses strong encryption. A big battery assures that the door can be opened during a power failure.
Remote Control your Computer with Infrared
An infrared receiver and a Teensy processor allow to remote control the music player on your computer with any old
remote control that you have from a TV, amplifier, DVD player, SAT tuner or whatever.
The Teensy simulates a keyboard and sends keystrokes to the music player.
3D Render and Editor Control in C#
A .NET control that can be easily implemented into System.Windows.Forms applications to display 3D graphs.
The user can move and rotate the graph with the mouse and edit single points.
Many display modes are available: 3D surface, 3D shapes, 3D lines, 3D objects, also animated 3D objects.
CAN FD adapter - CANable 2.5 Firmware Update - Candlelight & Slcan
I wrote two completely new firmwares for the CANable adapter with the STM32G431 processor (for example from MKS Makerbase).
The official Slcan firmware has several issues and the official Candlelight firmware is complete crap.
I fixed a ton of bugs and added several new features. HUD ECU Hacker fully supports these new features and comes with a firmware updater.
USB HID Touchscreen
A Teensy processor emulates keyboard, mouse and touchscreen at the same time to remote control a computer for automation purposes.
You can write me in english, oder auf deutsch, o en español.