Skip to main content
TNaxi
Associate II
November 27, 2019
Question

A lot of errors in STM32Cube_FW_F0_V1.11.0

  • November 27, 2019
  • 3 replies
  • 3214 views

Error 1:

MX version: STM32CubeMX 5.4.0

Firmware: STM32Cube_FW_F0_V1.11.0

Compiler: IAR

MCU: Any in F0 series

Compiling error:

Error[Pe147]: declaration is incompatible with "__interwork __softfp void assert_failed(uint8_t *, uint32_t)" (declared at line 308 of "… main.c�?

Analysis:

The function, assert_failed(), generated by STM32CubeMX in main.c is defined as follows:

void assert_failed(char *file, uint32_t line) {}

The protoypte of this function should be below as mentioned in Release notes:

void assert_failed(uint8_t *file, uint32_t line) {}

Error 2:

MX version: STM32CubeMX 5.4.0

Firmware: STM32Cube_FW_F0_V1.11.0

Compiler: IAR

MCU: STM32F042

Compiling error:

Error[Pe136]: “… stm32f0xx_hal_crc.h has no field "DefaultPolynomialUse�? “

Analysis:

On the one hand, the generating Polynomial in CRC peripheral of STM32F042 is not programmable, the macro CRC_POL_POL is undefined, as a result, DefaultPolynomialUse is not a member of struct CRC_InitTypeDef.

On the other hand, the code generated by STM342CubeMX has the statement with DefaultPolynomialUse as follows:

hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;

Error 3:

MX version: STM32CubeMX 5.4.0

Firmware: STM32Cube_FW_F0_V1.11.0

Compiler: IAR

MCU: STM32F072

Linker error:

Error[Li005]: no definition for "HAL_CRCEx_Init" [referenced from … crc.o]

Analysis:

The code in function MX_CRC_Init() generated by STM32CubMX has the statements below:

if (HAL_CRCEx_Init(&hcrc) != HAL_OK) …

As mentioned in Release notes, HAL_CRCEx_Init has been abandoned and undefined and should not be used.

Recommendations on STM32CubeMX:

R1: A specific channel or mailbox should be created or provided to make developers submitting bug report conveniently.

R2: The path where the STMCubMX Repository should be configurable by developers.

This topic has been closed for replies.

3 replies

Khouloud ZEMMELI
ST Employee
November 27, 2019

​hello @TNaxi​ ,

Could you please share your iocs files for each error ?

Thanks,

Khouloud.

Khouloud ZEMMELI
ST Employee
November 27, 2019

@TNaxi​ : Only error 2 is reproduced -> it will be fixed.

need your ioc file for error 1 and for error 3.

Thanks and Best Regards,

Khouloud

TNaxi
TNaxiAuthor
Associate II
November 28, 2019
Dear Khouloud Zemmeli,
The attachment is the ioc file we used.
Thanks and Best Regards,
Tian Naxin
Pavel A.
November 28, 2019

> R2: The path where the STMCubMX Repository should be configurable by developers.

The path is already configurable.

What you probably want is to have two separate independent repository paths: A. for CubeMX itself to install & update its templates(?) etc. and B. the path to use in generated projects when user chooses to create references vs. copy files.

Like it was in older Cube versions.

-- pa

Abhishek Deouskar
Associate III
November 28, 2019

I am facing issues in the CAN section of the STM32Cube_FW_F0_V1.11.0.

My .ioc file is attached for your reference.

The HAL_CAN_AddTxMsg(..args..) goes to Hardfault Handler at the line:

 /* Store the Tx mailbox */
 *pTxMailbox = (uint32_t)1 << transmitmailbox;

I wrote a simple snippet for CAN Transmit as:

void TransmitCAN(uint32_t StdID, uint8_t *data_arr, uint8_t DLC)
{
	CAN_TxHeaderTypeDef	TxMsg = {0};
 
	TxMsg.StdId = StdID;
	TxMsg.IDE = CAN_ID_STD;
	TxMsg.RTR = CAN_RTR_DATA;
	TxMsg.DLC = DLC;
	TxMsg.TransmitGlobalTime = DISABLE;
 
	HAL_CAN_AddTxMessage(&hcan, &TxMsg, data_arr, (uint32_t*)CAN_TX_MAILBOX0);
 
	if((hcan.Instance->TSR & CAN_TSR_TXOK0) != RESET)
	{
		if((hcan.Instance->TSR & CAN_TSR_TXOK1) != RESET)
		{
			if((hcan.Instance->TSR & CAN_TSR_TXOK2) != RESET)
			{
				Error_Handler();
			}
		}
	}
}

I called the same in a while(1) loop in main.c…

The same code works for F4 or F3 series controllers. Also the code I had written for CAN using the V1.9 for the same board works. So I have eliminated Hardware issues at my end.