Skip to main content

Posts

On CRCs and CRC Reverse Engineering

Last week I ran into this interesting CRC Reverse Engineering challenge at Stackoverflow . I immediately felt this is something I should be able to figure out using our Docklight Scripting tool , and indeed I managed to find the correct CRC within two hours. (Update 2016 - the Docklight CRC Finder also found the answer for this second CRC puzzle .) Now here are my personal sentiments about CRC: The fact that the most frequently cited reference is called  A Painless Guide to CRC Error Detection Algorithms  only proves - it's painful. It really is. So if you are with CRC aches, too, here is my personal list of painkillers on the subject: Sven Reifegerte's great Online CRC Calculator  and his related C sample implementations . A somewhat comforting article about  CRC Implementation Code in C . This article was originally called "Easier said than done (Michael Barr) - A guide to CRC calculation", and I much respect the honesty.  The Boost CRC Library documena
Recent posts

Windows DLL for Microchip PIC32 firmware update / UBL bootloader

Update 2017: Microchip now has a Qt 5 example in their MLA folder "apps\usb\device\bootloaders\utilities". It uses the popular HIDAPI by Alan Ott / Signal 11.   It makes the below approach obsolete , and I really recommend to download and check out the Microchip MLA package instead. ============================================== While working on a Microchip PIC32 based USB HID Composite Device for our Kickdrive environment, we realized the need for updating the PIC application firmware from our own UI, instead of using an external tool.  Firmware updates for any Embedded device or accessory are an essential part of product support and should be done in the least disrupting way. So even launching an external Windows command line tool did not look like a good solution to us. What I found was Microchip's own sample code  from  Application Note AN1388 , but the PIC32UBL.exe code was MFC / Visual Studio 2003 and not designed to be anything else than a GUI applic

Python syntax highlighting for QTextEdit C++/Qt

We were in need for some basic Python syntax highlighting in a QTextEdit box, and didn't immediately want to go fully pro with a Scintilla wrapper. (Update: We did that, too, in the end, according to this scintilla/qt post ). So we looked for a QSyntaxHighlighter subclass for Python formatting, but only found a PyQt example  which seems to be from Torsten Marek (  shlomme.diotavelli.net  ) originally. I asked Frankie to create a C++  Qt4 QSyntaxHighlighter class based on this, so here it is: /* $Id: PythonSyntaxHighlighter.cpp 167 2013-11-03 17:01:22Z oliver $ This is a C++ port of the following PyQt example http://diotavelli.net/PyQtWiki/Python%20syntax%20highlighting C++ port by Frankie Simon ( www.kickdrive.de , www.fuh-edv.de ) The following free software license applies for this file ("X11 license"): Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"

Qt Developer Days 2013, Europe

I'll be heading to the Qt Developer Days in Berlin next week. We answered the call for their Lightning Talks , a 10 minute talk on a Qt related subject, and we will showcase our code & gear. Presenter: Oliver Heggelbacher & Frankie Simon Abstract: fullmo Kickdrive – Qt Quick in Industry Automation Or - how to give users a dynamic playground, while hiding away the complex machinery behind it. The Kickdrive software platform is a multi-layered and multi-language approach to industrial machine configuration and control. Qt Quick allows for beautiful and highly adaptable user interaction on top of a C++/QWidget application. In Kickdrive, the QML files are part of the project data – something that comes as a ready-to-use template, but the users can hack and change it to their liking. They touch up, tweak and extend their project UIs, evolving into co-developers of sorts. We will show off how we cross boundaries and connect the dots: from the Qt Quick UI via Python Sc

ASCII TCP protocols in Windows ANSI C or C++

My recent project work included applications with a servo drive controller that offers a simple text-based protocol via TCP. We many times explain this to our clients as the fastest way to integrate the drive, especially if their part is a standalone Windows software project that does not already have any fieldbus communications up and running.  But to our own surprise, discussions went frequently like this: “We recommend the direct TCP interface - this is so much easier than adding extra Ethercat or Profinet equipment for this purpose.“ “Yes, but how does TCP work? ” “Easy. Just open a TCP client connection to the drive controller, and send these simple ASCII commands.” “Yes, but I have no idea about TCP connections. Don’t you have a simple DLL for this?” So we decided to help out and make a DLL indeed. Not one that implements the servo controller interface, but a simplistic and generic way of processing text-based protocols and dealing with the TCP socket connection. And I felt