You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "JianyuWang0623 (via GitHub)" <gi...@apache.org> on 2026/10/15 16:20:57 UTC

[PR] system/nxinit: use per-core trigger key [nuttx-apps]

JianyuWang0623 opened a new pull request, #3852:
URL: https://github.com/apache/nuttx-apps/pull/3852

   ## Summary
   
   `trigger X` / `on X` go through a single shared key "default"; once that
   key is shared between instances, one instance's trigger re-runs the same
   "on" actions on the others. Give each init instance its own trigger key
   instead:
   
   - `init.trigger.core<N>` under `CONFIG_BMP` (N from `sched_getcpu()`);
   - `init.trigger.<cpuname>` under `CONFIG_RPMSG_LOCAL_CPUNAME`;
   - `init.trigger` otherwise.
   
   `CONFIG_BMP` takes precedence over `CONFIG_RPMSG_LOCAL_CPUNAME`.
   
   ## Impact
   
   On the in-tree simple backend nothing is persisted or shared, so behavior
   is unchanged apart from the key rename (`default` -> `init.trigger`), which
   is transparent to `trigger X` / `on X`. Cross-core isolation comes with a
   shared property backend.
   
   ## Testing
   
   sim:nsh (host build) and sim:smp (`CONFIG_SMP=y`, 4 simulated CPUs):
   
   * boot sequence unchanged: `on boot` -> `trigger init` -> `on init` ->
     console service starts, nsh prompt works (`uname`, `ps`);
   * `trigger`/`on` chains (`on boot` -> `trigger testevt` -> `on testevt`
     -> `trigger testevt2` -> `on testevt2`) each execute exactly once per
     trigger;
   * debug log shows the new key (previously `key:default`):
   
   ```
   Setprop key:init.trigger value:boot
   Trigger init.trigger==testevt
   executed command 'echo ...' pid 5
   Started service 'console' pid 10
   ```
   
   qemu-armv8a:nsh_smp (`qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic
   -machine virt,virtualization=on,gic-version=3 -kernel nuttx`; NuttX is built
   with `CONFIG_SMP_NCPUS=2`, so it brings up 2 of the 4 QEMU CPUs): same
   results; a single `init_main` instance runs and the key has no `.core<N>`
   suffix, as expected outside BMP.
   
   BMP key path (`init.trigger.core<N>`): compile-time exercise only with
   `-DCONFIG_BMP` (no BMP board config exists in tree). The binary contains
   the `init.trigger.core%d` format string and a sim:smp run logs
   `Setprop key:init.trigger.core0 value:boot`.
   
   All three files pass `tools/checkpatch.sh -f`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] system/nxinit: use per-core trigger key [nuttx-apps]

Posted by "JianyuWang0623 (via GitHub)" <gi...@apache.org>.
JianyuWang0623 commented on PR #3852:
URL: https://github.com/apache/nuttx-apps/pull/3852#issuecomment-6210732387

   The only failing job is `Linux (arm-14)`: `stm32l0538-disco/nsh` overflows its flash region (`region 'flash' overflowed by 184 bytes`). The other red jobs were cancelled by fail-fast.
   
   This is unrelated to this PR:
   - `stm32l0538-disco:nsh` boots `nsh_main` and does not enable `SYSTEM_NXINIT`, so none of the changed files are built into it.
   - The same overflow already shows up on other PRs, e.g. [run 38811673520](https://github.com/apache/nuttx-apps/actions/runs/38811673520) and [run 38788750010](https://github.com/apache/nuttx-apps/actions/runs/38788750010) (136 bytes with nuttx `c3e180f3a`; 184 bytes here with nuttx `4b2aaf80e`), so the board is simply out of flash on current master.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] system/nxinit: use per-core trigger key [nuttx-apps]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #3852:
URL: https://github.com/apache/nuttx-apps/pull/3852


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] system/nxinit: use per-core trigger key [nuttx-apps]

Posted by "cederom (via GitHub)" <gi...@apache.org>.
cederom commented on PR #3852:
URL: https://github.com/apache/nuttx-apps/pull/3852#issuecomment-6213221020

   Thank you @JianyuWang0623 very nice idea.. we should also update documentation here please? :-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] system/nxinit: use per-core trigger key [nuttx-apps]

Posted by "JianyuWang0623 (via GitHub)" <gi...@apache.org>.
JianyuWang0623 closed pull request #3852: system/nxinit: use per-core trigger key
URL: https://github.com/apache/nuttx-apps/pull/3852


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] system/nxinit: use per-core trigger key [nuttx-apps]

Posted by "cederom (via GitHub)" <gi...@apache.org>.
cederom commented on PR #3852:
URL: https://github.com/apache/nuttx-apps/pull/3852#issuecomment-6213195465

   Yes its a known CI unrealted issue for a moment working on it :-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] system/nxinit: use per-core trigger key [nuttx-apps]

Posted by "JianyuWang0623 (via GitHub)" <gi...@apache.org>.
JianyuWang0623 commented on PR #3852:
URL: https://github.com/apache/nuttx-apps/pull/3852#issuecomment-6214917310

   > Thank you @JianyuWang0623 very nice idea.. we should also update documentation here please? :-)
   
   @cederom Please review this PR: https://github.com/apache/nuttx/pull/20701


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org