HadouCAN USB-CAN FD - Page 1
Forum section: electronics / projects

author: rounin
author_rank: Regular Contributor
timestamp: July 22, 2019, 06:26:16 am
content: I'd like to show my new USB to CAN FD adapter -https://suburbanmarine.io/public/hadoucan/doc/Hadou-CAN_User_Guide.pdfIt is based on a STM32H750 and features an electrically isolated 12Mbps CAN transceiver & USB 2.0 480 Mbps, available as bare board or in an aluminum case.The cool feature that makes this unique is a timesync input/output. A 3V3 signal on the SMA jack can reset the CAN packet reception timestamp counter, so multiple units monitoring several buses can have their timestamps synchronized. The unit can also be configured to drive this pin, so one could be a timesync master. This is very valuable when debugging vehicles with more than one control bus.The USB device is a CDC class virtual serial port, it should work with slcand under linux, although I have had some problems. Windows support will come soon, just need to make the ini file. The protocol currently is compatible with the textmode Lawicel CAN232 protocol (so slcand can be used) with extensions for CAN FD. I need to suggest / push some changes for CAN FD upstream so slcand can work for FD frames.The CAN side has optional split termination (physical jumpers to connect it) and software controlled slew rate for low EMI or high speed. There is also an "auto" configuration that will turn on the high slew rate mode if the bit rate is high.There is an XML document that has a bunch of configuration settings, and a large bitrate and time quanta XML table. The time quanta is fully configurable, which is important for CAN FD when bit rate switching is used. The bit rate switches mid-bit, and if the time quanta is different the different receivers will lose synchronization.There are some software projects that might break out of this, I ended up writing a minimal C++ usb stack & a secure bootloader in support of this, funny how the CAN part ended up being the fastest part of the project. I'll post the usb stack tohttps://github.com/suburbanembedded/libusb_dev_cpp/after I sanitize & license the code, maybe tomorrow.I'm currently looking to do a public beta & could send some boards out for ~cost if anyone is interested (PM me for a coupon). There are likely to be some bugs, but it is nearly feature complete. I'll be adding some final features and fixing bugs over the next few weeks.

author: rounin
author_rank: Regular Contributor
timestamp: October 22, 2019, 06:51:35 pm
content: Firmware is now open source, BSD 3-Clause.https://github.com/suburbanembedded/hadoucan-fwhttps://github.com/suburbanembedded/hadoucan-bootloaderUpdated to fix some bugs and improve windows support.

author: rounin
author_rank: Regular Contributor
timestamp: October 24, 2019, 09:05:48 pm
content: Aaaand we're live on Tindie and Digikeyhttps://www.tindie.com/products/suburbanembedded/hadou-can-usb-can-fd-adapterhttps://www.digikey.com/product-detail/en/suburban-embedded/SM-1301-C01-BARE/2587-SM-1301-C01-BARE-ND/12149332Quickstart Guidehttps://docs.suburbanmarine.io/public/hadoucan/doc/Hadou-CAN_Quickstart_Guide.pdfDatasheethttps://docs.suburbanmarine.io/public/hadoucan/doc/Hadou-CAN_Datasheet.pdfUser Guidehttps://docs.suburbanmarine.io/public/hadoucan/doc/Hadou-CAN_User_Guide.pdf

author: rounin
author_rank: Regular Contributor
timestamp: May 12, 2020, 04:47:28 am
content: Fixed a bunch of bugs, going to release a new firmware ~ end of the monthFixes notification endpoint. Bug in USB code broke all endpoints other than 0 and 1...Move usb driver to interrupt mode, Reduce log chatter so USB is fasterEnables FD BRS RX by defaultAdds a 'b' and 'B' command for per-packet FD BRS settingAdds synchronization to the bootloader script, so it should stop hanging if the host probes the serial portBootloader code is re-releasedContinuous integration builds are available via github actionsBootloader is moved tohttps://github.com/suburbanembedded/hadoucan-bootloader-fwI'm going to try to patch slcand and see if upstreamhttps://github.com/linux-can/can-utilswill take a patch to extend slcand for CAN FD, with new b, B, f, F commands.

author: rounin
author_rank: Regular Contributor
timestamp: July 31, 2020, 10:39:53 pm
content: We made a little quickstart video:

author: Renate
author_rank: Super Contributor
timestamp: August 01, 2020, 12:23:05 pm
content: Quote from: rounin on July 22, 2019, 06:26:16 amThe link isn't good and there is nothing to be found starting at the home page or "shop".

author: coromonadalix
author_rank: Super Contributor
timestamp: August 01, 2020, 12:29:25 pm
content: Same here tooIn the shop section there's only a plug ??

author: rounin
author_rank: Regular Contributor
timestamp: August 01, 2020, 07:54:02 pm
content: Quote from: Renate on August 01, 2020, 12:23:05 pmOops, that link is very old. I'll delete it. We're in the middle of making a new website, and haven't updated yet.Here are some new links:Docs:https://docs.suburbanmarine.io/public/hadoucan/doc/Hadou-CAN_User_Guide.pdfhttps://docs.suburbanmarine.io/public/hadoucan/doc/Hadou-CAN_Quickstart_Guide.pdfhttps://docs.suburbanmarine.io/public/hadoucan/doc/Hadou-CAN_Datasheet.pdfStore:https://www.tindie.com/products/suburbanembedded/hadou-can-usb-can-fd-adapter/https://www.digikey.com/product-detail/en/suburban-embedded/SM-1301-C01-ENC/2587-SM-1301-C01-ENC-ND/12149330https://www.digikey.com/product-detail/en/suburban-embedded/SM-1301-C01-BARE/2587-SM-1301-C01-BARE-ND/12149332

author: rounin
author_rank: Regular Contributor
timestamp: October 09, 2020, 06:08:03 am
content: Finally got around to implementing the CAN filters!Lawicel CAN232 (which I was striving for protocol compatibility with) uses the SJA1000 can controller, which has a rather limited filter/mask combo. But it is implemented now inhttps://github.com/suburbanembedded/hadoucan-fw/tree/iss7_message_filter, will get merged in a few days along with some more bug fixes.But SJA1000 can only mask the top 11 bits of an extended-id frame when in dual filter mode. The STM32H7 can have 64 full size extended-id filters. The STM32H7 is much better at filtering...How commonly does anyone actually use the filter/mask feature? Do you use the range filter mode?I want to add something more useful than the single / crippled SJA1000 compat dual filter but might only add support for up to all 64 of the simple id/mask "classic" mode filters unless people actually use the other modes.Informal poll?Do you useRange filter modeDual ID filter mode, with no maskRange filter with a single shared extended id mask (apparently useful/special for J1939)Otherwise i might just expose "Classic" filter/mask combos, 128x STD, 64x EXT through a new non-Lawicel compliant command.

author: rounin
author_rank: Regular Contributor
timestamp: October 09, 2020, 07:04:40 am
content: Another thought is the CPU could do whatever filtering you could want, it is certainly fast enough (up to 400MHz in this silicon version, 480MHz in silicon rev V+, although I have it set to 240MHz and thermal considerations probably apply at 400MHz+).Filter based on value of data fields? Filter based on hash of data? Implement a CAN Bus firewall rule in berkely packet filter (BPF) language?Kidding, but actually. It could be interesting to have user provided scripts or berkely packet programs run to filter packets.It might be interesting to have a multi CAN interface board act as a CAN gateway/router with BPF/iptables-like rules.

author: rounin
author_rank: Regular Contributor
timestamp: November 25, 2020, 05:07:07 am
content: I'm getting a TimeMachines TM2500B NTP/PTP server and try to do a demo with "real" GPS aligned timestamps and a time synchronized Ethernet & (TT)CAN Bus. Hoping to do some experimenting with both TTCAN and IEEE1588 PTP in the next few months.TTCAN will probably require some slcan protocol changes to let the USB host configure the TTCAN time parameters, matrix cycle, etc.

author: Menen
author_rank: Newbie
timestamp: March 20, 2021, 11:09:59 am
content: You need a binary to update.

author: rounin
author_rank: Regular Contributor
timestamp: March 24, 2021, 10:03:16 pm
content: Quote from: Menen on March 20, 2021, 11:09:59 amNot sure what you mean, there is an update script herehttps://github.com/suburbanembedded/hadoucan-fw/blob/master/bootload_enc.py.I haven't released a new build yet, but will have compiled fw binaries stored when I do.

author: rounin
author_rank: Regular Contributor
timestamp: July 08, 2025, 08:06:52 am
content: Finally got around to updating the firmware! Its been a crazy few years I guess.I switched the usb stack from my de novo code to hathach's tinyusb. This fixed some longstanding issues with endpoint lockup during host USB reset, eg if the device is given to a VM then returned back to the host OS without a power cycle it shouldn't lock up anymore. Tinyusb deals with the quirks of the usb peripheral better than I did.Also fixes a bug in the bootloader that could corrupt the application image in AXI sram during bootup - the STM32 H7 series has ECC on most of the sram, and can lose up to an ECC block worth of data if you reset the SOC without clearing out the ECC buffer. The bootloader protocol is changed from fastboot to standard usb DFU, so the application can now be updated using dfu-util on linux. Also switched from spiffs to littlefs, since littlefs seems to supports atomically renaming a file which lets me do a failsafe firmware update easier.Binaries are in a github release @ new urlshttps://github.com/suburbanmarine/hadoucan-bootloader-fwandhttps://github.com/suburbanmarine/hadoucan-fw. This new release requires updating both the bootloader and application as the handshaking between them and filesystem changed. Need JTAG/SWD to update the bootloader, it doesn't have an in-place update mode right now.