SF32 LCSC Huangshan Pi

image

Configure according to this routine; below is my own configuration:

image

I encountered a DMA UPDATE error under the following section:

Here is the error:

E:\SiFli_SDK\sifli-sdk\rtos\rtthread\bsp\sifli\drivers\drv_pwm.c: In function ‘pwm_get_dma_info’:
E:\SiFli_SDK\sifli-sdk\customer\boards\include\config\sf32lb52x/pwm_config.h:35:36: error: ‘PWM2_UPDATE_DMA_IRQ_PRIO’ undeclared (first use in this function); did you mean ‘PWM3_UPDATE_DMA_IRQ_PRIO’?
 35 |        .dma_handle.Init.Priority = PWM2_UPDATE_DMA_IRQ_PRIO,           
    |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\rtos\rtthread\bsp\sifli\drivers\drv_pwm.c:113:52: note: in expansion of macro ‘PWM2_UPDATE_DMA_CONFIG’
 113 |         static struct bf0_pwm_dma pwm2_updte_dma = PWM2_UPDATE_DMA_CONFIG;
     |                                                    ^~~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\customer\boards\include\config\sf32lb52x/pwm_config.h:35:36: note: each undeclared identifier is reported only once for each function it appears in
 35 |        .dma_handle.Init.Priority = PWM2_UPDATE_DMA_IRQ_PRIO,           
    |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\rtos\rtthread\bsp\sifli\drivers\drv_pwm.c:113:52: note: in expansion of macro ‘PWM2_UPDATE_DMA_CONFIG’
 113 |         static struct bf0_pwm_dma pwm2_updte_dma = PWM2_UPDATE_DMA_CONFIG;
     |                                                    ^~~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\customer\boards\include\config\sf32lb52x/pwm_config.h:36:31: error: ‘PWM2_UPDATE_DMA_INSTANCE’ undeclared (first use in this function); did you mean ‘PWM3_UPDATE_DMA_INSTANCE’?
 36 |        .dma_handle.Instance = PWM2_UPDATE_DMA_INSTANCE,               
    |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\rtos\rtthread\bsp\sifli\drivers\drv_pwm.c:113:52: note: in expansion of macro ‘PWM2_UPDATE_DMA_CONFIG’
 113 |         static struct bf0_pwm_dma pwm2_updte_dma = PWM2_UPDATE_DMA_CONFIG;
     |                                                    ^~~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\customer\boards\include\config\sf32lb52x/pwm_config.h:38:19: error: ‘PWM2_UPDATE_DMA_IRQ’ undeclared (first use in this function); did you mean ‘PWM3_UPDATE_DMA_IRQ’?
 38 |        .dma_irq = PWM2_UPDATE_DMA_IRQ,                     
    |                   ^~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\rtos\rtthread\bsp\sifli\drivers\drv_pwm.c:113:52: note: in expansion of macro ‘PWM2_UPDATE_DMA_CONFIG’
 113 |         static struct bf0_pwm_dma pwm2_updte_dma = PWM2_UPDATE_DMA_CONFIG;
     |                                                    ^~~~~~~~~~~~~~~~~~~~~~
40 |        .dma_handle.Init.PeriphDataAlignment    = PWM2_UPDATE_DMA_PDATAALIGN,         
   |                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\rtos\rtthread\bsp\sifli\drivers\drv_pwm.c:113:52: note: in expansion of macro ‘PWM2_UPDATE_DMA_CONFIG’
 113 |         static struct bf0_pwm_dma pwm2_updte_dma = PWM2_UPDATE_DMA_CONFIG;
     |                                                    ^~~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\customer\boards\include\config\sf32lb52x/pwm_config.h:41:46: error: ‘PWM2_UPDATE_DMA_MDATAALIGN’ undeclared (first use in this function); did you mean ‘PWM3_UPDATE_DMA_MDATAALIGN’?
   |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
E:\SiFli_SDK\sifli-sdk\rtos\rtthread\bsp\sifli\drivers\drv_pwm.c:113:52: note: in expansion of macro ‘PWM2_UPDATE_DMA_CONFIG’

I don’t quite understand how to fix this.

Also, how can I make the up/down keys work properly in menuconfig? I’m using a JK keyboard.

Does it have to use pwm2’s update? It hasn’t been implemented on 52 and currently only pwm3 is supported.

Hi, I’ve also noticed this issue. I’d like to control two RGB LED strips separately. Originally, I used two different channels of PWM3, but found that when both LED strips are lit simultaneously, the lighting effects change slower compared to when only one strip is lit. I’m considering switching to PWM2 and PWM3, with each controlling one strip separately. However, PWM2 doesn’t seem to have an update. Could you please suggest any alternative solutions? :joy:

We will also add the update for pwm2.