Loading...
 

STM32MP1 support available in SW4STM32

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world.
And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4; you can download a short video showcasing this on the ac6-tools website (registration required).

System Workbench for STM32


How can I print the result of and ADC conversion by a floating number in the variables section??


I want to see the value of the multiplication of my adc conversion in either the console or the variables section, I added the linker flags to be able to use the printf float and still no change. It keeps saying optimization out

Can somebody help me please?


The relevant part of the code:


int adc1
float adc2;


while (1)
{
HAL_ADC_Start(&hadc1);
/* USER CODE END WHILE */
if(HAL_ADC_PollForConversion(&hadc1,5)==HAL_OK)
{
adc1=HAL_ADC_GetValue(&hadc1);
}

adc2=((adc1/4096)*3.3);
HAL_Delay(50);
printf(“%f”, adc2);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}