Skip to content

Conversation

Pedro-Roque
Copy link
Member

@Pedro-Roque Pedro-Roque commented Apr 30, 2025

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 Kconfig Option: CONFIG_BOARD_PWM_FREQ

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 Pedro-Roque requested a review from dagar April 30, 2025 17:39
@Pedro-Roque
Copy link
Member Author

@dagar all fixed, shold be good to go.

@dagar
Copy link
Member

dagar commented Jun 4, 2025

Looks good now, but submodule changes slipped in.

@mrpollo
Copy link
Contributor

mrpollo commented Jun 4, 2025

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

@DronecodeBot
Copy link

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

@Pedro-Roque
Copy link
Member Author

@mrpollo fixed

@Pedro-Roque Pedro-Roque requested a review from mrpollo June 4, 2025 18:42
Copy link

github-actions bot commented Jun 11, 2025

🔎 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

@Pedro-Roque
Copy link
Member Author

Pedro-Roque commented Jun 23, 2025

@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?

@DronecodeBot
Copy link

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
Copy link

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

@Pedro-Roque Pedro-Roque enabled auto-merge (squash) July 3, 2025 11:22
@DronecodeBot
Copy link

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

@Pedro-Roque Pedro-Roque merged commit 6474e5d into main Jul 23, 2025
70 checks passed
@Pedro-Roque Pedro-Roque deleted the pr-kconfig-board-pwm-freq branch July 23, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants