Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add airframe .post scripts on NuttX targets #12526

Merged
merged 2 commits into from
Jul 22, 2019

Conversation

jlecoeur
Copy link
Contributor

Describe problem solved by the proposed pull request
On POSIX targets, it is possible to add a .post script that will be run at the end of the startup.
See for example ROMFS/px4fmu_common/init.d-posix/1013_iris_vision.post.

On Nuttx targets, this is not supported.

Describe your preferred solution
Add support for .post scripts on NuttX targets.

Additional context
Similar to how ROMFS/px4fmu_common/init.d/rc.autostart is generated at compile time, this PR generates a new file ROMFS/px4fmu_common/init.d/rc.autostart.post which is called at the end of ROMFS/px4fmu_common/init.d/rcS.

Test example:

  • add a file ROMFS/px4fmu_common/init.d/airframes/4001_quad_x.post
  • with the following content mavlink stream -d /dev/ttyS1 -s DEBUG_VECT -r 2
  • add an entry 4001_quad_x.post in ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt
  • rebuild
  • the default rate for the mavlink message DEBUG_VECT is now 2Hz instead of 1Hz

@bkueng this is what we discussed on Slack. By default the new script is emtpy so it does not increase the flash usage.
@hamishwillee this should not affect the autogenerated airframe mardown file, but better double check.

bkueng
bkueng previously approved these changes Jul 22, 2019
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tools/px4airframes/rcout.py Outdated Show resolved Hide resolved
Tools/px4airframes/srcparser.py Show resolved Hide resolved
@bkueng bkueng mentioned this pull request Jul 22, 2019
@jlecoeur jlecoeur force-pushed the pr-nuttx_airframe_post_script branch from 70023eb to 4d25776 Compare July 22, 2019 10:03
@jlecoeur jlecoeur force-pushed the pr-nuttx_airframe_post_script branch from 4d25776 to ec68b49 Compare July 22, 2019 10:04
@jlecoeur
Copy link
Contributor Author

@bkueng Thanks for the review, I made the changes, can you review again?

Looks good, I assume

https://github.com/PX4/Firmware/blob/70023eb263d4b2381b6f653910c5fc240febb3ca/Tools/px4airframes/srcparser.py#L269
will filter the .post files, did you check that?

Yes, the .post files do not need to be parsed, so this is fine like this.

@bkueng bkueng merged commit e23e3d7 into master Jul 22, 2019
@bkueng bkueng deleted the pr-nuttx_airframe_post_script branch July 22, 2019 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants