STM32F215 gets stuck
Due to privacy policies I cannot publish my code.
I am creating a datalogger that receives information from CAN IT and USART IT and stores it on a microSD via SPI. With each interruption I get the time from the RTC and I also use the ADC to unmount the microSD when the voltage level drops.
It should be noted that the information I receive from the UART is periodic and of known length: 50 bytes every 98 ms while the information received by CAN has a more random behavior and its flow is very intense because it would be exposed to a CAN network with tens of different messages. The main function doesn't have times, it just waits for the buffers to fill up.
To avoid loss of information due to communication failures, I have implemented the reception of USART with DMA and it receives to IDLE.
My specific problem is that everything works fine for about 1 minute and then the micro gets stuck, I can tell by the blinking of an LED.
If I disable CAN, USART works without problems. If I disable USART, CAN works fine. It is the implementation of both peripherals that causes conflict.
I've tried different things but nothing seems to work:
- Remove DMA
- Change Systick for a TIM
- Modify interrupt priorities in various ways (higher priority CAN, higher priority USART, higher priority DMA, different priority groups, etc).
I could think that it is a deficiency of the microcontroller in the face of so many interruptions, but I do not understand how at the beginning everything works and after a while it no longer works.
