2023-08-28 06:58 AM
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;
}
Solved! Go to Solution.
2023-08-28 09:31 AM
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.
2023-08-28 07:11 AM
Attach the IOC file where it fails to generate. Probably there is a relevant checkbox that is unchecked.
2023-08-28 08:58 AM
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
2023-08-28 09:01 AM
pack it in a zip file, but not "zip" ! use .7z or .rar (zip is for silly reason not "allowed" !)
2023-08-28 09:02 AM
2023-08-28 09:04 AM
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........
2023-08-28 09:31 AM
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.
2023-08-28 09:33 AM
Yes, it's absurd that sometimes IOC file upload fails. It's been noticed before but clearly isn't solved.
2023-08-28 10:12 AM
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
2023-08-30 12:46 AM
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