cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE compile error ADC input LCD display

Kss.1
Associate II

https://www.youtube.com/watch?v=EbWOv_0Lp-U&t=1873s

I watched YouTube and followed it. This is to display the voltage coming into ADC IN0 on the LCD.

I used the TouchGFX + CubeIDE compiler, but an error occurred.

On YouTube, it compiles normally. Please let me know why the error occurred.

make -j12 all 

arm-none-eabi-g++ "../TouchGFX/gui/src/screen1_screen/Screen1View.cpp" -mcpu=cortex-m7 -std=gnu++14 -g3 -DUSE_HAL_DRIVER -DSTM32F746xx -DDEBUG -c -I../TouchGFX/gui/include -I../TouchGFX/generated/fonts/include -I"C:/ST/STM32CubeIDE_1.3.0/SWTEST/Drivers/Components" -I"C:/ST/STM32CubeIDE_1.3.0/SWTEST/Drivers/Components/n25q128a" -I../TouchGFX/generated/texts/include -I../Drivers/STM32F7xx_HAL_Driver/Inc -I../TouchGFX/generated/images/include -I"C:/TouchGFXProjects/SWITCHTEST/Drivers/Components/Common" -I"C:/ST/STM32CubeIDE_1.3.0/SWTEST/Drivers/Components/ft5336" -I"C:/TouchGFXProjects/SWITCHTEST/Drivers/Components/n25q128a" -I../Core/Inc -I../TouchGFX/generated/gui_generated/include -I"C:/ST/STM32CubeIDE_1.3.0/SWTEST/Drivers/Components/Common" -I"C:/TouchGFXProjects/SWITCHTEST/Drivers/Components/ft5336" -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/STM32F7xx_HAL_Driver/Inc/Legacy -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Drivers/CMSIS/Device/ST/STM32F7xx/Include -I../Middlewares/ST/touchgfx/framework/include -I"C:/ST/STM32CubeIDE_1.3.0/SWTEST/Drivers/BSP" -I../TouchGFX/target/generated -I../Drivers/CMSIS/Include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1 -I../TouchGFX/App -I../TouchGFX/target -O0 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-use-cxa-atexit -Wall -fstack-usage -MMD -MP -MF"TouchGFX/gui/src/screen1_screen/Screen1View.d" -MT"TouchGFX/gui/src/screen1_screen/Screen1View.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "TouchGFX/gui/src/screen1_screen/Screen1View.o"

../TouchGFX/gui/src/screen1_screen/Screen1View.cpp: In member function 'virtual void Screen1View::analogUpdate(uint32_t)':

../TouchGFX/gui/src/screen1_screen/Screen1View.cpp:19:10: error: 'textAreaADBuffer' was not declared in this scope

 memset(&textAreaADBuffer, 0, TEXTAREAAD_SIZE);

     ^~~~~~~~~~~~~~~~

../TouchGFX/gui/src/screen1_screen/Screen1View.cpp:19:10: note: suggested alternative: 'textArea1'

 memset(&textAreaADBuffer, 0, TEXTAREAAD_SIZE);

     ^~~~~~~~~~~~~~~~

     textArea1

../TouchGFX/gui/src/screen1_screen/Screen1View.cpp:19:31: error: 'TEXTAREAAD_SIZE' was not declared in this scope

 memset(&textAreaADBuffer, 0, TEXTAREAAD_SIZE);

                ^~~~~~~~~~~~~~~

../TouchGFX/gui/src/screen1_screen/Screen1View.cpp:19:31: note: suggested alternative: 'TEXTAREA_HPP'

 memset(&textAreaADBuffer, 0, TEXTAREAAD_SIZE);

                ^~~~~~~~~~~~~~~

                TEXTAREA_HPP

../TouchGFX/gui/src/screen1_screen/Screen1View.cpp:21:2: error: 'textAreaAD' was not declared in this scope

 textAreaAD.invalidate();

 ^~~~~~~~~~

../TouchGFX/gui/src/screen1_screen/Screen1View.cpp:21:2: note: suggested alternative: 'textArea1'

 textAreaAD.invalidate();

 ^~~~~~~~~~

 textArea1

make: *** [TouchGFX/gui/src/screen1_screen/subdir.mk:23: TouchGFX/gui/src/screen1_screen/Screen1View.o] Error 1

"make -j12 all" terminated with exit code 2. Build might be incomplete.

I saw your YouTube and tried it. However, some errors have occurred.

Some variables are not declared, how can I solve them?

void Screen1View::analogUpdate(uint32_t value)

{

memset(&textAreaADBuffer, 0, TEXTAREAAD_SIZE);

Unicode::snprintfFloat(textAreaADBuffer, sizeof(textAreaADBuffer), "%.3f", value * 0.000805664 ); // 3.3/4096 = 0.000805664

textAreaAD.invalidate();

}

I tried to display the analog input voltage on the LCD screen, but an error occurred in the screen viewer function. The problem made me sick for a week. I want to upload a proper YouTube. The person who uploaded YouTube wants to upload in detail how the error did not occur.

Can someone please help me.

It seems crazy.

12 REPLIES 12

Dear prain

Sorry but please help if time permits.

0693W000003C0sJQAS.jpg

I will send you the source, so can you tell me where the problem is?

I watched YouTube for a week and it compiles well, but only the text appears on the LCD screen and the ADC value is not updated.

change polling routine:

void PollingRoutine()

{

HAL_ADC_Start_DMA(&hadc1, &uhADCxConvertedValue,10);

HAL_TIM_Base_Start_IT(&htim1);

}

Dear prain

/*

 * PollingRoutines.c

 *

 * Created on: Jul 28, 2020

 *   Author: ProDesk

 */

#include "main.h"

#include "PollingRoutines.h"

#include "cmsis_os.h"

extern ADC_HandleTypeDef hadc1;

extern TIM_HandleTypeDef htim1;

extern osSemaphoreId binarySemAnaloginputHandle;

uint16_t uhADCxConvertedValue[10] = {0};

void PollingInit()

{

// HAL_ADC_Start_DMA(&hadc1, &uhADCxConvertedValue,10);

// HAL_TIM_Base_Start_IT(&htim1);

}

void PollingRoutine()

{

HAL_ADC_Start_DMA(&hadc1, &uhADCxConvertedValue,10);

HAL_TIM_Base_Start_IT(&htim1);

}

void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)

{

osSemaphoreRelease(binarySemAnaloginputHandle);

}

main.c

void StartTaskAnaloginput(void const * argument)

{

/* USER CODE BEGIN StartTaskAnaloginput */

/* Infinite loop */

for(;;)

{

PollingRoutine();

osDelay(1);

}

/* USER CODE END StartTaskAnaloginput */

}

ADC values ​​are still not updated.

When it's time, watch YouTube.

I want to know if I get the same result.

Please Help.