cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX HAL_Tick missing

MRobe.1
Associate III

Hi

When I Generate Code i find that HAL_Tick code is not generated and I am required to manually add code to get any MX code to work (given many _Init functions rely on HAL_Tick).  I add the code, below, to a USER_CODE area but I don't see why I should have to.

Regards

 

uint32_t HAL_GetTick (void) {
 static uint32_t ticks = 0U;
 uint32_t i;
	
 if (osKernelGetState () == osKernelRunning) {
   return ((uint32_t)osKernelGetTickCount ());
 }
 
 /* If Kernel is not running wait approximately 1 ms then increment and return auxiliary tick counter value */
 for (i = (SystemCoreClock >> 14U); i > 0U; i--) { __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); }
	 
 return ++ticks; 
}

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @MRobe.1 

I will check internally and get back to you. According to uploading ioc file, an internal request has been submitted to learn more about updates of this known issue and uploading trusted files in general. Thank you for your comprehension.

Regarding HAL_GetTick, I have regenerated code using your ioc file. stm32f4xx_hal.c is being called. Timebase functions are generated. You may need to check stm32f4xx_hal_timebase_tim.c in Src files.

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

9 REPLIES 9
TDK
Guru

Attach the IOC file where it fails to generate. Probably there is a relevant checkbox that is unchecked.

If you feel a post has answered your question, please click "Accept as Solution".
MRobe.1
Associate III

Yeah, once I rename the file I will upload as ST media upload is giving me this error on their filetype IOC:

Correct the highlighted errors and try again.

The attachment's stcubegenerated.ioc content type (application/octet-stream) does not match its file extension and has been removed

pack it in a zip file, but not "zip" ! use .7z or .rar (zip is for silly reason not "allowed" !)

If you feel a post has answered your question, please click "Accept as Solution".

Maybe it works as a zip?  Well, apparently not as it tells me file type .zip is not supported.  jings crivens.

Rename from csv to ioc.

I generated code and no HAL_Tick.  Happy to find the elusive option for including / excluding HAL_Tick.

it's an IOC file.  As in "IOC by ST".  Why in the name of all goodness can I not upload as IOC?  Surely someone at ST has noticed this flaw before........

Hello @MRobe.1 

I will check internally and get back to you. According to uploading ioc file, an internal request has been submitted to learn more about updates of this known issue and uploading trusted files in general. Thank you for your comprehension.

Regarding HAL_GetTick, I have regenerated code using your ioc file. stm32f4xx_hal.c is being called. Timebase functions are generated. You may need to check stm32f4xx_hal_timebase_tim.c in Src files.

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Yes, it's absurd that sometimes IOC file upload fails. It's been noticed before but clearly isn't solved.

If you feel a post has answered your question, please click "Accept as Solution".
MRobe.1
Associate III

Thank you.  I think this was related to htim3 (and related funcs) not being generated in my earlier Generated Code.  I now see uwTick being increased via the IRQ and do not need my code. It was not.....100% assured!

Thanks

Hello, 

The platform support team identified a BUG for IOC upload/download. We hope it to be sorted at the earliest convenience. Thank you for your understanding and apologies for this inconvenience. 

BR,
Lina


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.