RIP asmsoftware.de

Meine alte Domain war bislang werbefinanziert und da auch nur eine Weiterleitung. Der Provider will zukünftig  Geld dafür haben. Es war aber unklar, ob damit die Werbung verschwindet oder nicht. Ich hatte sie seit 2000 oder 2001 in Betrieb, seit meinem ersten Semester in Clausthal.

Da die zugehörige Emailadresse dazu auch schon lange verspammt war, habe ich jetzt entschieden, die Domain aufzugeben. Ich bin ja hier versorgt und brauche daher nicht doppelt zu zahlen.

Eine Übernahme der Domain habe ich erstmal ausgeschlossen. Wer weiß welcher Chinese sie kauft…

Daher RIP und auf Wiedersehen! Ich bin hier ja weiterhin gut erreichbar und ASM Software lebt weiter.

STM32 HAL Library für die “Blue pill”

Seit einiger Zeit kann man die sogenannte “Blue Pill” kaufen. Dies sind Mikrocontroller aus der STM32 Familie mit Cortex Kern, konkret STM32F103C8 mit Cortex M3, die auf einem schönen klassischen DIL-Träger aufgelötet sind mit Pinheader und Micro-USB zur Stromversorgung ausgerüstet sind. Dadurch passt alles in ein Steckbrett und kann auch als Arduino betrieben werden.

Ich habe mir ein paar Exemplare beschafft und möchte diese natürlich mehr oder minder “bare metal” benutzen, ähnlich wie ich das im Beruf auch tue. Dort arbeite ich seit gut 7 Jahren ebenfalls mit STM32 Controllern.

ST Microelectronics stellt eine recht gute Bibliothek zum Ansprechen der Controllerperipherie zur Verfügung. Damit man diese nicht immer mit jedem noch so kleinen Projekt von Null auf übersetzen muss, habe ich mir mit CMake ein kleines Framework geschrieben, welches die Library für den konkreten Controller der “Blue Pill” als Binary übersetzt.

Ausprobiert habe ich die Library noch nicht, aber es baut und linkt. Eigentlich müsste das schon reichen, das .a File wird im neuen Projekt referenziert und der Includepfade zu der Headern der HAL Library mitangegeben.

Der Anwender muss ggfs. die STM32 Header für den Controller in seinem Projekt referenzieren, denn einige Headerfiles der HAL Library ziehen die controllerspezifischen Header nochmal rein.

Näheres und technische Updates gibt es auf der Projektablage bei Github:
https://github.com/simonsunnyboy/stm32hal_bluepill

Ich habe den heute aktuellen Stand der HAL Library eingebunden, speziell den vom CubeMX angelegten, STM32Cube_FW_F1_V1.8.0.

Binary to Wozmon

(c) 2019 by Matthias Arndt <marndt@asmsoftware.de>
The MIT License applies to this project.

Abstract

This is a little file tool to dump a binary file in the format used by the
Wozmon monitor software used by the Apple 1.

The output can directly be fed into a serial link if necessary.

System requirements

  • C99 compliant compiler and runtime environment

Usage


$ bin2woz <loading address> <input file>

The loading address is given in 4 hexadecimal digits without prefix.
The output is dumped to stdout including CR/LF for Wozmon.

Example


$ bin2woz 0280 my_program.bin

Download

The project can be found for download at https://github.com/simonsunnyboy/bin2woz

ASM Software Unittest Framework

(c) 2016 by Matthias Arndt marndt@asmsoftware.de

The MIT License applies to this project. Please refer to the file COPYING for details.

The software is available on GitHub at https://github.com/simonsunnyboy/UnittestFramework

Abstract

This is a small framework to implement unittests for software written in C. There are existing projects that offer much more functionality, this one focuses on simple usability and textual output of statistics.

Main reason to implement this framework was that cunit was too complicated in usage and no other small free frameworks could be found.

System requirements

  • Cmake to build the example project
  • a C99 compliant C compiler but a C90 one will do if stdint.h and stdbool.h are supplied
  • any operating system of your choice

Using the test framework

A test should be a subfunction or the main function of an appropriate test executable.

Use the macros defined in unittest.h and link your project with unittest.c

Wrap the Test with UT_BEGIN() and UT_END() macros for proper structuring. Most commands should describe themselves.

It is allowed to start another test for entirely different content with the UT_BEGIN() macro if the last test finished with the UT_END() macro.

Start uIPTool utility for AUTO folder

uIPTool is great to allow easy access to Atari ST files via network without having to configure complete NFS or FTP setups.

As I ran into network problems and had to manually restart the tool from time to time, I wrote a small utility that allows to tweak the AUTO boot sequence to run uiptool either once or in a repeating fashion.

In the latter mode, the tool is restarted after crashing or undesired termination (e.q. I accidentally hit SPACE on the Falcon keyboard and the tool stopped amidst in a 50MB download)

Abstract

This is a utility for the Atari ST AUTO folder.
It allows to run the uIPTool (https://bitbucket.org/sqward/uip-tools)
at system startup without having to manually click on the desktop.

Place it in AUTO folder before running MiNT/MagiC or any network stacks like STING.

System requirements

– Atari ST or compatible computer
– uIPTool and a compatible Atari NIC (Netusbee, Hydra)

Installation

1. copy uIPTool as UIP.TOS in the root of your boot drive
2. place STARTUIP.PRG in your AUTO folder (preferrably at the beginning)
3. reboot

Operation

– The tool waits until 5s timeout for keyboard input.
– If there is no keyboard input, the AUTO boot sequence is resumed.
– Press ‘U’ to activate uIPTool once. Boot continues after its termination.
– Press ‘R’ to activate uIPTool in repeating mode.

## Repeating mode

In repeating mode uIPTool is started.
When the tool crashes or terminates, the user can quit and resume the
system boot sequence if desired.
After a small timeout of 5s uIPTool will start again.

I had troubles on my LAN with lossing connection and it was tedious
to restart uIPTool by hand in these cases.

Download

The source code and executable can be downloaded at https://github.com/simonsunnyboy/startuip

Finite State Machine Generator for C

For quite a long time I’m thinking about simple code generating tools. I don’t want to use a special XML syntax or descriptive language but a simple Excel or OpenOffice sheet instead.

The aim is to generated C source code for small microcontroller applications or retrocomputing systems.

For the start I made a simple generator for finite state machines (Wikipedia entry)

It is also my first script written in Python and thus not really as tidy and neat as I prefer. But it is working for now.

It takes the sheet from an OpenOffice .ods table like this:

@brief autofire button statemachine
@see    
     
State Event Next State
INIT KeyPressed PULSE_ON
INIT KeyNotPressed AUTOFIRE_OFF
AUTOFIRE_OFF KeyPressed PULSE_ON
PULSE_ON KeyNotPressed AUTOFIRE_OFF
PULSE_ON PulseTimeElapsed PULSE_OFF
PULSE_OFF KeyNotPressed AUTOFIRE_OFF
PULSE_OFF PulseTimeElapsed PULSE_ON

and generates a switch-case style state machine in C with callback functions for state and event handling.

A version with support for object oriented programming with pointers to statemachine objects is planned aswell. Check the github for functional updates.

The actual code can be found on Github: https://github.com/simonsunnyboy/gen-fsm

Ebookkonvertierung mit Thunar

Mein Kindle unterstützt Ebooks im MOBI Format, aber leider nicht das stärker verbreitete Epubformat. Heute wollte ich ein paar EBooks mit .epub nach .mobi konvertieren und das natürlich gleich komfortabel per Mausklick erledigen.
Die Konvertierung selbst wird von Calibre und seinen Werkzeugen durchgeführt.

Für die Integration in XFCE und Thunar habe ich mir einfach eine “Benutzerdefinierte Aktion” alias Custom Action in Thunar definiert und Dateien mit Endung .epub zugeordnet. Da das Konvertierungstool Ausgaben erzeugt, wird diese in einem eigenen Terminalfenster angezeigt, welches man nach erledigter Konvertierung einfach schliessen kann. Dazu habe ich ein einfaches Shellskript geschrieben, dem man den Dateinamen samt Pfad zum *.epub übergibt. Die konvertierte Ausgabedatei bekommt automatisch die Endung .mobi zugeteilt.

Das Skript wird von der Custom Action mit Parameter %f aufgerufen und sieht so aus:


#!/bin/bash
#
# Thunar helper to convert *.epub to *.mobi with Calibre
#
# Syntax: thunar-convert-epub-to-mobi.sh
#
# (c) 2016 by Matthias Arndt
# The GNU General Public License v2 applies.
#
# extract pathname and filename without extension
basename=$(basename "${1}")
filename="${basename%.*}"
#
xfce4-terminal -T "MOBI Conversion result" -H -x ebook-convert "${1}" "${filename}.mobi"

ClamAV in Thunar einbinden

Ab und an möchte man auch unter Linux Dateien nach Viren scannen. Da ich meistens doch über graphische Oberflächen arbeite, habe ich mir ClamAV im Thunar unter XFCE eingebunden. Dies geschieht als “Custom Action” aktiv für alle Dateien.

Ich habe mich grob an die Anleitung unter http://blog.quiptime.com/node/28 gehalten. Das Skript habe ich ein bißchen erweitert und für die Verwendung von zenity umgebaut.

Das Skript sieht dann bei mir so aus:

#!/bin/bash
#!/bin/bash # # clamavscan 0.1, 05.10.2006 # # by Siegfried Neumann, www.quiptime.com # Zenity output and desktop notify by Matthias Arndt <marndt@asmsoftware.de> # # Used by Thunar with a custom action. # Custom action: clamavscan %f # TITLE="ClamAV Scan" SCANUSER=`whoami` LOGDATE=`date +"%Y-%m-%d %T"` LOGDATE_FNAME=`date +"%Y%m%d.%H%M%S"` LOGFILE="/tmp/clamavscan-$SCANUSER-$LOGDATE_FNAME.log" notify-send 'ClamAV Scan' "started" echo "ClamAV Scan Log $LOGDATE " > $LOGFILE echo "" >> $LOGFILE echo "Report location: $LOGFILE" >> $LOGFILE echo "" >> $LOGFILE echo "--------------------------------------------------------------------------" >> $LOGFILE echo "" >> $LOGFILE chmod 600 $LOGFILE clamscan -r "$1" >> $LOGFILE if [ $? -eq 0 ] then notify-send 'ClamAV Scan' "No virus found" else zenity --title "$TITLE $LOGDATE" --error --text="One or more virii found!" fi zenity --title "$TITLE $LOGDATE" --text-info --width 500 --height 400 --filename=$LOGFILE case $? in 0) echo "Finished.";; 1) xdg-open $LOGFILE;; 255) echo "Box closed.";; esac