Skip to main content
MHo.15
Associate III
December 22, 2023
Solved

firmware relocation fail due to DMA enable

Hi,

   I have a firmware runing on STM32F405RGT6 whith is reloacted at 0x800C000 and is called by a bootloader. The problem is if I enable UART DMA, the program will be interrupted by non stopping DMA interrupt immediately. However, there is no stream data in the UART port.  The same code work well if it run without a bootloader, ie start 0x8000000.

   This is weird , it seems the UART DMA HAL driver is not relocation compatible. Could anyone know me why or provide some possible cause ? Thanks.

  Martin 

This topic has been closed for replies.

4 replies

MHo.15
MHo.15Author
Associate III
December 22, 2023

Hi Piranha,

   I replace the bootloader  code in this thread to my bootloader. The problem is still the same. Thanks for providing this clue. I think it is a good starting point, I need to clean something more before jumping to the applicantiong.  What could that be ?

Martin

MHo.15
MHo.15Author
Associate III
December 22, 2023

The problem fixed. The cause is I enabled the UART DMA in the bootloader ( because it is modified from APP ). It works well once I do not enable UART DMA in the bootloarder.

Tesla DeLorean
Guru
December 22, 2023

Check interrupts are enabled.

Check that SCB->VTOR points at the new firmware base. Code typically in SystemInit 

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..