From 5494316ed1e43dbe73a8f8fea08cffef659db528 Mon Sep 17 00:00:00 2001 From: Ingmar Splitt Date: Sat, 27 Apr 2024 15:16:36 +0200 Subject: [PATCH] switch back to regular kernel (non RT) --- .github/workflows/build_pru_gcc.yml | 6 ------ deploy/roles/maintenance/defaults/main.yml | 4 ++-- software/kernel-module/src/pru_sync_control.c | 7 ++++--- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_pru_gcc.yml b/.github/workflows/build_pru_gcc.yml index e8cdd81d..a1a92fc1 100644 --- a/.github/workflows/build_pru_gcc.yml +++ b/.github/workflows/build_pru_gcc.yml @@ -78,9 +78,3 @@ jobs: make PROTO=SBW ${{ env.PRU_GCC }}/bin/pru-size gen_gcc/pru0-programmer-SBW-fw.elf working-directory: "software/firmware/pru0-programmer/" - - - name: Build Sync (GPIO-Event) 🧱 - run: | - make - ${{ env.PRU_GCC }}/bin/pru-size gen_gcc/pru1-sync-fw.elf - working-directory: "software/firmware/pru1-sync/" diff --git a/deploy/roles/maintenance/defaults/main.yml b/deploy/roles/maintenance/defaults/main.yml index 92c53eaf..5ed235f5 100644 --- a/deploy/roles/maintenance/defaults/main.yml +++ b/deploy/roles/maintenance/defaults/main.yml @@ -7,6 +7,6 @@ maintenance_delete_unused_files: true # rule config maintenance_default_kernel: lts-4_19 -maintenance_kernel_pin: "linux-image-4.19.94-ti-rt-r74" # 2023-10-02: r74 was newest -# RT -> wanted for ptp and phc2sys (more reliable) +maintenance_kernel_pin: "linux-image-4.19.94-ti-r74" # 2024-04-27: r74 was newest +# -rt -> used for more reliable ptp & gpio-triggering, BUT communication with PRU fails maintenance_timezone: Europe/Berlin diff --git a/software/kernel-module/src/pru_sync_control.c b/software/kernel-module/src/pru_sync_control.c index 105c3f47..c410eda1 100644 --- a/software/kernel-module/src/pru_sync_control.c +++ b/software/kernel-module/src/pru_sync_control.c @@ -200,7 +200,8 @@ int sync_init(uint32_t timer_period_ns) trigger_loop_period_kt = ns_to_ktime(trigger_loop_period_ns); //printk(KERN_INFO "shprd.k: new timer_period_ns = %u", trigger_loop_period_ns); - hrtimer_init(&trigger_loop_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS_HARD); + hrtimer_init(&trigger_loop_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); + // TODO: HRTIMER_MODE_ABS_HARD wanted, but _HARD not defined in 4.19 (without -RT) trigger_loop_timer.function = &trigger_loop_callback; /* timer for Sync-Loop */ @@ -208,7 +209,7 @@ int sync_init(uint32_t timer_period_ns) sync_loop_timer.function = &sync_loop_callback; init_done = 1; - printk(KERN_INFO "shprd.k: pru-sync-system initialized"); + printk(KERN_INFO "shprd.k: pru-sync-system initialized (wanted: hres, abs, hard)"); printk(KERN_INFO "shprd.k: trigger_hrtimer.hres = %d", hrtimer_is_hres_active(&trigger_loop_timer)); @@ -268,7 +269,7 @@ void sync_start(void) } hrtimer_start(&trigger_loop_timer, ts_now_kt + ns_to_ktime(ns_to_next_trigger), - HRTIMER_MODE_ABS_HARD); + HRTIMER_MODE_ABS); // was: HRTIMER_MODE_ABS_HARD for -rt Kernel hrtimer_start(&sync_loop_timer, ts_now_kt + ns_to_ktime(1000000), HRTIMER_MODE_ABS); printk(KERN_INFO "shprd.k: pru-sync-system started");