2022-08-03 07:02 PM
I want to use CRC on STM32f030k6, but as soon as I enable it, some errors appear and compilation fails.
Even when I want to use EEPROM Emulation example for the above micro, again it fails to compile.
What is wrong?
STM32CubeIDE - Version: 1.10.1
STM32CubeF0 Firmware Package V1.11.0
Solved! Go to Solution.
2022-08-11 06:53 AM
Final Answer:
Yes, As you said and based on f030 datasheet, it has a 32bit fixed polynomial. I hope in the next version of STM32CubeIDE, the issue will be resolved (Enabling CRC for f030 makes error).
Thanks for all participants.
2022-08-04 12:23 AM
> some errors appear
What errors?
Is there CRC in the 'F030 at all? What does the RM say?
JW
2022-08-04 03:56 AM
../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_crc.c:131:29: error: 'CRC_TypeDef' has no member named 'POL'
and
../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_crc.h:191:45: error: 'CRC_CR_POLYSIZE' undeclared (first use in this function)
and
../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_crc.h:190:45: error: 'CRC_CR_POLYSIZE_1' undeclared (first use in this function)
and...
Based on its datasheet and also Cube Configurations, yes it has CRC.
2022-08-04 04:51 AM
You probably don't have properly selected the exact STM32 model, or have some old Cube libraries.
The 'F030 don't have a fixed polynomial, so they don't have the CRC_POL register in CRC (more precisely, it's read only) and don't have the POLYSIZE field in CRC_CR.
In other words, the code should not refer to them for 'F030 (thus should not throw error). In current https://github.com/STMicroelectronics/STM32CubeF0/blob/master/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_crc.c at the line where you give the error, indeed CRC->POL is written, but that part of code is guarded by #if defined(CRC_POL_POL) at line 124 above, and CRC_POL_POL should not be defined - and indeed, it is not defined in the stm32f030x6.h device header.
That's why I think you haven't properly selected the STM32 model in the IDE.
JW
2022-08-04 05:12 AM
Thanks Jan for your reply,
my Cube Libraries are up-to-date as mentioned above.
I need CRC for EEPROM Emulation. I wanted to reuse and adapt the code:
STM32Cube\STM32Cube_FW_F0_V1.11.3\Projects\STM32F091RC-Nucleo\Applications\EEPROM\EEPROM_Emulation
for STM32f030k6; but as you say, it has no CRC!
Would you please tell me what to do?
2022-08-04 05:19 AM
You need to select STM32F030 instead of STM32F091.
I don't use Cube so don't know where to click.
JW
2022-08-04 05:28 AM
Which IDE do you use?
But you say STM32F030 has no CRC! any other solution to make use of CRC on this mcro?
2022-08-04 05:32 AM
2022-08-04 05:33 AM
It seems to have CRC. Am I right?
2022-08-04 05:48 AM
Yes, the basic one, not one where you can configure the polynomial, width or feed details.
So CRC_CR_POLYSIZE doesn't exist on this part.
You'll need to double check what STM32F0 you're telling the compiler you're building with, as there appears to be some mismatch configuration in your project.