F446 96boards definition problems.
Posted: Wed Oct 21, 2020 4:13 pm
HI all,
I am trying to use chibios with the STM32 96Boards Sensor board in standalone mode ( not currently supported )
The board runs an stm32f446, and has arduino pin header.
and the first project is a pwm driver for ws2812 driver from joewa's ws2812 github repository.
I am using a config derived from a nucleo f446, but with a 16mhz external oscillator.
PWM output is to the arduino connector D13, which maps to gpio E2,
My pal line mappings are incomplete, but I have remove the nucleo specific entries.
updateing the board.chcfg
in the code I have
palSetPadMode(PORT_WS2812, PIN_WS2812, PAL_MODE_ALTERNATE(WS2812_AF));
If I set HSI and HSE BYPass to true it hangs on
while ((RCC->CR & RCC_CR_HSERDY) == 0)
; /* Waits until HSE is stable.
If HSI and HSE BYPass set to false it runs( as i think it should be), DMA triggers callbacks, and thread run as expected.
Is my approach and setup correct with the following driver setup
#define PORT_WS2812 GPIOE
#define PIN_WS2812 2 // arduino connector pin D13
#define WS2812_TIM_N 4 // timer, 1-11
#define WS2812_TIM_CH 3 // timer channel, 0-3
#define WS2812_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) // DMA stream for TIM4_UP
#define WS2812_DMA_CHANNEL 2
and mcuconf.h
#define STM32_HSI_ENABLED TRUE
#define STM32_LSI_ENABLED TRUE
#define STM32_HSE_ENABLED TRUE
#define STM32_LSE_ENABLED TRUE
#define STM32_CLOCK48_REQUIRED TRUE
#define STM32_SW STM32_SW_PLL
#define STM32_PLLSRC STM32_PLLSRC_HSE
#define STM32_PLLM_VALUE 16
#define STM32_PLLN_VALUE 336
#define STM32_PLLP_VALUE 2
#define STM32_PLLQ_VALUE 2
#define STM32_PLLI2SN_VALUE 192
#define STM32_PLLI2SM_VALUE 16
#define STM32_PLLI2SR_VALUE 2
#define STM32_PLLI2SP_VALUE 2
#define STM32_PLLI2SQ_VALUE 12
#define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV4
#define STM32_PPRE2 STM32_PPRE2_DIV2
#define WS2812_AF 2 // af2 for pwm on timer 4 as per manual
Many thanks for any input/direction.
Oli
I am trying to use chibios with the STM32 96Boards Sensor board in standalone mode ( not currently supported )
The board runs an stm32f446, and has arduino pin header.
and the first project is a pwm driver for ws2812 driver from joewa's ws2812 github repository.
I am using a config derived from a nucleo f446, but with a 16mhz external oscillator.
PWM output is to the arduino connector D13, which maps to gpio E2,
My pal line mappings are incomplete, but I have remove the nucleo specific entries.
updateing the board.chcfg
in the code I have
palSetPadMode(PORT_WS2812, PIN_WS2812, PAL_MODE_ALTERNATE(WS2812_AF));
If I set HSI and HSE BYPass to true it hangs on
while ((RCC->CR & RCC_CR_HSERDY) == 0)
; /* Waits until HSE is stable.
If HSI and HSE BYPass set to false it runs( as i think it should be), DMA triggers callbacks, and thread run as expected.
Is my approach and setup correct with the following driver setup
#define PORT_WS2812 GPIOE
#define PIN_WS2812 2 // arduino connector pin D13
#define WS2812_TIM_N 4 // timer, 1-11
#define WS2812_TIM_CH 3 // timer channel, 0-3
#define WS2812_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) // DMA stream for TIM4_UP
#define WS2812_DMA_CHANNEL 2
and mcuconf.h
#define STM32_HSI_ENABLED TRUE
#define STM32_LSI_ENABLED TRUE
#define STM32_HSE_ENABLED TRUE
#define STM32_LSE_ENABLED TRUE
#define STM32_CLOCK48_REQUIRED TRUE
#define STM32_SW STM32_SW_PLL
#define STM32_PLLSRC STM32_PLLSRC_HSE
#define STM32_PLLM_VALUE 16
#define STM32_PLLN_VALUE 336
#define STM32_PLLP_VALUE 2
#define STM32_PLLQ_VALUE 2
#define STM32_PLLI2SN_VALUE 192
#define STM32_PLLI2SM_VALUE 16
#define STM32_PLLI2SR_VALUE 2
#define STM32_PLLI2SP_VALUE 2
#define STM32_PLLI2SQ_VALUE 12
#define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV4
#define STM32_PPRE2 STM32_PPRE2_DIV2
#define WS2812_AF 2 // af2 for pwm on timer 4 as per manual
Many thanks for any input/direction.
Oli