cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f030k6 CRC Config error

Mahdi1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

0693W00000QNUq7QAH.png

View solution in original post

12 REPLIES 12

> some errors appear

What errors?

Is there CRC in the 'F030 at all? What does the RM say?

JW​

Mahdi1
Associate II

../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...

  • Is there CRC?

Based on its datasheet and also Cube Configurations, yes it has CRC.

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

Mahdi1
Associate II

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?

You need to select STM32F030 instead of STM32F091.

I don't use Cube so don't know where to click.

JW

Mahdi1
Associate II

Which IDE do you use?

But you say STM32F030 has no CRC! any other solution to make use of CRC on this mcro?

Mahdi1
Associate II

0693W00000QMxVGQA1.jpg

Mahdi1
Associate II

It seems to have CRC. Am I right?

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..