Jump to content

indianajones

Members
  • Posts

    16
  • Joined

  • Last visited

Reputation Activity

  1. Like
    indianajones got a reaction from lanefu in Fast interrupt handling in AllWinner H3 using Linux Kernel Module   
    Good news! I was able to follow the devmem2 instructions in this forum article posted by @Ohms, and get all 26 pulses (by modifying the debounce timer).  Result!
  2. Like
    indianajones got a reaction from lanefu in Real time operating system   
    I was able to successfully build and run PREEMPT_RT with a current kernel running Ubuntu focal on a nanopineo, getting these results in cyclictest:
    sudo cyclictest --mlockall --smp --priority=80 --interval=200 --distance=0 # /dev/cpu_dma_latency set to 0us policy: fifo: loadavg: 1.41 1.40 1.11 1/154 3261 T: 0 ( 3242) P:80 I:200 C:4589037 Min: 18 Act: 30 Avg: 25 Max: 125 T: 1 ( 3243) P:80 I:200 C:4588573 Min: 17 Act: 23 Avg: 26 Max: 105 T: 2 ( 3244) P:80 I:200 C:4588088 Min: 18 Act: 32 Avg: 27 Max: 111 T: 3 ( 3245) P:80 I:200 C:4587408 Min: 18 Act: 30 Avg: 25 Max: 105  
    Steps to build your own:
     
    1. Build a normal armbian image, using current kernel and ubuntu focal for nanopineo (or your board), mostly to discover the full kernel version that gets built.  Note that, as is mentioned in this thread, the AllWinner-based boards do not get their code from the mainline Linux github repo, but rather from a forked repo at https://github.com/megous/linux/.  This repo is specified in ~/build/config/sources/families/include/sunxi_common.inc.  You do not need to make any changes to that file, I'm just noting it as an FYI.
    ./compile.sh BOARD=nanopineo BRANCH=current RELEASE=focal KERNEL_ONLY=no BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=no AUFS=no  
    2. Check the kernel version from the build output.  Currently, that version is 5.10.21.  Download the PREEMPT_RT patch that most closely matches the kernel version.  NOTE: maybe you can download *any* RT patch file version that's at least the same or newer, but I went with the same because it makes sense to me:
    cd build/userpatches/kernel/sunxi-current # You'll probably have to mkdir the sunxi-current folder the first time wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patch-5.10.21-rt34.patch.gz gunzip patch-5.10.21-rt34.patch.gz  
    3.  Build another armbian image, this time with an extra parameter, EXTRAWIFI=no.  I've discovered that the patch-5.10.xx-rtYY.patch files somehow cause at least one of the Realtek Wifi drivers to throw a compiler error (in the rt_spinlock code).  If you need Realtek Wifi (and any other Wifi built by EXTRAWIFI=yes, you'll have to find another solution.  Sorry.
     
    Also, I now set KERNEL_CONFIGURE=yes because I think that it won't let  you choose "Full PREEMPT_RT" without you setting KERNEL_CONFIGURE=yes.  So when prompted during the build, choose option 4 (full PREEMPT):
    ./compile.sh BOARD=nanopineo BRANCH=current RELEASE=focal KERNEL_ONLY=no BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes AUFS=no EXTRAWIFI=no  
    4. From there, just deploy the image like you do any other image.
    uname -a Linux nanopineo 5.10.21-rt34-sunxi #trunk SMP PREEMPT_RT Sun Apr 18 22:21:06 EDT 2021 armv7l armv7l armv7l GNU/Linux  
    Note that I also created a ~/build/userpatches/lib.config file that limited the CPU frequency to a paltry 480Mhz fixed value because I don't have a heat sink on the H3:
    GOVERNOR=performance CPUMIN=480000 CPUMAX=480000  
     
    Q: Is this possible with the legacy kernel?
    A: Probably, if you use EXTRAWIFI=no, but I haven't tested it.  Both legacy and current kernels had compiler failures for various reasons, but most frequently with RealTek.
     
    Q: Will this work for any AllWinner SoC?
    A: I'm pretty sure that any H2/H3 AllWinner will work, as they are the same chipset as the nanopineo I'm using.  I don't know about H5 or A-series.
     
    Q: I thought tparys told you that any version of PREEMPT_RT might not give you the determinism you need to read wiegand?
    A: Yes, and I still agree, but this was just bugging me that I couldn't successfully build one.
     
  3. Like
    indianajones got a reaction from tparys in Real time operating system   
    I was able to successfully build and run PREEMPT_RT with a current kernel running Ubuntu focal on a nanopineo, getting these results in cyclictest:
    sudo cyclictest --mlockall --smp --priority=80 --interval=200 --distance=0 # /dev/cpu_dma_latency set to 0us policy: fifo: loadavg: 1.41 1.40 1.11 1/154 3261 T: 0 ( 3242) P:80 I:200 C:4589037 Min: 18 Act: 30 Avg: 25 Max: 125 T: 1 ( 3243) P:80 I:200 C:4588573 Min: 17 Act: 23 Avg: 26 Max: 105 T: 2 ( 3244) P:80 I:200 C:4588088 Min: 18 Act: 32 Avg: 27 Max: 111 T: 3 ( 3245) P:80 I:200 C:4587408 Min: 18 Act: 30 Avg: 25 Max: 105  
    Steps to build your own:
     
    1. Build a normal armbian image, using current kernel and ubuntu focal for nanopineo (or your board), mostly to discover the full kernel version that gets built.  Note that, as is mentioned in this thread, the AllWinner-based boards do not get their code from the mainline Linux github repo, but rather from a forked repo at https://github.com/megous/linux/.  This repo is specified in ~/build/config/sources/families/include/sunxi_common.inc.  You do not need to make any changes to that file, I'm just noting it as an FYI.
    ./compile.sh BOARD=nanopineo BRANCH=current RELEASE=focal KERNEL_ONLY=no BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=no AUFS=no  
    2. Check the kernel version from the build output.  Currently, that version is 5.10.21.  Download the PREEMPT_RT patch that most closely matches the kernel version.  NOTE: maybe you can download *any* RT patch file version that's at least the same or newer, but I went with the same because it makes sense to me:
    cd build/userpatches/kernel/sunxi-current # You'll probably have to mkdir the sunxi-current folder the first time wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patch-5.10.21-rt34.patch.gz gunzip patch-5.10.21-rt34.patch.gz  
    3.  Build another armbian image, this time with an extra parameter, EXTRAWIFI=no.  I've discovered that the patch-5.10.xx-rtYY.patch files somehow cause at least one of the Realtek Wifi drivers to throw a compiler error (in the rt_spinlock code).  If you need Realtek Wifi (and any other Wifi built by EXTRAWIFI=yes, you'll have to find another solution.  Sorry.
     
    Also, I now set KERNEL_CONFIGURE=yes because I think that it won't let  you choose "Full PREEMPT_RT" without you setting KERNEL_CONFIGURE=yes.  So when prompted during the build, choose option 4 (full PREEMPT):
    ./compile.sh BOARD=nanopineo BRANCH=current RELEASE=focal KERNEL_ONLY=no BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes AUFS=no EXTRAWIFI=no  
    4. From there, just deploy the image like you do any other image.
    uname -a Linux nanopineo 5.10.21-rt34-sunxi #trunk SMP PREEMPT_RT Sun Apr 18 22:21:06 EDT 2021 armv7l armv7l armv7l GNU/Linux  
    Note that I also created a ~/build/userpatches/lib.config file that limited the CPU frequency to a paltry 480Mhz fixed value because I don't have a heat sink on the H3:
    GOVERNOR=performance CPUMIN=480000 CPUMAX=480000  
     
    Q: Is this possible with the legacy kernel?
    A: Probably, if you use EXTRAWIFI=no, but I haven't tested it.  Both legacy and current kernels had compiler failures for various reasons, but most frequently with RealTek.
     
    Q: Will this work for any AllWinner SoC?
    A: I'm pretty sure that any H2/H3 AllWinner will work, as they are the same chipset as the nanopineo I'm using.  I don't know about H5 or A-series.
     
    Q: I thought tparys told you that any version of PREEMPT_RT might not give you the determinism you need to read wiegand?
    A: Yes, and I still agree, but this was just bugging me that I couldn't successfully build one.
     
  4. Like
    indianajones got a reaction from lanefu in Real time operating system   
    NicoD, your YouTube videos are why I chose Armbian.  I think the Armbian tools are awesome, and I'm grateful to those who created and maintain it.
  5. Like
    indianajones got a reaction from Igor in Real time operating system   
    C language was all I did - last century! I'd love to contribute any changes I need to make, but at the moment, the language is barely recognizable anymore. Such a shame.
  6. Like
    indianajones got a reaction from Werner in Real time operating system   
    NicoD, your YouTube videos are why I chose Armbian.  I think the Armbian tools are awesome, and I'm grateful to those who created and maintain it.
  7. Like
    indianajones got a reaction from NicoD in Real time operating system   
    NicoD, your YouTube videos are why I chose Armbian.  I think the Armbian tools are awesome, and I'm grateful to those who created and maintain it.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines