November 10, 2024, 02:17:11 AM

UART only sends part, then blocks

Started by franchan, June 30, 2014, 12:41:24 AM

Previous topic - Next topic

franchan

I'm using newlib-nano and STM32Cube_FW_F4_V1.1.0 on a stm32-E407

To get the UART to work - partly - by basing myself on a sample:
STM32Cube_FW_F4_V1.1.0/Projects/STM324x9I_EVAL/Examples/UART/UART_Printf

With minicom, I see, each time, 11 characters (a slower baudrate, gives less characters).
Then the stm32-E407 hangs in the loop of the Default_Handler.

A "where" in openocd+gdb gives me the following stack trace:

#0  WWDG_IRQHandler () at gcc/startup_stm32f407xx.s:131
#1  <signal handler called>
#2  0x08002d94 in UART_WaitOnFlagUntilTimeout (huart=0x200000a0 <UartHandle>, Flag=128, Status=RESET, Timeout=65535)
    at STM32Cube_FW_F4_V1.1.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c:1578
#3  0x0800207c in HAL_UART_Transmit (huart=0x200000a0 <UartHandle>, pData=0x800bfe8 "rld 1.\n\n", Size=20, Timeout=65535)
    at STM32Cube_FW_F4_V1.1.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c:616
#4  0x0800b210 in main (argc=536871036, argv=0x7c) at main.c:23

Does somebody have an explanation?

Could it be related to a wrong "void SystemClock_Config(void)"?

Thanks!

franchan

I seem to have solved my problem by implementing a IRQ handler as follows:

void SysTick_Handler(void)
{
    HAL_IncTick();
}

farlane

Not done much yet with the StmCube but i thought that should have been generated automatically?

franchan

@farlane
Just using emacs + gcc + makefile; Unless I misunderstanding you,
nothing gets generated. I look in examples googled all over the place
and try to wrap something together myself ...
Unfortunately all examples in stmcube are coded using beyond my wallet IDE ...

farlane

Quote from: franchan on July 15, 2014, 01:48:16 AM
@farlane
Unfortunately all examples in stmcube are coded using beyond my wallet IDE ...
If you choose TrueStudio as output format it will generate sources that compile with GCC. ( TrueSTudio is GCC based )
You then have to generate a makefile ( or create a project in your own IDE ) that corresponds with the TrueStudio project.
Unfortunatly, i have yet to get a working skeleton going using either USB or Ethernet. There are still bits missing i guess and for example when using ethernet the PHY is hardcoded in the project.