STM32 MCU - Temp sensor gives weird values
I'm not C expert, perhaps

You have to parse uint to float, then calculate, then parse again to uint, if the result has to be uint. 

{
    sensorData = HAL_ADC_GetValue(ADCHandle);
    temp = (uint32_t)(((V25 * 1000.0 - (float)sensorData * 0.8) / AVGSLOPE) + 25.0);

    //V25 and sensorData must be in mV for this formula to work, as the
    //AVGSLOPE value is given in mV/oC

    //the 0.8 multiplication comes from dividing the max ADC voltage (3.3V) with its resolution (12 bits =&gt; 4096) which is 0.8mV/ADC unit

    return temp;
}