Skip to main content
Associate II
June 13, 2024
Solved

undefined reference to `HAL_NVIC_SetPriority'

  • June 13, 2024
  • 1 reply
  • 1444 views

Hello,

 

I create new STM32 project for STM32MP131AAG3 with baremetal.

 

I encounter the following errors when to build the codes of DMA generated by STM32CubeMX.

  • undefined reference to `HAL_NVIC_SetPriority'
  • undefined reference to `HAL_NVIC_EnableIRQ'

static void MX_DMA_Init(void)
{
  /* DMA controller clock enable */
  __HAL_RCC_DMAMUX1_CLK_ENABLE();
  __HAL_RCC_DMA2_CLK_ENABLE();

  /* DMA interrupt init */
  /* DMA2_Stream1_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(DMA2_Stream1_IRQn);
}

I fixed the code as follows.

static void MX_DMA_Init(void)
{
  /* DMA controller clock enable */
  __HAL_RCC_DMAMUX1_CLK_ENABLE();
  __HAL_RCC_DMA2_CLK_ENABLE();

  /* DMA interrupt init */
  /* DMA2_Stream1_IRQn interrupt configuration */
  IRQ_SetPriority(DMA2_Stream1_IRQn, 0);
  IRQ_Enable(DMA2_Stream1_IRQn);
}

Is this bug? Or is there possibility that I took mistake MX settings or else?

If it is bug, is there a plan to apply this bug fix to the STM32CubeMP13 codebase?

I am in trouble since the code reverts when I change MX settings.

Best answer by Semer CHERNI

Hello @it3 

First let me thank you for posting.

You are right about the proposed solution for this misbehavior.
In fact, this is a known issue and it's the subject of investigation. It should be fixed permanently in future release.

BR,
Semer.

1 reply

Semer CHERNI
Semer CHERNIBest answer
ST Employee
June 18, 2024

Hello @it3 

First let me thank you for posting.

You are right about the proposed solution for this misbehavior.
In fact, this is a known issue and it's the subject of investigation. It should be fixed permanently in future release.

BR,
Semer.