cancel
Showing results for 
Search instead for 
Did you mean: 

Bug on Cubemx - Touchgfx

SMour.1
Associate III

I am using the latest Touchgfx+Cubemx and code generation from within CubeMx fails without notification. The process completes but the generated file /TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp

contains some weird java error logs

Hot to work around that ?

The logs , focus on line 129 and after:

/**
  ******************************************************************************
  * File Name          : TouchGFXGeneratedHAL.cpp
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under Ultimate Liberty license
  * SLA0044, the "License"; You may not use this file except in compliance with
  * the License. You may obtain a copy of the License at:
  *                             www.st.com/SLA0044
  *
  ******************************************************************************
  */
 
#include <TouchGFXGeneratedHAL.hpp>
#include <touchgfx/hal/OSWrappers.hpp>
#include <gui/common/FrontendHeap.hpp>
 
#include "stm32h7xx.h"
 
using namespace touchgfx;
 
namespace
{
    // Use the section "TouchGFX_Framebuffer" in the linker to specify the placement of the buffer
    LOCATION_PRAGMA("TouchGFX_Framebuffer")
    uint32_t frameBuf[(320 * 240 * 2 + 3) / 4 * 2] LOCATION_ATTRIBUTE("TouchGFX_Framebuffer");
}
 
void TouchGFXGeneratedHAL::initialize()
{
    HAL::initialize();
    registerEventListener(*(Application::getInstance()));
    enableLCDControllerInterrupt();
    enableInterrupts();
    setFrameBufferStartAddresses((void*)frameBuf, (void*)(frameBuf + sizeof(frameBuf) / (sizeof(uint32_t) * 2)), (void*)0);
}
 
void TouchGFXGeneratedHAL::configureInterrupts()
{
    NVIC_SetPriority(DMA2D_IRQn, 9);
}
 
void TouchGFXGeneratedHAL::enableInterrupts()
{
    NVIC_EnableIRQ(DMA2D_IRQn);
}
 
void TouchGFXGeneratedHAL::disableInterrupts()
{
    NVIC_DisableIRQ(DMA2D_IRQn);
}
 
void TouchGFXGeneratedHAL::enableLCDControllerInterrupt()
{
}
 
bool TouchGFXGeneratedHAL::beginFrame()
{
    return HAL::beginFrame();
}
 
void TouchGFXGeneratedHAL::endFrame()
{
    HAL::endFrame();
    touchgfx::OSWrappers::signalRenderingDone();
}
 
uint16_t* TouchGFXGeneratedHAL::getTFTFrameBuffer() const
{
    return (uint16_t*)frameBuf;
}
 
void TouchGFXGeneratedHAL::setTFTFrameBuffer(uint16_t* adr)
{
    //setTFTFrameBuffer() not used for selected display interface
}
 
void TouchGFXGeneratedHAL::flushFrameBuffer(const touchgfx::Rect& rect)
{
    HAL::flushFrameBuffer(rect);
    // If the framebuffer is placed in Write Through cached memory (e.g. SRAM) then
    // the DCache must be flushed prior to DMA2D accessing it. That's done
    // using the function SCB_CleanInvalidateDCache(). Remember to enable "CPU Cache" in the
    // "System Core" settings for "Cortex M7" in CubeMX in order for this function call to work.
    if (SCB->CCR & SCB_CCR_DC_Msk)
    {
        SCB_CleanInvalidateDCache();
    }
}
 
bool TouchGFXGeneratedHAL::blockCopy(void* RESTRICT dest, const void* RESTRICT src, uint32_t numBytes)
{
    return HAL::blockCopy(dest, src, numBytes);
}
 
void TouchGFXGeneratedHAL::InvalidateCache()
{
    // If the framebuffer is placed in Write Through cached memory (e.g. SRAM) then
    // the DCache must be flushed prior to DMA2D accessing it. That's done
    // using the function SCB_CleanInvalidateDCache(). Remember to enable "CPU Cache" in the
    // "System Core" settings for "Cortex M7" in CubeMX in order for this function call to work.
    if (SCB->CCR & SCB_CCR_DC_Msk)
    {
        SCB_CleanInvalidateDCache();
    }
}
 
void TouchGFXGeneratedHAL::FlushCache()
{
    // If the framebuffer is placed in Write Through cached memory (e.g. SRAM) then
    // the DCache must be flushed prior to DMA2D accessing it. That's done
    // using the function SCB_CleanInvalidateDCache(). Remember to enable "CPU Cache" in the
    // "System Core" settings for "Cortex M7" in CubeMX in order for this function call to work.
    if (SCB->CCR & SCB_CCR_DC_Msk)
    {
        SCB_CleanInvalidateDCache();
    }
}
 
FreeMarker template error (DEBUG mode; use RETHROW in production!):
Java method "static Integer.parseInt(String, int)" threw an exception; see cause exception in the Java stack trace.
 
----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign baseaddr = Integer.parseInt(p...  [in template "fmc_interface_apis_tmp.ftl" at line 5, column 1]
----
 
Java stack trace (for programmers):
----
freemarker.core._TemplateModelException: [... Exception message was already printed; see it above ...]
	at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:291)
	at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:263)
	at freemarker.ext.beans.OverloadedMethodsModel.exec(OverloadedMethodsModel.java:66)
	at freemarker.core.MethodCall._eval(MethodCall.java:62)
	at freemarker.core.Expression.eval(Expression.java:101)
	at freemarker.core.Assignment.accept(Assignment.java:134)
	at freemarker.core.Environment.visit(Environment.java:334)
	at freemarker.core.Environment.visit(Environment.java:376)
	at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:291)
	at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
	at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
	at freemarker.core.Environment.visitIteratorBlock(Environment.java:644)
	at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
	at freemarker.core.Environment.visit(Environment.java:334)
	at freemarker.core.Environment.process(Environment.java:313)
	at freemarker.template.Template.process(Template.java:383)
	at com.st.microxplorer.codegenerator.CodeEngine.freemarkerDo(CodeEngine.java:313)
	at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:235)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:4531)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCode(CodeGenerator.java:3962)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCodeFile(CodeGenerator.java:1412)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:1640)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateDefaultConfig(CodeGenerator.java:8151)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1197)
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:2229)
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:1900)
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:594)
	at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:44)
Caused by: java.lang.NumberFormatException: For input string: "C0000000"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:583)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1552)
	at freemarker.ext.beans.ReflectionCallableMemberDescriptor.invokeMethod(ReflectionCallableMemberDescriptor.java:56)
	at freemarker.ext.beans.MemberAndArguments.invokeMethod(MemberAndArguments.java:51)
	at freemarker.ext.beans.OverloadedMethodsModel.exec(OverloadedMethodsModel.java:62)
	... 26 more
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

4 REPLIES 4
SMour.1
Associate III

I think the new setting about FMC (which is undocumented on TouchGFX site is the one causing the problem

Karim BEN BELGACEM
ST Employee

FMC Display interface was not tested for H7 platforms.

Default FMC base address was set to 0x60000000 (F4/L4) and the computation done by CubeMX is not be able to parse big Integer (unsigned intor long).

We're currently looking to that and will fix it for the next release.

What I'll suggest for you now is to keep the default value and overwrite it after code generation (change 0x6... by 0xc..)

Please confirm also if the 0xC0000000 is the correct FMC base Address for H7 or maybe you had confused it with SDRAM address.

RSt.1
Associate

Hello!

This bug is present when creating a project for the F417 when activating the parallel RGB (FMC) mode. How is it possible to get around it?

Tested in TouchGFX 4.17 and 4.18. According to the instructions:

https://community.st.com/s/question/0D53W00000bcwtf/stm32h747iitxundefined-reference-to-touchgfxinit-its-stm32-cube-mx-generated-code-and-giving-this-error?t=1638114455103

Thank you.

Sooooo, two years is ST unable to fix this problem? Are you kidding right?