Raspberry Pi SL (Single Core License): Binding codesyscontrol process to core 1 (affinity)

lefish
2021-06-10
2021-06-12
  • lefish - 2021-06-10

    Hi there,

    I am having troubles to bind the process /opt/codesys/bin/codesyscontrol.bin /etc/CODESYSControl.cfg
    to core 1 by evoking the following command

    sudo taskset -pc 1 $pid
    

    The process affinity changes from 0 to 1, but the process still runs on core 0.

    Note: I do not want any Multi-Core usage. Just Single-Core on a different core than 0.

    Not even after altering the script /etc/init.d/codesyscontrol in line 115 from

    while ! pidof -s $EXEC >$PIDFILE 2>/dev/null; do
    

    to

    while ! pidof -s taskset -c 1 $EXEC >$PIDFILE 2>/dev/null; do
    

    the process actually runs on core 0...

    Does anyone know the trick?

    Thanks!

     

    Last edit: lefish 2021-06-10
  • hermsen

    hermsen - 2021-06-10

    Shouldn't you still use a CODESYS RPi MC (Multicore license) for this?

    AFAIK a standard license without MC support will default balance the codesys processes over all CPU's and I doubt if this behaviour is easily changed.

     

    Last edit: hermsen 2021-06-10
  • lefish - 2021-06-10

    So you think, a Single-Core License is bound to Core 0 - which would be a pitty as there are 0-3 cores on a RPi...

    I see an affinity of the codesyscontrol-process of 0 as of standard on a Single-Core License - so would it be 0-3 on a Multi-Core License?

    And more so: Would it be possible to set the affinity of just one process (single application in my project) to one specific core on a Multi-Core License?

     
  • aliazzz

    aliazzz - 2021-06-12

    I only know that the main purpose of an MC license is setting up CPU core affinities (via the CodesysControl File) and enable PLC multi-threaded process programming. So I guess this anwsers your questions;

    https://store.codesys.com/codesys-control-for-raspberry-pi-mc-sl.html?___store=en

    • Extension of the CODESYS Development System for binding individual IEC applications to different CPU cores

    • Debugging of the multicore application within CODESYS

    PS, you can try the MC license for free (2 hrs demo, after which you need to restart the runtime)so you try out if it meets your needs. Just open the CODESYS IDE, and select the MC license instead of the Normal license.

    Good luck!

     

    Last edit: aliazzz 2021-06-12

Log in to post a comment.