Skip to main content
Visitor II
May 31, 2022
Question

Issues with brand new NUCLEO-H755ZI-Q demo board --- HAL_GetTick()

  • May 31, 2022
  • 1 reply
  • 1238 views

I just started using the NUCLEO-H755ZI-Q demo board. I created new project, and did not write any code. During project creation I clicked YES to init all peripherals.

At debug I noticed two issues:

1- At the beginning of Main(), it is going to Error_Handler() function here:

  /* Wait until CPU2 boots and enters in stop mode or timeout*/

 timeout = 0xFFFF;

 while((__HAL_RCC_GET_FLAG(RCC_FLAG_D2CKRDY) != RESET) && (timeout-- > 0));

 if ( timeout < 0 )

 {

 Error_Handler();

 }

2- Whenever function HAL_Delay() is used it gets stuck. I found it gets stuck inside HAL_Delay() at:

  while ((HAL_GetTick() - tickstart) < wait)

  This is so, because HAL_GetTick() always returns zero

Notes:

- HAL_Init() is returning HAL_OK

- SystemClock_Config() is returning HAL_OK

- SysTick is set in SYS, and SYS_M4 in the .ioc file

Not sure what is the problem. This is brand new board.

Thanks for any suggestion.

    This topic has been closed for replies.

    1 reply

    Graduate II
    May 31, 2022

    >>This is brand new board

    Old board, new board, the SysTick should work if it's enabled.

    Check that the IRQ Handler is firing, and that it's causing the count to be incrementing. Make sure the interrupts are enabled.

    The processor should already be running when you enter Reset_Handler(), you don't have to even call SystemClock_Config() for it to be running at 64 MHz off HSI

    If code isn't starting on the M4 core, should perhaps check that.

    Try the assorted CubeH7 examples.

    imarz.1Author
    Visitor II
    May 31, 2022

    You are correct. The IRQ function handler for System tick timer (SysTick_Handler()) is never triggered.

    This is strange because I did assign time base source for both cores to SysTick in the .ioc.

    Do I need to add code to make it trigger ?

    Graduate II
    May 31, 2022

    Usually it's enabled in HAL_Init(), so check that, there can be weak linkage, so make sure what's generated by CubeMX, et al is actually viable.

    I'm not a particular fan of the auto-generated code, or non-compliance to CMSIS expectations.

    If using C++ compilation, watch for name mangling, and what the linker actually binds.

    For M4 core watch Option Bytes, and that viable/executable code is available to run.

    Check actual code examples, start with M7 core ones.

    Check LDO/SMPS and VOS settings for the NUCLEO board in its default/delivered configuration.