2020-11-19 06:03 PM
I followed instrunction in this online workshop STM32 Graphics Workshop - 10 TouchGFX lab temperature sensor display https://www.youtube.com/watch?v=rYrRjXyAYvs&list=PLnMKNibPkDnGNY9Ny4FWpM5bgC3b4XdbN&index=10
When I get to (minute 18:30) the step build in STM32CubeIDE I get this error list below. Please help.
17:31:33 **** Incremental Build of configuration Debug for project STM32H7B3I_DISCO ****
make -j4 all
arm-none-eabi-g++ -o "STM32H7B3I_DISCO.elf" @"objects.list" -l:libtouchgfx-float-abi-hard.a -mcpu=cortex-m7 -T"C:\TouchGFXProjects\STM32H7BWorkshop2020\STM32CubeIDE\STM32H7B3LIHXQ_FLASH.ld" --specs=nosys.specs -Wl,-Map="STM32H7B3I_DISCO.map" -Wl,--gc-sections -static -L"C:\TouchGFXProjects\STM32H7BWorkshop2020\STM32CubeIDE\Middlewares\ST\touchgfx\lib\core\cortex_m7\gcc" -L"C:/_SandBox/2020_WShp_GFX/Lab/STM32H7BWorkshop2020_NSA/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc" -L"C:/STM32H7BWorkshop2020/DryRun/STM32H7BWorkshop2020/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc" -L"C:/_Temp/STM32H7BWorkshop2020/STM32H7BWorkshop2020/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc" -L"C:/STM32H7BWorkshop2020/STM32H7BWorkshop2020/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc" -L"C:/2020_ST_GFX_WS/STM32H7BWorkshop2020/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc" -LC:/TouchGFXProjects/STM32H7BWorkshop2020/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group
C:\TouchGFXProjects\STM32H7BWorkshop2020\STM32CubeIDE\Middlewares\ST\touchgfx\lib\core\cortex_m7\gcc\libtouchgfx-float-abi-hard.a(LCD.o): In function `touchgfx::LCD::drawString(touchgfx::Rect, touchgfx::Rect const&, touchgfx::LCD::StringVisuals const&, unsigned short const*, ...)':
(.text._ZN8touchgfx3LCD10drawStringENS_4RectERKS1_RKNS0_13StringVisualsEPKtz+0x0): multiple definition of `touchgfx::LCD::drawString(touchgfx::Rect, touchgfx::Rect const&, touchgfx::LCD::StringVisuals const&, unsigned short const*, ...)'
Application/User/generated/Texts.o:C:/TouchGFXProjects/STM32H7BWorkshop2020/TouchGFX/generated/texts/src/Texts.cpp:51: first defined here
C:\TouchGFXProjects\STM32H7BWorkshop2020\STM32CubeIDE\Middlewares\ST\touchgfx\lib\core\cortex_m7\gcc\libtouchgfx-float-abi-hard.a(Font.o): In function `touchgfx::Font::getStringWidth(unsigned short const*, ...) const':
(.text._ZNK8touchgfx4Font14getStringWidthEPKtz+0x0): multiple definition of `touchgfx::Font::getStringWidth(unsigned short const*, ...) const'
Application/User/generated/Texts.o:C:/TouchGFXProjects/STM32H7BWorkshop2020/TouchGFX/generated/texts/src/Texts.cpp:14: first defined here
C:\TouchGFXProjects\STM32H7BWorkshop2020\STM32CubeIDE\Middlewares\ST\touchgfx\lib\core\cortex_m7\gcc\libtouchgfx-float-abi-hard.a(Font.o): In function `touchgfx::Font::getStringWidth(unsigned char, unsigned short const*, ...) const':
(.text._ZNK8touchgfx4Font14getStringWidthEhPKtz+0x0): multiple definition of `touchgfx::Font::getStringWidth(unsigned char, unsigned short const*, ...) const'
Application/User/generated/Texts.o:C:/TouchGFXProjects/STM32H7BWorkshop2020/TouchGFX/generated/texts/src/Texts.cpp:23: first defined here
C:\TouchGFXProjects\STM32H7BWorkshop2020\STM32CubeIDE\Middlewares\ST\touchgfx\lib\core\cortex_m7\gcc\libtouchgfx-float-abi-hard.a(Font.o):(.rodata._ZTVN8touchgfx4FontE+0x0): multiple definition of `vtable for touchgfx::Font'
Application/User/generated/Texts.o:(.rodata._ZTVN8touchgfx4FontE+0x0): first defined here
C:\TouchGFXProjects\STM32H7BWorkshop2020\STM32CubeIDE\Middlewares\ST\touchgfx\lib\core\cortex_m7\gcc\libtouchgfx-float-abi-hard.a(TextProvider.o): In function `touchgfx::TextProvider::initializeInternal()':
(.text._ZN8touchgfx12TextProvider18initializeInternalEv+0x0): multiple definition of `touchgfx::TextProvider::initializeInternal()'
Application/User/generated/Texts.o:C:/TouchGFXProjects/STM32H7BWorkshop2020/TouchGFX/generated/texts/src/Texts.cpp:46: first defined here
C:\TouchGFXProjects\STM32H7BWorkshop2020\STM32CubeIDE\Middlewares\ST\touchgfx\lib\core\cortex_m7\gcc\libtouchgfx-float-abi-hard.a(TextProvider.o): In function `touchgfx::TextProvider::getNextLigature(unsigned char)':
(.text._ZN8touchgfx12TextProvider15getNextLigatureEh+0x0): multiple definition of `touchgfx::TextProvider::getNextLigature(unsigned char)'
Application/User/generated/Texts.o:C:/TouchGFXProjects/STM32H7BWorkshop2020/TouchGFX/generated/texts/src/Texts.cpp:32: first defined here
Application/User/TouchGFX/target/generated/TouchGFXConfiguration.o:(.rodata._ZTV19FrontendApplication[_ZTV19FrontendApplication]+0x30): undefined reference to `touchgfx::Application::requestRedraw()'
Application/User/TouchGFX/target/generated/TouchGFXConfiguration.o:(.rodata._ZTV23FrontendApplicationBase[_ZTV23FrontendApplicationBase]+0x30): undefined reference to `touchgfx::Application::requestRedraw()'
Application/User/TouchGFX/target/generated/TouchGFXConfiguration.o:(.rodata._ZTVN8touchgfx14MVPApplicationE[_ZTVN8touchgfx14MVPApplicationE]+0x30): undefined reference to `touchgfx::Application::requestRedraw()'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:77: STM32H7B3I_DISCO.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.
17:31:35 Build Failed. 6 errors, 0 warnings. (took 2s.49ms)
2020-11-20 06:28 AM
Hi,
I wont lie that it is a bit complicated to read that text :grinning_face_with_sweat:. Could you maybe share your project or add a screenshot of this error message ? (the colors will help us see faster where the issues are).
I have not gone through that video but I suppose you followed all the steps ?
/Romain
2020-11-23 04:02 PM
The online training its starter files are based on TouchGFX 4.13. The generated Texts.cpp has a different format and methods from what the TouchGFX 4.14 generate. I uninstalled the version 4.14 and installed the version 4.13 and the labs work as expected. Enclosed are the 2 Texts.cpp files generated. You find this file under C:\TouchGFXProjects\STM32H7BWorkshop_lab4\TouchGFX\generated\texts\src
The errors caused by the four extra methods generated by the GFX Version 4.14
2020-11-23 04:02 PM
Text.cpp from GFX Version 4.13
/* DO NOT EDIT THIS FILE */
/* This file is autogenerated by the text-database code generator */
#include <stdarg.h>
#include <touchgfx/Texts.hpp>
#include <touchgfx/hal/HAL.hpp>
#include <touchgfx/TypedText.hpp>
#include <texts/TypedTextDatabase.hpp>
#include <touchgfx/lcd/LCD.hpp>
#include <touchgfx/TextProvider.hpp>
touchgfx::Font::StringWidthFunctionPointer touchgfx::Font::getStringWidthFunction = &touchgfx::Font::getStringWidthLTR;
touchgfx::LCD::DrawStringFunctionPointer touchgfx::LCD::drawStringFunction = &touchgfx::LCD::drawStringLTR;
touchgfx::TextProvider::UnicodeConverterInitFunctionPointer touchgfx::TextProvider::unicodeConverterInitFunction = static_cast<touchgfx::TextProvider::UnicodeConverterInitFunctionPointer>(0);
touchgfx::TextProvider::UnicodeConverterFunctionPointer touchgfx::TextProvider::unicodeConverterFunction = static_cast<touchgfx::TextProvider::UnicodeConverterFunctionPointer>(0);
//Default typed text database
extern const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[];
TEXT_LOCATION_FLASH_PRAGMA
KEEP extern const touchgfx::Unicode::UnicodeChar texts_all_languages[] TEXT_LOCATION_FLASH_ATTRIBUTE =
{
0x4a, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x0, // @0 "Junction Temperature"
0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x4c, 0x45, 0x44, 0x0, // @21 "Toggle Physical LED"
0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x4c, 0x45, 0x44, 0x0, // @41 "Toggle Logical LED"
0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0xa, 0x0, // @60 "Previous?"
0x4e, 0x65, 0x78, 0x74, 0x0, // @70 "Next"
0x53, 0x57, 0x0, // @75 "SW"
0x48, 0x57, 0x0 // @78 "HW"
};
extern uint32_t const indicesGb[];
//array holding dynamically installed languages
struct TranslationHeader
{
uint32_t offset_to_texts;
uint32_t offset_to_indices;
uint32_t offset_to_typedtext;
};
static const TranslationHeader* languagesArray[1] = { 0 };
//Compiled and linked in languages
static const uint32_t* const staticLanguageIndices[] =
{
indicesGb
};
touchgfx::LanguageId touchgfx::Texts::currentLanguage = static_cast<touchgfx::LanguageId>(0);
static const touchgfx::Unicode::UnicodeChar* currentLanguagePtr = 0;
static const uint32_t* currentLanguageIndices = 0;
void touchgfx::Texts::setLanguage(touchgfx::LanguageId id)
{
const touchgfx::TypedText::TypedTextData* currentLanguageTypedText = 0;
if (id < 1)
{
if (languagesArray[id] != 0)
{
//dynamic translation is added
const TranslationHeader* translation = languagesArray[id];
currentLanguagePtr = (const touchgfx::Unicode::UnicodeChar*)(((const uint8_t*)translation) + translation->offset_to_texts);
currentLanguageIndices = (const uint32_t*)(((const uint8_t*)translation) + translation->offset_to_indices);
currentLanguageTypedText = (const touchgfx::TypedText::TypedTextData*)(((const uint8_t*)translation) + translation->offset_to_typedtext);
}
else
{
//compiled and linked in languages
currentLanguagePtr = texts_all_languages;
currentLanguageIndices = staticLanguageIndices[id];
currentLanguageTypedText = typedTextDatabaseArray[id];
}
}
if (currentLanguageTypedText)
{
currentLanguage = id;
touchgfx::TypedText::registerTypedTextDatabase(currentLanguageTypedText,
TypedTextDatabase::getFonts(), TypedTextDatabase::getInstanceSize());
}
}
void touchgfx::Texts::setTranslation(touchgfx::LanguageId id, const void* translation)
{
languagesArray[id] = (const TranslationHeader*)translation;
}
const touchgfx::Unicode::UnicodeChar* touchgfx::Texts::getText(TypedTextId id) const
{
return ¤tLanguagePtr[currentLanguageIndices[id]];
}
2020-11-23 04:03 PM
Text.cpp from GFX Version 4.14
/* DO NOT EDIT THIS FILE */
/* This file is autogenerated by the text-database code generator */
#include <stdarg.h>
#include <texts/TypedTextDatabase.hpp>
#include <touchgfx/TextProvider.hpp>
#include <touchgfx/Texts.hpp>
#include <touchgfx/TypedText.hpp>
#include <touchgfx/Unicode.hpp>
#include <touchgfx/hal/HAL.hpp>
#include <touchgfx/lcd/LCD.hpp>
uint16_t touchgfx::Font::getStringWidth(const touchgfx::Unicode::UnicodeChar* text, ...) const
{
va_list pArg;
va_start(pArg, text);
uint16_t width = getStringWidthLTR(TEXT_DIRECTION_LTR, text, pArg);
va_end(pArg);
return width;
}
uint16_t touchgfx::Font::getStringWidth(touchgfx::TextDirection textDirection, const touchgfx::Unicode::UnicodeChar* text, ...) const
{
va_list pArg;
va_start(pArg, text);
uint16_t width = getStringWidthLTR(textDirection, text, pArg);
va_end(pArg);
return width;
}
touchgfx::Unicode::UnicodeChar touchgfx::TextProvider::getNextLigature(TextDirection direction)
{
if (fontGsubTable && nextCharacters.peekChar())
{
substituteGlyphs();
if (nextCharacters.peekChar(1) == 0x093F) //Hindi I-matra
{
nextCharacters.replaceAt1(nextCharacters.peekChar());
nextCharacters.replaceAt0(0x093F);
}
}
return getNextChar();
}
void touchgfx::TextProvider::initializeInternal()
{
fillInputBuffer();
}
void touchgfx::LCD::drawString(touchgfx::Rect widgetArea, const touchgfx::Rect& invalidatedArea, const touchgfx::LCD::StringVisuals& stringVisuals, const touchgfx::Unicode::UnicodeChar* format, ...)
{
va_list pArg;
va_start(pArg, format);
drawStringLTR(widgetArea, invalidatedArea, stringVisuals, format, pArg);
va_end(pArg);
}
//Default typed text database
extern const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[];
TEXT_LOCATION_FLASH_PRAGMA
KEEP extern const touchgfx::Unicode::UnicodeChar texts_all_languages[] TEXT_LOCATION_FLASH_ATTRIBUTE =
{
0x4a, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x0, // @0 "Junction Temperature"
0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x4c, 0x45, 0x44, 0x0, // @21 "Toggle Physical LED"
0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x4c, 0x45, 0x44, 0x0, // @41 "Toggle Logical LED"
0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0xa, 0x0, // @60 "Previous?"
0x4e, 0x65, 0x78, 0x74, 0x0, // @70 "Next"
0x53, 0x57, 0x0, // @75 "SW"
0x48, 0x57, 0x0 // @78 "HW"
};
TEXT_LOCATION_FLASH_PRAGMA
KEEP extern uint32_t const indicesGb[] TEXT_LOCATION_FLASH_ATTRIBUTE;
//array holding dynamically installed languages
struct TranslationHeader
{
uint32_t offset_to_texts;
uint32_t offset_to_indices;
uint32_t offset_to_typedtext;
};
static const TranslationHeader* languagesArray[1] = { 0 };
//Compiled and linked in languages
static const uint32_t* const staticLanguageIndices[] =
{
indicesGb
};
touchgfx::LanguageId touchgfx::Texts::currentLanguage = static_cast<touchgfx::LanguageId>(0);
static const touchgfx::Unicode::UnicodeChar* currentLanguagePtr = 0;
static const uint32_t* currentLanguageIndices = 0;
void touchgfx::Texts::setLanguage(touchgfx::LanguageId id)
{
const touchgfx::TypedText::TypedTextData* currentLanguageTypedText = 0;
if (id < 1)
{
if (languagesArray[id] != 0)
{
//dynamic translation is added
const TranslationHeader* translation = languagesArray[id];
currentLanguagePtr = (const touchgfx::Unicode::UnicodeChar*)(((const uint8_t*)translation) + translation->offset_to_texts);
currentLanguageIndices = (const uint32_t*)(((const uint8_t*)translation) + translation->offset_to_indices);
currentLanguageTypedText = (const touchgfx::TypedText::TypedTextData*)(((const uint8_t*)translation) + translation->offset_to_typedtext);
}
else
{
//compiled and linked in languages
currentLanguagePtr = texts_all_languages;
currentLanguageIndices = staticLanguageIndices[id];
currentLanguageTypedText = typedTextDatabaseArray[id];
}
}
if (currentLanguageTypedText)
{
currentLanguage = id;
touchgfx::TypedText::registerTypedTextDatabase(currentLanguageTypedText,
TypedTextDatabase::getFonts(), TypedTextDatabase::getInstanceSize());
}
}
void touchgfx::Texts::setTranslation(touchgfx::LanguageId id, const void* translation)
{
languagesArray[id] = (const TranslationHeader*)translation;
}
const touchgfx::Unicode::UnicodeChar* touchgfx::Texts::getText(TypedTextId id) const
{
return ¤tLanguagePtr[currentLanguageIndices[id]];
}
2020-11-23 04:05 PM
2020-11-23 04:13 PM
2020-12-01 10:05 AM
Hi Romain,
With respect to the problem I discovered and described previously, I think the TouchGFX 4.14.0 code generation for Texts.cpp file has problem. Will the TouchGFX team look into this issue and confirm my thoughts.
Regards,
Sy
2020-12-12 05:00 AM
Hi Stran.2,
did you solve the issue?
I have the same problem
2020-12-15 09:34 AM
Hi FMarr
I down grade to ToughGFX 4.13 then it works as I show in the previous attachment. An ST employee has the suggested solution to use latest TouchGFX version here: STM32 Graphics Workshop - TouchGFX fail to run Target STM32H7B3I_DISCO
I have not try it yet but I will in a few weeks when I get back to working on STM project again. If you try the solution, please post if you have more information about it.