cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030C8 HardFault with 1 bit flipped address access

Sandy2
Visitor

Hello Everyone,

During the operation of my program, there will be an issue of address inversion on stm32f030c8.

It occurs approximately every 4 hours, and then it transitions to a "hard fault".

For example, I was trying to read from address 0x20000940, the register R0 returns 0x20400940, 1 bit was flipped, and it is out of the range of ram address(0x20000000-0x20002000), runs into hardfault in the end.

I measured the surface temperature of the chip, and when the problem occurred, the surface temperature of the chip was 65 degrees.

I suspect it's a problem caused by excessive temperature, so I used a fan to blow on it. It has been running for a whole day and is still functioning normally.

The vcc of the MCU is 3.3V. I used external crystal oscillator 8M, the PLL  Clock is 48MHZ, configuration like follow:

    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;/** 使用外部晶振(8mhz) */
    RCC_OscInitStruct.HSEState= RCC_HSE_ON;/** 打开高速外部时钟 */
    RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;/** 锁相环打开 */
    RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;/** 锁相环源为外部时钟(8mhz) */
    RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;/** 1分频(不分频) */
    RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;/** 6倍频 */
    if (HAL_RCC_OscConfig(&RCC_OscInitStruct)== HAL_OK)
   {
        RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1);
        RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
        RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
        RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
        if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1)!= HAL_OK)
        {
            Error_Handler();
        }
   }

The code that triggers a hard fault is as follows:
0x08006CF4 F002FBEC BL.W 0x080094D0 MCInfusionSettingParam
0x080094D0 4800 LDR r0,[pc,#0] ; @0x080094D4
0x080094D2 4770 BX lr
0x080094D4 0900 DCW 0x0900
0x080094D6 2000 DCW 0x2000
0x08006CF8 3040 ADDS r0,r0,#0x40
0x08006CFA 7A81 LDRB r1,[r0,#0x0A]

2 REPLIES 2
Pavel A.
Super User

> I suspect it's a problem caused by excessive temperature .... the surface temperature of the chip was 65 degrees.

This looks reasonable. Per the spec, the max. temperature is 85 °C and it's running at the max. clock (48 MHz)

 

waclawek.jan
Super User

Try to fix the underlying problem, i.e. chip overheating. The internal logic's consumption normally should not result in such temperatures, so unless it's some other even hotter component nearby, it's quite likely that one or more pins set to output are shorted together, are in conflict with external circuitry or are already permanently damaged.

You may also want to measure current consumption of the STM32 alone and compare to calculated/estimated value based on values given in the datasheet. I know measuring current may be hard to achieve on an already existing board; sometimes it's better to build a prototype around a board like Nucleo; sometimes power consumption can be measured by cutting a track and bridging it by a shunt resistor at a suitable place.

JW