Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


STM32F4 HAL: Undefined Reference to HAL_WWDT_Start();

I want to implement the watchdog timer in my app. I generated the project code using STM32CubeMX.

I’m calling MX_WWDG_Init();

which contains...

static void MX_WWDG_Init(void)
{

hwwdg.Instance = WWDG;
hwwdg.Init.Prescaler = WWDG_PRESCALER_1;
hwwdg.Init.Window = 64;
hwwdg.Init.Counter = 64;
hwwdg.Init.EWIMode = WWDG_EWI_DISABLE;
if (HAL_WWDG_Init(&hwwdg) != HAL_OK)
{
Error_Handler();
}

When I call MX_WWDG_Init(void), my app doesnt run. When I comment it out, all is well. This led me to believe that perhaps calling HAL_WWDG_Init automatically started the WDT and it was timing out, so I tried calling HAL_WWDG_Refresh(&wwdg)in my main while()loop with no luck.I then tried calling HAL_WWDG_Start(&hwwdg) at the start of my code and got the “Undefinced Reference” error upon compling. Looking into stm32f4xx_hal_wwdg,c, I can see that HAL_WWDG_Start() and HAL_WWDG_Start_IT() are not defined. I found an earlier version of this file online in which both of these function ARE defined. Mine is version 1.5.2 and I think the older version is 1.4.something. Are these functions defined elsewhere? Thanks!

Hi Nipri,


I just played a bit with the wwdg this morning and after a few googling, I came at the same conclusion that the wwdg is started “automatically” when calling HAL_WWDG_Init function. Looking at the new code compared to the old one,

Previously HAL_WWDG_START was calling HAL_WWDGE_ENABLE(hwwdg) which is just a macro to set the WWDG_CR_WDGA bit in the watchdog handle

Now, it’s done directly in the watchdog init function (HAL_WWDG_Init)

WRITE_REG(hwwdg->Instance->CR, (WWDG_CR_WDGA | hwwdg->Init.Counter));

So no need to call HAL_WWDG_START anymore.

About you’re issue, could it be that you’re refreshing the watchdog too quickly? Given that it’s a windowed watchdog, if you’re too quick or too slow compared to your configured timings, you will get a reset.

And just for advise, I think it’s best to ask questions regarding hal issues directly in the st’s forum (community.st.comQuestion). Moderators are directly in communication with hal developpers there so it helps them to solve bugs in some cases.

Regards,
Zoyhar.


 

Newest Forum Posts

  1. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs