STM32H7 RAM and DMA after bootloader not work
Hi everyone, I have a problem with placing data in RAM from DMA with H7. I have a custom bootloader that then jumps to the application that uses ADC, + DMA, TIM + DMA etc.. I ran the classic __attribute__((section(".D1buffer"),used)) and modified it on the .ld by adding its section, although with the latest ld files it is not needed.
This happens: When I compile the project without including the bootloader everything works perfectly, but when I include the bootloader, after the jump the DMA stops working.
Do I need to do any realignment or setup before jumping?
On the bootloader side I run this before jumping and clear every interrupt and blank everything:
void
applicationJump(void){
typedef void(*pFunction)(void);
volatile uint32_t BootAddr=BOOT_APP_ADDR;
uint32_t JumpAddress=*(__IO uint32_t*)(BootAddr+4);
pFunction JumpToApplication=(pFunction)JumpAddress;
HAL_MPU_Disable();
HAL_SuspendTick();
__HAL_RCC_AHB1_FORCE_RESET(); __HAL_RCC_AHB1_RELEASE_RESET();
__HAL_RCC_AHB2_FORCE_RESET(); __HAL_RCC_AHB2_RELEASE_RESET();
__HAL_RCC_AHB3_FORCE_RESET(); __HAL_RCC_AHB3_RELEASE_RESET();
__HAL_RCC_APB4_FORCE_RESET(); __HAL_RCC_APB4_RELEASE_RESET();
__HAL_RCC_APB1L_FORCE_RESET(); __HAL_RCC_APB1L_RELEASE_RESET();
__HAL_RCC_APB1H_FORCE_RESET(); __HAL_RCC_APB1H_RELEASE_RESET();
HAL_MspDeInit();
__disable_irq();
SysTick->CTRL=0U;
SysTick->LOAD=0U;
SysTick->VAL=0U;
HAL_RCC_DeInit();
for(uint8_t i=0U;i<7U;i++)
{NVIC->ICER[i]=0xFFFFFFFF; NVIC->ICPR[i]=0xFFFFFFFF;}//
__enable_irq();
SCB->ICSR|=SCB_ICSR_PENDSTCLR_Msk;
SCB->SHCSR&=~( _SHCSR_USGFAULTENA_Msk|SCB_SHCSR_BUSFAULTENA_Msk|SCB_SHCSR_MEMFAULTENA_Msk);
if(CONTROL_SPSEL_Msk&__get_CONTROL())
{__set_CONTROL(__get_CONTROL()&~CONTROL_SPSEL_Msk);}
__HAL_RCC_SYSCFG_CLK_ENABLE();
__set_MSP(*(__IO uint32_t*)BootAddr);
__set_CONTROL(0);
JumpToApplication();
}
