Calling HAL_SRAM_Init() twice ?
Hello,
HAL contains both HAL_SRAM_Init and HAL_NOR_Init.
But what if we have additional memory in PSRAM (FPGA device in our case).
If we register the additional interface with HAL_SRAM_Init , it will call HAL_SRAM_MspInit again , and register again with the same mdma handle mdma_handle.
Isn't it problematic to call HAL_SRAM_Init & HAL_SRAM_MspInit twice ?
Doesn't it mean that we can't use MDMA for both memories at the same time ?
please see code snippet below for HAL_SRAM_MspInit:
void HAL_SRAM_MspInit(SRAM_HandleTypeDef *hsram)
{
...
__HAL_RCC_FMC_CLK_ENABLE();
....
gpio_init_structure.Pin = GPIO_PIN_7;
HAL_GPIO_Init(GPIOB, &gpio_init_structure);
...
mdma_handle.Init.Request = MDMA_REQUEST_SW;
...
mdma_handle.Instance = MDMA_Channel1;
__HAL_LINKDMA(hsram, hmdma, mdma_handle);
...
HAL_MDMA_DeInit(&mdma_handle);
HAL_MDMA_Init(&mdma_handle);
...
HAL_NVIC_SetPriority(MDMA_IRQn, 0x0F, 0);
HAL_NVIC_EnableIRQ(MDMA_IRQn);
}Thanks,
ranran