Monthly Archives: September 2014

Real Time Linux PREEMPT_RT

Real-Time Linux Wiki
OSADL – Open Source Automation Development Lab eG

Wikipedia

Xenomai (en)
RTAI (Real Time Application Interface) (en)
RTAI (Real Time Application Interface) (de)
RTLinux (de)

Tutorial

Getting real (time) about embedded GNU/Linux
Realtime Linux für Debian
Introducing Xenomai 3
How fast is fast enough? Choosing between Xenomai and Linux for real-time applications (PDF)

Eclipse Embedded for ARM

see blog.bachi.net mbed.org
see blog.bachi.net Regular Expression

  • Eclipse Neon (4.6)
  • Eclipse Mars (4.5)
  • Eclipse Luna (4.4)
  • Eclipse Kepler (4.3)
  • Eclipse Juno (4.2)

How to install the GNU ARM Eclipse plug-ins?
How to install the Windows Build Tools?
GNU ARM Eclipse plug-ins: Received fatal alert: handshake_failure

livius dot net – IT Design & Consulting – Creativity without borders

cross_make / cross_gcc not set

Invalid project path: Include path not found

Remove:
<entry kind="includePath" name="/${ProjName}/#undef __ARM_FP">
    <flag value="BUILTIN|READONLY|VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/#undef __ARM_FEATURE_FMA">
    <flag value="BUILTIN|READONLY|VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/#undef __ARM_NEON__">
    <flag value="BUILTIN|READONLY|VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/#undef __ARM_NEON">
    <flag value="BUILTIN|READONLY|VALUE_WORKSPACE_PATH"/>
</entry>

Add:
<language id="org.eclipse.cdt.core.gcc">
    <entry kind="includePath" name="C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q1-update/lib/gcc/arm-none-eabi/6.3.1/include">
        <flag value="BUILTIN|READONLY"/>
    </entry>
    <entry kind="includePath" name="C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q1-update/lib/gcc/arm-none-eabi/6.3.1/include-fixed">
        <flag value="BUILTIN|READONLY"/>
    </entry>
    <entry kind="includePath" name="C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q1-update/arm-none-eabi/include">
        <flag value="BUILTIN|READONLY"/>
    </entry>
</language>
    
<language id="org.eclipse.cdt.core.g++">
    <entry kind="includePath" name="C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q1-update/arm-none-eabi/include/c++/6.3.1">
        <flag value="BUILTIN|READONLY"/>
    </entry>
    <entry kind="includePath" name="C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q1-update/arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v8-m.main">
        <flag value="BUILTIN|READONLY"/>
    </entry>
    <entry kind="includePath" name="C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q1-update/arm-none-eabi/include/c++/6.3.1/backward">
        <flag value="BUILTIN|READONLY"/>
    </entry>
    <entry kind="includePath" name="C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q1-update/lib/gcc/arm-none-eabi/6.3.1/include">
        <flag value="BUILTIN|READONLY"/>
    </entry>
    <entry kind="includePath" name="C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q1-update/lib/gcc/arm-none-eabi/6.3.1/include-fixed">
        <flag value="BUILTIN|READONLY"/>
    </entry>
    <entry kind="includePath" name="C:/Program Files (x86)/GNU Tools ARM Embedded/6 2017-q1-update/arm-none-eabi/include">
        <flag value="BUILTIN|READONLY"/>
    </entry>
</language>

Standards

mbed: CMSIS-DAP
mbed: CMSIS-DAP Interface Firmware
GitHub: mbedmicro/CMSIS-DAP
Keil: CMSIS-DAP

Tutorials

Installing Eclipse for use with FreeRTOS.org
ARM-Projects by Martin THOMAS

Plugins

GNU ARM Eclipse Plug-ins with J-Link Debugging Support
GNU ARM Eclipse Plug-ins
Welcome to the EmbSysRegView Project
Eclipse Embedded Systems Register View, displays special function Registers (SFRs) while debugging

undefined reference to `__real_main'

link: ROME2_P1_A4.elf
../mbed/TARGET_NUCLEO_F446RE/TOOLCHAIN_GCC_ARM/retarget.o: In function `__wrap_main':
retarget.cpp:(.text.__wrap_main+0xa): undefined reference to `__real_main'
collect2.exe: error: ld returned 1 exit status

Solution:
add "-Wl,--gc-sections" to LD_FLAGS and LD

PThread / POSIX Thread

  • synchronization
  • threads
  • barrier point
  • pthread_init()
  • sem_init()
  • pthread_barrier_init

“For real applications there are more polished libraries such as pthreads for kernel threads or GNU Portable Threads (Pth) for user space threads.”

“The GNU Pth (GNU Portable Threads) scheduling itself is done in a cooperative way, i.e., the threads are managed by a priority- and event-based non-preemptive scheduler. The intention is that this way one can achieve better portability and run-time performance than with preemptive scheduling. The event facility allows threads to wait until various types of events occur, including pending I/O on filedescriptors, asynchronous signals, elapsed timers, pending I/O on message ports, thread and process termination, and even customized callback functions.”

Oracle Multithreaded Programming Guide
POSIX Threads Programming
POSIX thread (pthread) libraries
POSIX thread (pthread) libraries
Linux-UNIX-Programmierung – Threads
Parallele Programmierung mit Threads
Introduction to Multi-Threaded Programming, 1999
Eine Einführung in die Programmierung von Threads unter Linux
Implementing a Thread Library on Linux
GNU Pth – The GNU Portable Threads, 2006
Linux Threads Frequently Asked Questions (FAQ), 1996

Joinable and Detached Threads

Oracle Multithreaded Programming Guide: Set Detach State
Joining and Detaching Threads
Joinable and Detached Threads
Pthread create as detached

Thread (computing)
Light-weight process
Fiber (computer science)
Green threads
Thread (Informatik)
User-Thread
Native POSIX Thread Library (NPTL)

Alle Fäden in der Hand – Thread Programmierung unter Linux in C und C++ (Teil 1)
Alle Fäden in der Hand – Thread Programmierung unter Linux in C und C++ (Teil 2)

The Linux compatibility thread!

Thread-Programmierung mit Java

Oracle Multithreaded Programming Guide – Avoiding Deadlock

Map / Reduce

The one line of C code that will make your program ten times faster

Barriere

Semaphore

The Little Book of Semaphores

Monitor

Wikipedia: Monitor

PHP5

php5-5.4.20         PHP Scripting Language
php5-bz2-5.4.20     The bz2 shared extension for php
php5-ctype-5.4.20   The ctype shared extension for php
php5-dom-5.4.20     The dom shared extension for php
php5-exif-5.4.20    The exif shared extension for php
php5-fileinfo-5.4.20 The fileinfo shared extension for php
php5-filter-5.4.20  The filter shared extension for php
php5-gd-5.4.20      The gd shared extension for php
php5-hash-5.4.20    The hash shared extension for php
php5-iconv-5.4.20   The iconv shared extension for php
php5-json-5.4.20    The json shared extension for php
php5-mbstring-5.4.20 The mbstring shared extension for php
php5-mcrypt-5.4.20  The mcrypt shared extension for php
php5-mysql-5.4.20   The mysql shared extension for php
php5-openssl-5.4.20 The openssl shared extension for php
php5-pdo-5.4.20     The pdo shared extension for php
php5-pdo_mysql-5.4.20 The pdo_mysql shared extension for php
php5-posix-5.4.20   The posix shared extension for php
php5-session-5.4.20 The session shared extension for php
php5-simplexml-5.4.20 The simplexml shared extension for php
php5-snmp-5.4.20    The snmp shared extension for php
php5-xml-5.4.20     The xml shared extension for php
php5-zlib-5.4.20    The zlib shared extension for php
extension=mysql.so
extension=zlib.so
extension=bz2.so
extension=openssl.so
extension=mbstring.so
extension=json.so
extension=mcrypt.so
extension=xml.so
extension=session.so
extension=ctype.so
extension=gd.so
extension=fileinfo.so
extension=posix.so
extension=dom.so
extension=snmp.so
extension=simplexml.so
extension=iconv.so
extension=pdo.so
extension=pdo_mysql.so
extension=filter.so
extension=intl.so
extension=exif.so
extension=apc.so
extension=hash.so

Fatal error: Call to undefined function hash()

PHP5 Extensions

PHP 5.2.6 on FreeBSD with extensions

# /usr/local/bin/php -v
PHP 5.4.20 (cli) (built: Oct 13 2013 15:38:29)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Segmentation fault: 11 (core dumped)

# gdb /usr/local/bin/php php.core
[...]
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000806b33b1d in __do_global_dtors_aux () from /usr/local/lib/php/20100525/hash.so
#2  0x0000000806b46e25 in _fini () from /usr/local/lib/php/20100525/hash.so
#3  0x00007fffffffe9f0 in ?? ()
#4  0x00000008007f403a in find_symdef () from /libexec/ld-elf.so.1
#5  0x00000008007f48fe in dlclose () from /libexec/ld-elf.so.1
#6  0x00000000005c522d in module_destructor ()
#7  0x00000000005ce4b2 in zend_hash_apply_deleter ()
#8  0x00000000005ce60c in zend_hash_graceful_reverse_destroy ()
#9  0x00000000005bdf20 in zend_shutdown ()
#10 0x0000000000552fd5 in php_module_shutdown ()
#11 0x000000000066307a in main ()
(gdb)