Pwm on bluepill

Hello all, Iḿ trying to output a PWM signal on PA8 of bluepill board. I needed to modify periph_conf.h and my question is related about how to use own periph_conf on my apploication and not that one from RIOT tree.

Also, do you have any working configuration as I was able only to output a 1KHz signal but without modulation.

Thanks! :smiley:

This is how I defined pwm device on `periph_conf.h

static const pwm_conf_t pwm_config[] = {
        .dev      = TIM1,
        .rcc_mask = RCC_APB2ENR_TIM1EN,
        .remap      = 0,
        .chan     = {
                        { .pin = GPIO_PIN(PORT_A, 8), .cc_chan = 0 },
                        { .pin = GPIO_UNDEF, .cc_chan = 1 },
                        { .pin = GPIO_UNDEF, .cc_chan = 2 },
                        { .pin = GPIO_UNDEF, .cc_chan = 3 },
        .af       = GPIO_AF_OUT_PP,
        .bus      = APB2,

But I would like not to modify a riot header file and set it on my app locally.

I was able to make it work, I added to the timer struct TIM1, and then I realized I should´t :slight_smile:

But I do not know how to add my pwm configuration without modifying periph_conf.h from RIOT.

Is there any way to define it locally on my project? Thanks

Hello fixp,

You can copy the board directory next to your project an use EXTERNAL_BOARD_DIRS in your Makefile.

Ohhh right! I haven’t thought about that! You’re right, thank you very much!