Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32f103 failed to enable uart #19

Open
leeminghao opened this issue Dec 25, 2018 · 0 comments
Open

stm32f103 failed to enable uart #19

leeminghao opened this issue Dec 25, 2018 · 0 comments

Comments

@leeminghao
Copy link
Contributor

boot command:

/home/work/qemu-system-arm -serial tcp::12345,server,nowait -serial tcp::12344,server,nowait -serial stdio -machine pebble-bb2 -cpu cortex-m3 -pflash build-qemu-m3-test/lk.bin

WARNING logs:

CLKTREE: PCLK1 Output Change (SrcClk:HCLK InFreq:16000000 OutFreq:16000000 Mul:1 Div:1 Enabled:1)
CLKTREE: PCLK2 Output Change (SrcClk:HCLK InFreq:16000000 OutFreq:16000000 Mul:1 Div:1 Enabled:1)
qemu stm32: hardware warning: Warning: You are attempting to use the stm32_rcc peripheral while its clock is disabled.
...
qemu stm32: hardware warning: Warning: You are attempting to use the stm32_rcc peripheral while its clock is disabled.

Enable clock codes as following:

void uart_init_early(void)
{
#ifdef ENABLE_UART1
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
#endif
#ifdef ENABLE_UART2
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);
#endif
#ifdef ENABLE_UART3
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE);
#endif

#ifdef ENABLE_UART1
    usart_init1_early(USART1, UART1_FLOWCONTROL, USART1_IRQn);
#endif
#ifdef ENABLE_UART2
    usart_init1_early(USART2, UART2_FLOWCONTROL, USART2_IRQn);
#endif
#ifdef ENABLE_UART3
    usart_init1_early(USART3, UART3_FLOWCONTROL, USART3_IRQn);
#endif
}

I have set ENABLE_UART3=1, it's seem to not enable periph clock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant