2015-09-14 06:16 AM
Monday mornings don;t usually bother me but today seems different. I have commented out some code in gpio.c (for an input that is not presently used) and now I get run time assertions in timer configuration. The line that asserts is:
assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity));
And sure enough, the value of that field looks like garbage and the MX generated code that callsHAL_TIM_ConfigClockSource() does not set this field.
I have two questions about this. Why is this assert failing now? I not generated code using MX since late August.
How can I figure out what a timer is used for int the first place? This is TIM2 on an STM32F429I and was not explicitly configured in the first place. I suppose it is used for some other chip peripheral but I cannot see a way to determine what.
I tried commenting out the call toMX_TIM2_Init() in main.c to see what no longer works and I find that the next timer init (MX_TIM8_Init()) now fails on the same assertion.
Looking at the timer configuration dialogs it is not even obvious what the polarity be.
I'm baffled about how to resolve this so I can get back to work.
Thanks!
#tim2-assert
2015-09-14 07:00 AM
The followingcode:
static FLASH_OBProgramInitTypeDef OBInit;
HAL_FLASHEx_OBGetConfig(&OBInit);
OBInit.BORLevel = OB_BOR_LEVEL1;
HAL_StatusTypeDef st = HAL_FLASHEx_OBProgram(&OBInit);
Is also generating an assert at:
static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Banks)
{
HAL_StatusTypeDef status = HAL_OK;
/* Check the parameters */
assert_param(IS_OB_WRP_SECTOR(WRPSector));
assert_param(IS_FLASH_BANK(Banks));
(Last line above fails assert line 723 instm32f4xx_hal_flash_ex.c)
Not new code!
2015-09-14 07:17 AM
I guess what changed is that a breakpoint got set in assert_failed(() in main.c. This happens with IAR if I make changes to code earlier in the file as it sets breakpoints by line number.
I guess that still raises the question why these asserts failed. MX buglets? (Checking for parameters that are not set and apparently do not matter?)And I still wonder what those timers are used for.Thanks!2015-09-14 10:15 AM
Hi HankB,
1-Concerning the timer issue, it has been reported to our developer team. Also, other forum users reported it ( ), and Maylahas intervened. You can comment the assert line as a workaround. 2-Concerning the flash issue, Could you precise which version of CubeMx and HAL package are you using? And if it is possible, explain to us the testcase, so we can help. -Shahrzad-2015-09-18 05:47 AM
Hi
shahrzad,
MX -> 4.9.0 (.IOC file shows ''MxCube.Version=4.7.0'')HAL -> 1.5.0 (No hint that I could see in .IOC file)thanks,hank2015-09-18 05:48 AM
Hi
shahrzad,
MX -> 4.9.0 (.IOC file shows ''MxCube.Version=4.7.0'')HAL -> 1.5.0 (No hint that I could see in .IOC file)thanks,hank2015-09-18 05:48 AM
Hi
shahrzad,
MX -> 4.9.0 (.IOC file shows ''MxCube.Version=4.7.0'')HAL -> 1.5.0 (No hint that I could see in .IOC file)thanks,hank2015-09-18 05:50 AM
Triple post!
On the first two tries the forum S/W threw up error messages.Maybe some day this will be fixed.