This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM62: Soc Temperature Reading in U-Boot

Part Number: SK-AM62

Hello

Currently in the Bsp from TI, the temperature of SoC is not shown during the U-Boot. For our validation during the temperature tests, we need to read the temperature in U-Boot. 

Could you provide a way how to read the temperature of SoC in U-Boot?

Thanks and best regards, 

Jaski

  • You could see how our MCU+ SDK v9.0 (in the API library) or the Linux SDK v9.0 (in the kernel code) reads the on-chip sensor(s), and model after that.

    For example, here's the associated API function from the MCU+ SDL

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM62X/09_00_00_19/exports/docs/api_guide_am62x/group__SDL__VTM__FUNCTION.html#gad33fa583d435c37ac29c24b82772373f

    a0797059@dasso:~/ti/mcu_plus_sdk_am62x_09_00_00_19
    $ grep -r -A25 SDL_VTM_getTemp source/sdl/vtm/v0/sdl_vtm.c
    int32_t SDL_VTM_getTemp(SDL_VTM_InstTs instance, uint32_t *pTempVal)
    {
        const SDL_VTM_cfg1Regs               *p_cfg1;
            uint32_t baseAddr;
            SDL_VTM_getBaseAddr(SDL_VTM_CONFIG_REG_1, &baseAddr);
        p_cfg1 = (SDL_VTM_cfg1Regs *) baseAddr;
    
        const SDL_VTM_cfg1Regs_TMPSENS  *p_sensor;
        SDL_VTM_adc_code           adc_code;
        int32_t                     p_milli_degree_temp_val;
        int32_t sdlResult     =       SDL_PASS;
        p_sensor            =     &p_cfg1->TMPSENS[instance];
    
        if( (pTempVal   == NULL_PTR)        ||
            ((uint32_t)instance  >= SDL_VTM_TS_MAX_NUM))
        {
            sdlResult = SDL_EBADARGS;
        }
        if(sdlResult == SDL_PASS)
        {
            adc_code = SDL_VTM_getAdcCode(p_sensor);
            sdlResult = SDL_VTM_tsConvADCToTemp (adc_code, instance, &p_milli_degree_temp_val);
            *pTempVal = (uint32_t) p_milli_degree_temp_val;
        }
        return (sdlResult);
    }
    

    You could add code like this (and the functions it calls) to U-Boot and print the temperature at the end of the U-Boot init. That might be the easiest to do.

    Regards, Andreas