PWM Frequency change

In manual, there is statement "PWM frequency is fixed to 500 Hz.". How hard will be to change it to 1kHz?
1kHz is for example frequency of Control Pilot signal in EVSE. Will be useful to have such possibility.

try using the avr_pwm library and let us know if it works.
https://docs.arduino.cc/libraries/avr_pwm/

it should be something like

#include "AVR_PWM.h"
#define PIN 7

AVR_PWM* pwm1;

void setup() {
  // params: pin, frequency, duty cycle
  pwm1 = new AVR_PWM(PIN, 1000, 0);
}

void loop() {
  // change the duty cycle
  pwm1->setPWM(PIN, 1000, 20);
  delay(10000);
}

Hi, thanks, AVR is different architecture (ATMEL/Microchip), but yours advise leads me to different library STM32_PWM, which support STM32F/L/H/G/WB/MP1 maybe it can work on 32U if don't clash with Zephyr OS and there is not many differences in architecture. I will wait a little bit if somebody figure it out already. If not I will try to look at it.

To modify this frequency, it is necessary to edit the device tree, then recompile and flash it as the bootloader. Currently, there is no relevant documentation available in Arduino's official resources, and I am still in the experimental phase.