cancel
Showing results for 
Search instead for 
Did you mean: 

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

imarz.1
Associate III

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.

4 REPLIES 4

>>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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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 ?

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Can always set explicitly

HAL_SYSTICK_Config(SystemCoreClock/1000UL);

or

SysTick_Config(SystemCoreClock/1000UL);

Should be in the CMSIS forks of the CubeH7 or the tool-chain

C:\Keil5xx\Arm\Packs\ARM\CMSIS\5.8.0\CMSIS\Core\Include\core_cm7.h

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..