Fail to initialize pwm2-m0 on rock3a (debian-bullseye)

On the rock3a debian-bullseye system, libmraa has been installed by default. The mraa_pwm_init in the following code fails to run. Is there any solution?

 /* initialize mraa for the platform (not needed most of the times) */
 if (MRAA_SUCCESS != mraa_init()) {
     fprintf(stderr, "Failed to mraa_init\n");
     return EXIT_FAILURE;
 }

 //! [Interesting]
 pwm = mraa_pwm_init(PWM);
 if (pwm == NULL) {
     fprintf(stderr, "Failed to initialize PWM\n");
     mraa_deinit();
     return EXIT_FAILURE;
 }