1. inapp qmake install

    make install

    The easy way to install your Qt program with qmake is to add this to your .pro file:

    target.path = /usr/local/myprogram
    INSTALLS += target

    qmake will find itself what is the binary to copy to the target path. According to the documentation [1], only target and dlltarget …

    read more
  2. inapp software (OS) 2

    Now the operating system. Take two with Armbian.

    Step 1: Get the SD-card image

    Get the OS image Armbian_5.25_Nanopineo_Ubuntu_xenial_default_3.4.113.7z at [1].

    Step 2: Write the SD-card image

    Write the image to the SD-card (4GB min):

    sudo dd if=Armbian_5.25_Nanopineo_Ubuntu_xenial_default_3.4.113.img of=/dev/mmcblk0 …
    read more
  3. inapp software (OS)

    Now the operating system. Take one with the official image from FriendlyArm.

    Step 1: Get the SD-card image

    Get the OS image nanopi-neo-ubuntu-core-qte-sd4g-20170204.img.zip at [1].

    Step 2: Write the SD-card image

    Write the image to the SD-card (4GB min):

    sudo dd if=nanopi-neo-ubuntu-core-qte-sd4g-20170204.img of=/dev/mmcblk0 bs …
    read more
  4. inapp hardware

    Cute little ARM board (inner active ingredient) + Tiny 3D-printed housing (color plastic hull) + Transparent sticker (attractive branding) = your new medication for pretty printing.

    The Nano Pi NEO

    The Nano Pi Neo is a cheap Chinese ARM board with everything needed (Ethernet, On-the-Go USB) and a tiny 40x40mm form-factor [1].

    The …

    read more
  5. Lighttpd multiple base folders with vhost

    How to serve a website by merging multiple base folders?

    mod_alias is the answer! [1]

    alias.url += ( "/all" => "/opt/ina/all/www/" )
    alias.url += ( "/term" => "/opt/ina/term/www/" )


    server.modules += ( "mod_alias" )
    alias …
    read more
  6. Qt socket and systemd

    How to create a systemd-friendly QWebSocket server?

    Surprisingly, there does not seem to be any official Qt documentation for this use-case. Enjoy.

    Introduction to systemd socket-based services

    The keyword here is socket-based activation. [1]

    systemd will create the socket first and listen to incoming connections. On first incoming connection, the …

    read more
  7. About Linux kernel printk timestamps

    What is this timestamp in each kernel printk message?

    Quote from [1].

    Printk-time uses the routine sched_clock() in the kernel. On some platforms, sched_clock() only has a resolution of 1 jiffy (which may be 10 milliseconds or longer). This means that you will only see the time increment at this …
    read more
  8. Debian build image with virtualbox

    Prepare a Debian virtual image to build packages.

    Step 1: Get Debian install image

    Get the netinstall 248MB image (e.g., debian-8.7.1-amd64-netinst.iso) at this address [1], and start a new virtualbox machine.

    Only need a minimalistic system.


    Step 2: Prepare for package build

    A short introduction …

    read more
  9. SSH and user account without password

    Highly insecure!

    Step 1: Create user with no password

    Create a user with a password, and delete it later ([1]):

    root@inabox:/home/ina# adduser test
    [...give a password...]
    root@inabox:/home/ina# passwd -d test
    passwd: password expiry information changed.

    Step 2: Let the user log in

    In /etc …

    read more
  10. C++: enum range-based for loop

    Loop over all the members of an enumeration.

    #include <iterator>
    // Inspired from http://codereview.stackexchange.com/a/57699
    template<typename T, T... args>
    struct EnumIterAll
        : public std::iterator<
                                std::input_iterator_tag, // iterator_category
                                T,                       // value_type
                                std::ptrdiff_t,          // difference_type
                                const T*,                // pointer
                                const T&                 // reference
        static constexpr T values[] = {args...};
        static constexpr std …
    read more
  11. kprobes to DLT

    Initial example for setting a kernel tracepoint and forward the trace output over DLT (Autosar Diagnostic Log and Trace).

    Howto set a kprobe

    This example is taken straight out of the Linux kernel documentation at [1]. For details about the kprobes internals, see [2].

    # The tracing facility is in the …
    read more
  12. How Linux kprobes works

    How do Linux kernel probes (kprobes) work

    Everything below comes from reading kprobes.txt at [1].


    There are kprobes and jprobes. jprobes are specialized kprobes for function calls, making it easier to get the function parameters. It is usually useful to filter function call traces according to the value …

    read more
  13. GNU/Linux system performence

    What else is happening again?

    (process:704): GLib-WARNING **: poll(2) failed due to: Invalid argument.

    Using sysctl

    $ sysctl net.core.somaxconn
    net.core.somaxconn = 128
    $ find /usr/include -name socket.h
    /usr/include/x86_64-linux-gnu …
    read more
  14. Javascript onChange event and IME

    But wait! What happens when I use Chinese input? ...types CTRL+Space and start composing... Oh shit!~ [1]

    Capturing key strokes is nice, but it does not support virtual keyboard like on tablet or smartphones and more advanced input methods such as Chinese/Japanese or other writing systems.

    The problem …

    read more
  15. Reading UTF-8 from a pipe

    This works

    std::string l;
    // Read lines here
    while(std::getline(std::cin, l))
        // Send Unicode string
        emit newLine(QString::fromStdString(l));

    This works because \n (newline) is a single byte in UTF-8.

    This does not work

    char c;
    // Read bytes here
        // Send Unicode single …
    read more
  16. <KeyCode>-<TerminalCode>-<CharCode>

    A story which begins on the keyboard, goes through a pseudo-terminal, and ends up on the screen.

    Now that you love ptypipe (see previous post), we are ready to pipe everything and finally control gdb:

    $ makefifo input.cli
    $ python ptypipe.py "" "gdb -q" < input.cli | myGreatControlProgram > input.cli

    Step 1 …

    read more
  17. Yes, you want working completion in your gdb

    You can pipe commands to gdb, but how to have auto-complete on those commands?

    Naive attempts

    A initial little try is promising, we can pipe commands to gdb:

    ~$ echo "show endian" | gdb -q
    (gdb) The target endianness is set automatically (currently little endian)
    (gdb) quit

    The command show endian was …

    read more
  18. <CPU>-<vendor>-<OS>

    Questioning about the "target triplet" <CPU>-<vendor>-<OS> used by the GNU build system to describe a target

    When building gdb targeting a different platform, one must choose --host, --build, and --target parameters.

    The target parameter has the following format [1]:


    You can get the target of …

    read more
  19. OpenSearch plugin for inapp

    How to add an OpenSearch to your website

    OpenSearch is a standard way to make a webbrowser know that your page is actually a search engine. Mozilla [1] and Microsoft [2] explain you how to do it, but a quicker tutorial is found there [3].

    My own OpenSearch configuration file …

    read more
  20. HTML man pages

    Many websites host HTML rendering of man pages. How to make them yourself?

    Stackoverflow always has an answer for those questions [1].

    A tool without many dependencies is mandoc [2], and of course, it has its mandatory HTML man page there [3].

    ./mandoc -Thtml -Ostyle=mandoc.css ../man-pages-4 …
    read more
  21. Placeholder for profiling links

    Beware link wall ahead

    Stumbling upon this page [1] ended up in a massive recurssive tree search. A stack of links where kept here.

    Profiling with gdb

    Why not profiling your application by sampling backtraces using gdb? This intuitive idea is easily adapted to remote debugging as well. [2]

    If …

    read more
  22. Get the documentation of gcc command-line arguments

    gcc has an extensive documentation [1] in the texinfo format (.texi file extention). texinfo [2] can be converted into many different output formats, such as HTML, PDF, ...and generic XML.

    I would like to write a quick-and-dirty script to extract the description of each command-line argument of gcc. I could …

    read more
  23. How to record your screen into an animated gif?

    How to record your screen into an animated gif with precise position and size?

    I would like to create an animated gif with a size of 800x600px. The canva should contain a web browser in the top half, and a command-line terminal in the bottom half.

    Placing the windows via …

    read more
  24. Raspberry Pi initial setup

    Random notes

    Download the "Raspbian Jessie Lite" image:
    Writing the image:
    sudo dd bs=4M if=2016-05-27-raspbian-jessie.img of=/dev/sdd
    connect a screen on HDMI and check the My IP address is xxx
    To …
    read more
  25. Making your Raspberry "product"

    For your Raspberry-based "product" recipe, you'll need:
    • a custom GNU/Linux image (baking time: ~4h).
    • a custom extention board topping (flavor of your choice).
    Price: ★☆☆      Taste: ★★★      Difficulty: ★★☆

    Build a custom GNU/Linux image

    Yocto [1] is now a common solution for creating automated build of custom GNU/Linux images for …

    read more
  26. Little CommonAPI benchmark on Raspberry Pi 2

    Little benchmark of the CommonAPI example on a Raspberry Pi 2

    CommonAPI [1] is an open-source (Mozilla Public License 2.0) developped by BMW.

    It enables to abstract communication middleware (i.e., IPC) such as D-Bus [2] or SOME/IP [3].

    Little benchmark for E01HelloWorld

    The E01HelloWorld tutorial is found …

    read more
  27. Intel debug port for Atom

    How to debug an Atom processor over JTAG?

    Official presentation of the "Intel JTAG debugger" is [1].

    The standard Intel debug port is the 60-pin XDP (eXtended Debug Port). It extends JTAG with additional signals. This port also has a lower pin count variant: the 31-pin XDP-SSA (Second Side Attach …

    read more
  28. Finally the right Eclipse project configuration!

    I don't want a fully fledged Eclipse project or depend on heavy Eclipse for anything.~

    I don't know if you have the same feeling, but it doesn't look like a good idea to depend on one heavy tool for anything in your electronic project. Having easy-to-understand scripts for building or …

    read more
  29. Thinking about going USB

    The USB specs are pretty large.


    USB 2.0 specs [1]. Explanations [2].

    Good description of the protocol [3].

    Another source [4].

    Protocol analyzers

    USB communications can be spyed with:

    Software Wireshark (example video there [5]).

    Hardware OpenVizsla An Open-source FPGA-based USB sniffer [6]... based of the Xilinx Spartan …

    read more
  30. OpenOCD and STM32F446

    OpenOCD does know the STM32F446?

    Open On-Chip Debugger 0.8.0 (2014-05-10-23:20)
    Licensed under GNU GPL v2
    For bug reports, read
    Info : This adapter doesn't support configurable speed
    Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748 …
    read more
  31. I am on reddit, Woo-Hoo!

    I am trying to motivate me to do this project for months now, and I looked like nobody cared about it.

    Thanks to Google webmaster tools (not Google Analytics, I care about your privacy, dear reader), I was able to see which other site linked my blog. Reddit does it …

    read more
  32. STM32F4: Generating parallel signals with the FSMC

    The goal: The memory controller can be used to generate a "generic" 16-bit parallel data stream with clock. Address generation will be disregarded, as well as other control signals dedicated to memory chips.

    It must be noted that the STM32F40x and STM32F41x have the FSMC (static memories), while the STM32F42x …

    read more
  33. Spartan-6 configuration speeds

    Spartan-6 maximum JTAG clock is 18-33MHz according to "Table 3: Maximum JTAG Clock Frequencies" in [DS593] (v1.4, p. 8).

    The Spartan-6 at speed grade -1L is limited to 18MHz, while other speed grades (-2, -3N, and -3) allows a TCK of 33MHz. See "Configuration Switching Characteristics" in [DS162] (v3 …

    read more
  34. In the morning, everything works

    ...after finding a shortcut on the JTAG adapter board and burning an FPGA by connection the power supply the wrong way, in the morning, everything finally works together.

    Config/program access

    Microcontroller debug. access over SWD. The STM32F4x CPU is found:

    Open On-Chip Debugger 0.8.0 (2014-05-10-23:20)
    Licensed …
    read more
  35. STM32F4 and OpenOCD with flash erase error -304

    Quick post about OpenOCD and flash erase error -304.

    Getting the following error:

    Open On-Chip Debugger 0.8.0 (2014-05-10-23:20)
    Licensed under GNU GPL v2
    For bug reports, read
    Info : This adapter doesn't support configurable speed
    Info : STLINK v2 JTAG v17 …
    read more
  36. Nothing works!

    Buying a cheap analog multimeter at Conrad [1]... and having to repair it right out of the box!

    The discret wire connecting the battery to the voltmeter line was broken. Fortunately, this analog multimeter is so simple that you can reverse engineer it easily and find the issue.


    [1 …
    read more
  37. FLRe project overview

    Inside of the FLRe first complete prototype.

    The microcontroller and FPGA boards are inserted facing each other in the (upper and lower) PCB guide grooves of the enclosure.

    read more
  38. Desolder the microcontroller?

    Let's desolder the microcontroller?

    Damn, this is just standard solderwire, nothing to do with the desoldering alloy and its low melting point. Ordering mistake... (u_u)

    Result, went a bit medieval on the poor chip...

    read more
  39. STM32F4 JTAG: first tests

    The FLRe p1 microcontroller board is finished and ready for tests. First test? Trying to get the CPU chip id over JTAG.

    The target board uses a custom 0.5" JTAG header. Some home-made adapter are needed.

    Open On-Chip Debugger 0.8.0 (2014-05-10-23:20)
    Licensed under GNU GPL v2 …
    read more
  40. STM32F4 bare-metal start-up and real bit banging speed

    Last year, I made a post about the bit-banging capacities of the STM32F1 (ARM Cortex-M3) microcontroller. Here are some comparisons with the STM32F4 (Cortex-M4).

    STM32F4 bare metal start-up (no compiler libraries added)

    The STM32F4 runs at 168MHz CPU clock.

    Because my oscilloscope only goes up to 50MHz, I made a …

    read more
  41. OpenSTM32 and STM32CubeMX under Ubuntu 14.10

    This post is about using OpenSTM32 plugins for Eclipse and STM32CubeMX with Ubuntu 14.10.


    OpenSTM32 [1] is a project aiming at making embedded development for STM32 microcontroller easier with Eclipse. "System Workbench for STM32 - Bare Metal Edition" features are described at [2]. There is an all-in-one installer for …

    read more

« Page 2 / 4 »