Skip to main content
Explorer
December 22, 2023
Solved

firmware relocation fail due to DMA enable

  • December 22, 2023
  • 2 replies
  • 1687 views

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.

    2 replies

    PiranhaAnswer
    Graduate II
    December 22, 2023
    MHo.15Author
    Explorer
    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.15Author
    Explorer
    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.

    Graduate II
    December 22, 2023

    Check interrupts are enabled.

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