2018-01-05 01:59 AM
Hi and happy new year
I need help,to avoid an hard fault after un unpredictable time(2 ...120 sec) when i use the USART1 Tx
MCU is STM32F410RBT,mounted on a custom board
Configuration done with CubeMx,IDE is STM32 WorkbenchI have to acquire 12 analog channels at 1KHz,then i have to send the data to a PC using USART1 at 460800 bpsI trigger the ADC with TIM1,then the ADC transfers in DMA the 12 x 12 bit samples to a 16 bit buffer
unsigned short ADC1ConvertedValues[ADC_BUFFER_SIZE];I associated some interrupt to the timer event ,to the end of 12 channels conversions and to the end of ADC DMA transfer,
in these interrupt routines i move somo pin so that i can't verify on the scope the activities.
Channel1-yellow and channel 2-blue goes high when the TIM event happensChannel 1 goes low ath the end of ADC conversions,Channel 2 goes low at the end of ADC DMA transferA 3rd scope -green channel is connected to the UART Tx pinFirst thing i notice is that the ADC DMA transfer pulse is prior than the ADC EoC,maybe because of the highest priority of the DMA transfer interrupt?
Anyway everything looks okay until here.
In the DMA interrupt routine i call HAL_UART_Transmit_DMA(&huart1, (uint8_t *)buff_char_prova, 20);
or i simply turn on a flag that calls the same function in the main loop.
After some seconds i have hard fault ,the same happens if i call HAL_UART_Transmit_IT(&huart1, (uint8_t *)buff_char_prova, 20);or the blocking function
HAL_UART_Transmit(&huart1, (uint8_t *)buff_char_prova, 20);//(in main loop)
Saving the content of registers and program counter PC during hard fault shows every time a different PC value.May i have some help,please ?Attached is the whole project,including CubeMx file.Many thanks for your time.Diego,Milan ,Italy2018-01-06 10:42 AM
I seem to recall ST using 0603 caps for VCAP. For the single cap implementation 4.7uF with ESR less than 1Ohm. This is the bulk capacitance for the internal 1.25V regulator the core is running from.
2018-01-09 01:10 AM
Thanks for this too
Diego
2018-01-11 10:10 AM
Now that's impressive!
2018-01-11 10:13 AM
what ,Matthew?