PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

feat: configurable board pwm freq from Kconfig

Open Pedro-Roque opened this issue 7 months ago • 6 comments

Solved Problem

Allows for configurable board PWM frequency from Kconfig. For slow PWMs (like 10Hz) this value needs to change due to timer overflow on a 16bit register.

Solution

  • Add options to Kconfig and proper setting on platforms/nuttx

Changelog Entry

For release notes:

New parameter: CONFIG_BOARD_PWM_FREQUENCY

Alternatives

None me and @dagar could think of.

Test coverage

  • Unit/integration test: -
  • Simulation/hardware testing logs: -

Context

Spacecraft solenoid valves requiring slow PWM.

Pedro-Roque avatar Apr 30 '25 17:04 Pedro-Roque

@dagar all fixed, shold be good to go.

Pedro-Roque avatar May 22 '25 08:05 Pedro-Roque

Looks good now, but submodule changes slipped in.

dagar avatar Jun 04 '25 15:06 dagar

did you mean to include the gz submodule changes @Pedro-Roque ?

mrpollo avatar Jun 04 '25 15:06 mrpollo

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-june-4-2025-team-sync-and-community-q-a/45866/1

DronecodeBot avatar Jun 04 '25 15:06 DronecodeBot

@mrpollo fixed

Pedro-Roque avatar Jun 04 '25 18:06 Pedro-Roque

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 8 byte (0 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%      +8  +0.0%      +8    .text
+0.0%     +55  [ = ]       0    .debug_abbrev
+0.0%      +3  [ = ]       0    .debug_info
-0.0%      -2  [ = ]       0    .debug_line
  +250%      +5  [ = ]       0    [Unmapped]
  -0.0%      -7  [ = ]       0    [section .debug_line]
-0.1%      -8  [ = ]       0    [Unmapped]
+0.0%     +56  +0.0%      +8    TOTAL

px4_fmu-v6x [Total VM Diff: 8 byte (0 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%      +8  +0.0%      +8    .text
+0.0%     +55  [ = ]       0    .debug_abbrev
+0.0%      +3  [ = ]       0    .debug_info
-0.0%      -2  [ = ]       0    .debug_line
  +250%      +5  [ = ]       0    [Unmapped]
  -0.0%      -7  [ = ]       0    [section .debug_line]
-0.1%      -8  [ = ]       0    [Unmapped]
+0.0%     +56  +0.0%      +8    TOTAL

Updated: 2025-07-23T11:57:57

github-actions[bot] avatar Jun 11 '25 15:06 github-actions[bot]

@PetervdPerk @PetervdPerk-NXP I set the Kconfig to look for the ARCH_CHIP but it seems that these variables are not set at boardconfig time, as right now the platforms menu is empty. I'm probably missing something obvious, any pointers I should look at?

Edit: Notes for discussion:

  • grab .config generated by menuconfig to take board type? Would go merged in Tools/kconfig/updateconfig.py
  • add to boardconfig CHIP and ARCH / parse these into new variables?

Pedro-Roque avatar Jun 23 '25 18:06 Pedro-Roque

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-june-25-2025-team-sync-and-community-q-a/46161/1

DronecodeBot avatar Jun 25 '25 15:06 DronecodeBot

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-july-2-2025-team-sync-and-community-q-a/46266/3

DronecodeBot avatar Jul 02 '25 14:07 DronecodeBot

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-july-16-2025-team-sync-and-community-q-a/46513/3

DronecodeBot avatar Jul 16 '25 14:07 DronecodeBot