Page 1 of 1

CRC module causing an assert to fail.

Posted: Fri Feb 03, 2023 11:28 am
by Bambo
m trying to get an stm32l452re running but when i try to run my program, it fails at line 165 in stm32l4xx_hal_crc.c:

Code: Select all

  /* makes sure the input data format (bytes, halfwords or words stream)
   * is properly specified by user */
  assert_param(IS_CRC_INPUTDATA_FORMAT(hcrc->InputDataFormat));
When called from line 70 in "hw_config.c":

Code: Select all

  /* Initialize the CRC */
#if defined(HAL_CRC_MODULE_ENABLED)
  HAL_CRC_Init(&hcrc);
#endif
devenv_oFcP1WJmtm.png
devenv_oFcP1WJmtm.png (18.73 KiB) Viewed 598 times
I'

How do i set it up so that hcrc is setup properly? Thanks!

Re: CRC module causing an assert to fail.

Posted: Fri Feb 03, 2023 2:08 pm
by fpiSTM
I guess, You got this issue because you enabled the ASSERT.
As the handle hcrc does not init explicitly this field it is set to 0 which is not a correct value.

I've made a PR:
https://github.com/stm32duino/Arduino_C ... /pull/1941

Re: CRC module causing an assert to fail.

Posted: Wed Feb 08, 2023 11:07 am
by Bambo
fpiSTM wrote: Fri Feb 03, 2023 2:08 pm I guess, You got this issue because you enabled the ASSERT.
As the handle hcrc does not init explicitly this field it is set to 0 which is not a correct value.

I've made a PR:
https://github.com/stm32duino/Arduino_C ... /pull/1941

This PR fixed the issue