Support:Frequently Asked Questions (FAQ)

From Guiliani

(Redirected from Support:FAQ)

General

Q: How should my application be structured?

A: A typical Guiliani-application is divided into several parts, namely:

  • business-logic
  • frontend or GUI-code (includes CustomExtensions and other GUI-related objects)
  • GUI-project (created in the GSE)

It has been a good practice for our customers to keep these three "layers" each with its own responsibility.

  • the business logic gets measured values or any other sensor data and instruments the GUI according to these
  • the GUI-code has the full control over the GUI and is responsible for updating the screen depending on the current state of the device (or what the business-logic has decided)
  • the GUI-project provides the assets and dialogs the GUI-code will use to handle all requests from the business-logic

of course, the GUI-code can send back information or respond to any control request to the business-logic. By using this methodology you are able to separate all GUI-specific code from the business-logic (e.g. to be independent from the actual GUI-framework) only having a thin layer of abstraction.

Q: Regarding documentation, what are the most important topics?

A: In our online API-documentation, the following chapters contain valuable information:

  • Guiliani's main loop
  • Input event handling
  • Invalidating and redrawing
  • Streaming
  • Performance Optimization


GSE

Q: GSE is not starting

A: if the GSE is not starting, please check the GSE.log-file for errors which prevent the GSE from opening. This file is located in the same folder as the GSE-binary.

A common error is - when using a link to the GSE - if the working folder is not correctly set and the GSE can't find its resources. Also you will need administrator privileges or at least read/write-access to the folder GSE was unpacked.

It might be possible that the configuration-file is currupted. This file is located in $USER/AppData/Roaming/GSE (Windows) or user-folder (Linux). Deleting the file and re-starting the GSE might solve the problem.


Q: menu in GSE not completely visible on Windows

A: if the menu-bar in GSE is not completely visible, but somewhat shifted upwards, there might be a problem with the driver of the graphics card. GSE uses by default OpenGL for display and there are known issues when using Intel graphic cards, especially on Laptops. As a solution we recommend updating the drivers of the graphics card.


Q: GSE sometimes does not exit properly on Linux

A: This could happen on various Linux-Versions, especially when using VirtualBox or VMWare. Possibly your sound-card has crashed. You can deactivate the sound-card and/or update to the latest version of virtualizing software/operating system and try again.


Q: GSE does not recognize my license and still has limitations

A: If you have obtained a license you also want to use with the GSE, please place the license-file into the main-folder of the GSE where also the executable resides. Re-start the GSE. You can check the currently active limitations for your license in the about-dialog (Menu Help->About).

Q: Can assets be stored in RGB565 format to preserve Flash memory? And what about transparency?

A: Assets (images and fonts) can be exported from the GSE in various formats, each of it having advantages and disadvantages. Fonts can be left native and use the FreeType font-engine on the device or converted into ALPHA4/ALPHA8 bitmap-fonts to be used with the TES GlyphLib. Images can be exported - additionally to native which will require a fair amount of RAM for unpacking the image - in the formats RAW and RLE, which can be blitted directly from their storage (e.g. QSPI-flash) with only little (ca. 20 bytes) of RAM needed for managing the image in Guiliani. These two formats have different sub-formats like RAW565 or RAW4444 which can be used for saving memory or preserving transparency without having to use a 32-bit image.

Q: Can images that are not available at compile-time be displayed during runtime

A: Since the GSE-project is completely independent from your code and its compile-time (the only link is a bunch of header-files which are used for accessing objects and resource from your code) you can define a placeholder image which will be filled later during runtime or just use Guiliani's ability for dynamic resources, which provides methods to register specific files as resources during runtime. This offers the highest flexibility possible to suit your needs. (see Documentation of CGUIResouceManager) The only situation where the GSE-project is indeed coupled to your compile-time is when exporting the GSE-project as a header-file to be placed alongside with the application-code inside the ROM-section. But normally the best approach is to export the project as a Resource-file which gets loaded to any section you want. This also provides the possibility to update or exchange the whole project and keeping the application-binary the same (e.g. for having several different layouts or skins, but providing the same functionality - of course). Or to update the application-binary when there is a software-update.

Q: Does the GSE support versioning

A: The GSE-project and its files are in the XML-format and human-readable or even versionable. You can push the contents into a svn- or git-repository like any other file (including the assets of course) to be able to pull out any version at a specific moment in time. The GSE does not provide this kind of integration, thus it must by done by hand or a tool (including adding or removing files). A Merge should - by the text-nature of the files - be also possible, but having the same risk as it has on normal source-files when having conflicts. These need to be resolved by hand which can get tricky as it is for source-code to keep the integrity of the GSE-project. Please note: when having translations in languages which are using UTF-8 encoding your versioning system has to support this to prevent loss of information.

Guiliani

Q: How is memory allocation done in Guiliani

A: Guiliani allocates and de-allocates (both MemLeak-tested) all memory needed for its objects, including the objects which are part of the GUI-tree when it is needed. If an object is deleted, e.g. because its parent or itself is removed from the GUI-tree, all the allocated memory gets freed. Guiliani uses the functions provided by the operating system or BSP for allocation. This - since Guiliani is a C++-only GUI-framework - includes the C++-specific operators new, new[] and delete, delete[] (maybe a custom-mapping if needed). Memory which is not managed by Guiliani is of course not covered by this technique. If an user-created object will be taken over by Guiliani, Guiliani will also manage its lifecycle including memory-deallocation. If this is the case the behaviour will be described in the API-function-documentation. Guiliani provides some mechanisms like SmartPtr (including reference-count) to safely allocate memory which will automatically be deleted when not used anymore. You do not need to allocate any memory Guiliani will be using beforehand, this will be done by Guiliani itself. The memory for the framebuffer is a special case, since it might be placed in a different memory-region (e.g. SRAM). So the allocated pointers are just given to Guiliani during initialization. Regarding tracking pages which are displayed: Guiliani will manage the lifecycle of all object inside the GUI-tree (visible or not) and react to all user-actions like adding/removing/rearranging etc. accordingly. Objects are shown, when the user says they should be shown. I.e. when an object is added to the GUI-tree during runtime, Guiliani will show or hide it, according to its visible-state in the next Redraw-cycle.

Q: Are primitive drawing operations supported?

A: For manually drawing graphic primitives on the screen, there a many methods included in the Graphics-Wrapper Guiliani is using. This wrapper abstracts from the underlying Graphics-API (OpenGL, eGML or D/AVE) and provides a generic interface to use these operations. This includes for version 2.4 of Guiliani lines, rectangles, ellipses, arcs, rings, image-blits (stretch and rotation if supported) and texts. Please see the documentation for GfxWrap in our online documentation. These methods are a kind of low-level compared to the high-level widgets Guiliani provides for drawing primitives (CGUIGeometryObject) and texts (CGUITextField), but you will use these when creating an application-specific widget which should draw a line inside an ellipse and beneath a text.

Q: What is a Custom Extension

A: A Custom Extension is a possibility to enhance the GSE with a custom-made piece of functionality. this could be a layouter, behaviour, command or widget. the advantage when using Custom Extensions is that the designer can use them directly within the GSE and play around with them without any programming knowledge. the programmer just fills the important parts of the generated shell with custom code for visual representation and behaviour.
The license limits for Custom Extensions only apply to the usability within the GSE. Guiliani can, of course, be extended with new customized functionality with no restrictions.

Q: Run Guiliani on Baremetal

Could you help us on how to start running a Guiliani application on a system without RTOS?

A: You are currently using an evaluation version which is available for Windows and Linux. To be able to use Guiliani on other platforms (OS/HW) it has to be ported to the desired platform.

Normally you will need to recompile for the target HW (new CPU means new compile). For systems without OS, you will need in addition some bindings to address the target HW. For both porting steps, you will need the complete source code of Guiliani which is not part of the SDK.

The port can be part of a license contract or it is possible to buy a source code license which will enable you to port on your own. For licensing information and pricing please contact our sales.

Q: Sample Guiliani-Application

We got the Guiliani evaluation kit and we are able to install it and use it. We feel that the flow of the existing tutorial application is very difficult to understand.

  1. Can you provide us a sample GUI application like a screen with controls on it?
  2. We also need information on how to automate UI using Guiliani library.


A: For information on input-automation please look at the Guiliani Documentation. the class which you will need to use is CGUIPlaybackInput.

Creation of a simple GUI application can be done in two different ways: The first approach is using Guiliani directly and creating the dialogs with the controls using coding. This is shown with the GuilianiTutorial (see below for concrete examples). The second approach is using the GSE and using the tool to puzzle the dialogs together. As a result, a set of XML files will be exported which later will be used by the Streamruntime app (your app) to load and present the dialogs. The app logic can be added by you within the Streamruntime app which is part of the GSE visual studio project (as source). Please have a look at Link

GuilianiTutorial: You can find within the file Tutorial01.cpp a method which is responsible creating a screen of controls. This is done inside the constructor. Have a look at the orange comments. The Tutorial01 and the other Tutorials itself are created and called on a mouse click from TutorialMain.cpp (Method CTutorialSelector::DoClick).

 1 CTutorial01::CTutorial01(
 2 CGUICompositeObject *const pParent,
 3 const eC_Value &vX, const eC_Value &vY,
 4 const eC_Value &vWidth, const eC_Value &vHeight,
 5 const ObjectHandle_t &eID)
 6 :
 7 CGUICompositeObject(pParent, CGUIRect(CGUIPoint(vX, vY), vWidth, vHeight), eID)
 8 {
 9   // Create an image control
10   m_pImage = new CGUIImage( this, vLogoX, vLogoY, IMG_GUILIANI_LOGO); // An image is placed at the given coordinates
11   // Create a ProgressBar control
12   m_pProgressBar = new CGUIProgressBar(
13       this,                               // Pointer to parent object
14       vProgBarX, vProgBarY,   // X/Y Position
15       vProgBarW, vProgBarH,    // Width, height
16       IMG_BAR1,       // Image for ProgressBar Background
17       IMG_BAR2 );     // Image which is used for "filling up" the bar
18   m_pProgressBar->SetStepSize( 10);
19   m_pProgressBar->SetFullRangeSize(eC_FromInt(180));
20 
21   // Create a TextField
22   m_pText = new CGUIBaseTextField( this, vTut1TxtFieldX, vTut1TxtFieldY, vTut1TxtFieldW, vTut1TxtFieldH, "Please click the button!");
23   m_pText->GetLabel()->SetAligned( CGUIText::V_CENTERED, CGUIText::H_CENTERED);
24 
25   // Create a button
26   m_pButton = new CGUIButton( this, vTut1BtnX, vTut1BtnY, vTut1BtnW, vTut1BtnH, "Click me!", NULL);
27 }


Q: How do I achieve rounded corners for rectangles

I am trying to create a custom icon button. I am trying to achieve the following:

  1. Rounded corners
  2. On clicking, the icon has to be shifted and on button release, it should be re-shifted to the original position.

Reference UI

Image001.png


Test UI

Image002.png

A: This is very easy! Normally we use buttons as complete images using the image file format png. Using png’s enables you to have transparencies in the images and therefore it’s easy to have rounded corners.

The shifting of the images is done using separate images for pressed and not pressed state. If you do not want this approach you can derive from one of our button classes and override the DoDraw method and use dependent on the state different drawing code. It’s even possible to write an own behavior which implements the requested behavior and to use it you just have to add the behavior to the buttons which should show this “behavior”. They are many further different approaches which can be used. The easiest is using the two different images with transparencies. The downside of transparencies is, they are relatively slow to draw and not available on all target hardware (depending on graphics library).


Q2: We are deriving the icon button class. Inside the DoDraw method

  1. I am drawing a rectangle with a required background color and drawing an icon with a required position inside that rectangle.
  2. Inside the click event I am able to change the icon.

So, can you provide us some documentation what CGUIIconButton::DoDraw does?

A2: Just use different icons for the clicked (pressed) state. You can use

1 pkIconButton->SetIconImages(
2    ICON_STANDARD,
3    ICON_PRESSED,
4    ICON_HIGHLIGHTED,
5    ICON_GRAYEDOUT,
6    ICON_FOCUSED 
7 );

to define the image IDs for the different button states. If the icon is positioned differently within the image of the icon itself you will get the desired effect. For example, icon standard looks like

1 ###################
2 #                 #
3 #  III            #
4 #  III            #
5 #                 #
6 # #################

and icon pressed looks like

1 ###################
2 #                 #
3 #   III           #
4 #   III           #
5 #                 #
6 # #################

Where # are the image borders and I is the space for the icon. Only the icon pixels should be opaque. The other pixel should be fully transparent. To help you to understand how this works in DoDraw I will list the original source code of this method:

 1 eC_Bool CGUIIconButton::DoDraw()
 2 {
 3     CGUIButton::DoDraw();
 4     // Icon drawing
 5     ImageResource_t eIconImage = DUMMY_IMAGE;
 6     if (IsPressed())
 7     {
 8         eIconImage = m_eIconPressed;
 9     }
10     else if (IsHighlighted())
11     {
12         eIconImage = m_eIconHighlighted;
13     }
14     else if (IsGrayedOut())
15     {
16         eIconImage = m_eIconGrayedOut;
17     }
18     else if (IsFocussed())
19     {
20         eIconImage = m_eIconFocussed;
21     }
22     else
23     {
24         eIconImage = m_eIconNormal;
25     }
26     if (eIconImage != DUMMY_IMAGE)
27     {
28          GETGFX.BlitImgExt(eIconImage, GetAbsXPos()+m_vIconPosX, GetAbsYPos()+m_vIconPosY,
29             eC_FromInt(GETGFX.GetImgWidth(eIconImage)),
30             eC_FromInt(GETGFX.GetImgHeight(eIconImage)),
31             false,
32             m_ubIconAlpha);
33     }
34     return true;
35 }

Q: How are errors indicated from the business-logic handled? E.g. during a transition?

A: Since Guiliani treats the GUI totally transparent, it can't determine any error-state or whatever application-specific things you have. But, when an error is encountered in your business-logic you can of course react to this. E.g. by setting an error-state which gets sent to the GUI-code which executes a command including specific behaviour (e.g. showing a popup or changing to a defined error-page). You can interact with the GUI and tell it what to do in such a case. Please note that execution here is not immediatety, instead the command will be inserted into a queue and Guiliani will execute it in the next loop-iteration to assure thread-safety inside the GUI-context.

Q: Graphic controller that supports only 4 bits per pixel

Our software will have to interface with a touchscreen via a graphic controller that supports only 4 bits per pixel and 8 bpp. Could there be any issue for Guiliani to support 8 bpp or 4 bpp?

A: To be able to decide if Guiliani supports your chosen hardware we need more information about the planned hardware such like:

  • Available RAM and Bandwidth (speed)
  • Available FLASH and Bandwidth (speed)
  • Graphics-Resolution and Color depth (as you have already mentioned).
  • Used graphics library or HW accelerator (if existent), display controller
  • CPU and Frequency
  • OS if available


Q: CGLImage linker issue

I was trying to use CGLImage for drawing an icon, but it seems that I couldn’t link the code as the definition for CGLImage constructor is missing. Can you please tell me where I can find the definition, in which library file is the definition included.

A: There is no CGLImage. Guiliani has a CGUIImage class. If you want to draw an icon directly you can also realize it using GETGFX.BlitImg(m_eImgHdlTopLeft, GetAbsXPos(), GetAbsYPos()); where eImgHdlTopLeft is the ID of the icon.


Q: Transitions

I need some help in screen transition. The problem is briefed below.

  1. I have a ScreenContainer derived from CGUI which gets added to Screen
  2. I am adding an HomeScreen (resolution 480 x 272) object derived from CGUICompositeObject to the ScreenContainer
  3. HomeScreen has a “Tools” button. When the “Tools" button is clicked it should show a new screen GridViewScreen ( resolution 480 x 272).

I am able to do the above using an AddObject() call on ScreenContainer, but the issue is that I am not able to get back to the HomeScreen when pressing the “Back” button on GridViewScreen. I need some help on this. Please see the image below. Red flow is not working.

Image003.png

A: You are working into the right direction. In principle, the shown GUI is just a hierarchy of objects. All objects which are currently within the hierarchy will get drawn. There are only three exceptions:

  1. An object is marked invisible. That means it and all of its children (if the object is a composite object) will be invisible.
  2. An object if covered behind a fully opaque object. That means it is drawn but another object is drawn afterward on top of it.
  3. The draw method does not draw anything or the object is fully transparent or outside the bounds of the parent object and therefore clipped away.

Therefore you can either remove the GridViewScreen by deleting it, hiding it (via SetInvisible(true)) or removing it from the view hierarchy and store the GridViewScreen pointer for later use (compositeobject->RemoveObject(obj)).

Remember it is possible to stream the dialogs into a file and load them later via CGUILoadDialogCmd which also can take care for what to do with the previous dialog. You can also write your own commands to create, destroy, show or hide dialogs. It is then possible to connect the cmd to a button, for example (SetCommand(CGUICommandPtr pCommand)) and you do not have the need to derive objects to react on DoClick.

You can also manipulate the order of the hierarchy to control which object is drawn on top of another using void DrawOnTop(CGUIObject* pObject) or void DrawOnTopOf( CGUIObject*const pObject, CGUIObject*const pDrawOnTopOf).


Q: Pixel Processing

Does Guiliani Supports Pixel Processing?

A: Guiliani itself does not offer this kind of functionality. It’s usually the responsibility of a graphics library. Dependent on the platform you are using it might be available. If you will use for example eGML from TES it’s part of the library.

If your platform is not supporting pixel processing we can provide you with it after getting a specification what you need.


Q: Is the STM32F429 supported

There is a nice cheap development board including display available from ST called STM32F429 Discovery. Is it possible to use Guiliani to develop HMIs?

A: We are currently investigating for which development environment will be best for our BSP.

  • CoIDE
  • IAR
  • Keil
  • Eclipse with GCC

Feedback would help us to decide which IDE might be the best.

A: the most versatile solution might be using Eclipse with GCC, since this covers a variety of use-cases. If certification is necessary IAR will be the best choice.

Q: How is a "Swipe" handled in Guiliani

A: Guiliani uses the term "Drag" instead of "Swipe". You will generally use DoDrag- and DoDragEnd-events in your control.

the event-sequence you will get in your control will be the following during a drag:

  • DoButtonDown with the current position on the screen
  • several DoDrag with the new position on the screen and a delta for both axes
  • DoDragEnd when lifting the finger with the final position

with the help of these events you can react on almost every movement of the finger, even a circular movement would be possible.

here is a short sample-implementation for demonstration:

eC_Bool XXX::DoButtonDown(const eC_Value &vAbsX, const eC_Value &vAbsY)
{
    // Store the data for dragging.
    m_kDragStart = CGUIPoint(vAbsX, vAbsY);
    m_uiDragStarted = GETTIMER.GetTime();

    return true;
}

eC_Bool XXX::DoDrag(const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY)
{
    if (
        ((m_eDirection == CGUICommonEnums::OR_HORIZONTAL) && (abs(m_kDragStart.m_vX - vAbsX) >= m_vMinimumDragDistance)) ||
        ((m_eDirection == CGUICommonEnums::OR_VERTICAL) && (abs(m_kDragStart.m_vY - vAbsY) >= m_vMinimumDragDistance))
        )
    {
        // We support only scrolling into the specified direction (via object attribute).
        eC_Value vDragDelta = eC_FromInt(0);
        eC_Value vDragAbs = eC_FromInt(0);

        if (m_eDirection == CGUICommonEnums::OR_HORIZONTAL)
        {
            vDragDelta = vDeltaX;
            vDragAbs = vAbsX - m_kDragStart.m_vX;
        }
        else if (m_eDirection == CGUICommonEnums::OR_VERTICAL)
        {
            vDragDelta = vDeltaY;
            vDragAbs = vAbsY - m_kDragStart.m_vY;
        }
        // adjust position of container

        return true;
    }
    return false;
}

eC_Bool XXX::DoDragEnd(const eC_Value &vAbsX, const eC_Value &vAbsY)
{
    // drag has ended, use the distance to the starting-point for the direction

    return true;
}
  1. in the DoButtonDown-method the starting-position is saved to use it for the detection of the overall direction. of course you can only use the delta-values for x and y in DoDrag, but this is only the difference between the last event and the current one. when you want to calculate the direction at the end in DoDragEnd you will need the start of the event-sequence.
  2. in the DoDrag-method we use the direction-attribute (m_eDirection) of the control and the difference of the position at the beginning of the event-sequence and the current position to see if the movement should result in an reaction of the control. we use a threshold so the processing will be done only if the drag is further away from the starting-position than the threshold. this provides a smoother feedback. if so we use the variables vDelta and vDragAbs for further processing, e.g. move the content of the control to the specifed position during the drag.
  3. in DoDragEnd the event-sequence has reached its end and the final processing will be done, e.g. go to the next or the previous page based on the distance between the starting point (DoButtonDown) and the current position.

please note that the delta-values for DoDrag are always in screen-orientation, thus the y increases towards the bottom. this is different from the mathematical sense.

Q: Can Guiliani display data from a video-input?

A:

you can display data from a video-input in your GUI very easy. you will need:

  • a placeholder (GUIImage) to show the data in your GUI
  • a memory-region for the decoded data
  • an ImageID which will be bound to the GUIImage in your GUI
  • a function to decode a frame of video-data and refresh the memory and thus the image
// global variables for easy access
eC_UByte* pkMemory = NULL;
ImageResource_t eImageID = DUMMY_IMAGE;
CGUIImage* pkImageControl = NULL;
eC_UByte ubBytes = 0;

CMyGUI::CMyGUI(
    eC_Value x, eC_Value y,
    eC_Value width, eC_Value height,
    ObjectHandle_t eID) :
    CStreamRuntimeGUI(x, y, width, height, eID)
{
    // Add application specific initialisation here if necessary
    ...

    // get currently used screen format
    CGUICommonEnums::ImageType_t eScreenFormat = GETGFX.GetScreenFormat();

    // get bytes per pixel for buffer size
    ubBytes = ((eScreenFormat & 0xff000000) >> 24);

    // allocate destination memory for image data
    pkMemory = new eC_UByte[128 * 128 * ubBytes];
    memset(pkMemory, 0, 128 * 128 * ubBytes);

    // register dynamic image handle in guiliani with memory
    eImageID = GETRESMANAGER.RegisterDynamicImage(pkMemory, 128, 128, eScreenFormat);

    // create new image using this image
    pkImageControl = new CGUIImage(this, eC_FromInt(200), eC_FromInt(0), eC_FromInt(128), eC_FromInt(128), eImageID);

    // register timer with 100ms cycle to call CMyGUI::DoAnimate
    GETTIMER.AddAnimationCallback(100, this);
}

// also define in header file
// virtual void DoAnimate(const eC_Value& vTimes);
void CMyGUI::DoAnimate(const eC_Value& vTimes)
{
    static char val = 0;
    if (NULL != pkMemory)
    {
        memset(pkMemory, val, 128 * 128 * ubBytes);

        GETRESMANAGER.RefreshImageResource(eImageID, pkMemory);
        val += 3;

        if (NULL != pkImageControl)
            pkImageControl->InvalidateArea();
    }
}

Renesas

Q: What is the procedure for porting your product to custom hardware?

  1. Port the QSPI Loader. You will find the needed information in the doc folder of the RZ_A1H_QSPI_LOADER project. The main topics there are the used FLASH device and its port configuration.
  2. You can change the Display size by changing FRAME_BUFFER_WIDTH and FRAME_BUFFER_HEIGHT in Macro defines section of the compiler configuration of the application (Demo: SR_GuilianiDemo). The number of Frame_Buffers can be defined with the CreateInstance-Call of the GfxWrapeGML in StreamRunimeStartup_FreeRTOS.cpp.
  3. In function prvInitHardware in the File StreamRuntime_FreeRTOS.cpp configure your UART device.
  4. Additional VDC5 configuration is also done in StreamRuntime_FreeRTOS.cpp.
  5. In the SDK directory InputWrapper you will find GUIInputExample.cpp. The header file is located in deps/include/Guiliani/platform/RZA1H. Copy this files and adapt them to your input device. The files can now be added to the project. In StreamRunimeStartup_FreeRTOS.cpp you can replace the CGUIInput... lines with your Input wrapper. For more information read our how-to for Version 2.0 (Using Guiliani 2.0 RZ/A with TES eGML SDK with e2Studio) or our online help (https://www.guiliani.de/mediawiki/downloads/Guiliani_doc_2.1/page_porting.html#sec_porting_input)


Q: How can I change color depth?

The project is set to 16bpp. To enable 32bpp you can undefine FRAME_BUFFER_BITS_PER_PIXEL_16 and replace the initialization of the graphics wrapper in StreamRunimeStartup_FreeRTOS.cpp with CGfxWrapeGML::CreateInstance(FRAME_BUFFER_WIDTH, FRAME_BUFFER_HEIGHT, eGML::BM_RGB32);


Q: Ram start address in linker script for Renesas RZ/A

I've started to look into Guiliani 2.0 SDK for RZ/A and I noticed maybe some bug in linker script RZA1H_GCC_RAM_APP.ld for SR_ShowRoom project. It is: RAM_START = 0x20024000; Shouldn't it be: RAM_START = 0x20040000; ? As it is pointed from boot loader.

A: in the file BSP\RZ_A1H_QSPI_LOADER\src\qspi_change_config.c in line 390 you can see the call into the application:

1 (*applicationEntry)();


At the beginning of qspiReconfigure(void) in line 208 applicationEntry is defined as:

1 fPtr applicationEntry = (fPtr) DEF_USER_PROGRAM_SRC;


In BSP\RZ_A1H_QSPI_LOADER\inc\ line 55 you can see the definition of DEF_USER_PROGRAM_SRC:

1 #define DEF_USER_PROGRAM_SRC (APPLICATION_VECTOR_TABLE)


Finally APPLICATION_VECTOR_TABLE is defined as:

1 #define APPLICATION_VECTOR_TABLE 0x20024000


So the address 0x20024000 will be called by the boot loader if it is compiled using the configuration Debug_APPLICATION_IN_RAM, which matches RAM_START in the RZA1H_GCC_RAM_APP.ld.


Q: <new> and bad_alloc() warnings after compiling

SR_ShowRoom is compiling without errors and I can start debugging but I have warnings "unresolve inclusion: <new" and "function bad_alloc() could not be resolved" in StreamRuntime_FreeRTOS.cpp after compiling. Shouldn't I add path "${TCINSTALL}\arm-none-eabi\include\c++\5.2-GNUARM-NONE_v16.01" to the compiler options? What to do to remove warning "function bad_alloc() could not be resolved"?

A:the error is marked as Semantic errors, meaning e2Studio's indexer thinks there might be an error. I added these paths

  • "${TCINSTALL}\arm-none-eabi\include\c++\5.2-GNUARM-NONE_v16.01"
  • "${TCINSTALL}/arm-none-eabi/include/"
  • "${TCINSTALL}/lib/gcc/arm-none-eabi/5.2-GNUARM-NONE_v16.01/include"

to the SR_ShowRoom project properties using "C/C++ General\Paths and symbols" which does not affect the compiler parameters.

After that, the semantic errors disappeared.


Q: To run in RAM

We are developing an application with RZ and Guiliani. Our PCB is very similar to the Renesas Demo Board. After adapting the LCD ports, and debugging the driver for our Touch Panel, everything works correctly. We have used GSE to create our own resources, and after downloading, the system works well. By default, the Guiliani ShowRoom sample, run from the QSPI space, for this reason, we detect some slower behaviour than we expected to. We also can run in Debug session into RAM, using the RZA1H_GCC_RAM_APP.ld linker script.

What we need is to change the boot loader, linker script and any else necessary, in order to run in RAM from a copy of the code, made from the QSPI space in the Boot process, that means, in stand-alone start-up way.

Could you help us please, about what to make for getting success.

A: In the linker script there is a section .fast_code_section. Everything that is placed in this section will be run out of RAM.


Q2: The problem that we detect should be because the malloc() function does not use the .heap_section range signaled by the linker script file, and is trying to allocate memory in the bss range. Because of the model heap3 of FreeRtos, give the malloc() responsibility to the compiler functions, how can we order to the gcc compiler that it uses the .heap_section range for memory management functions?

A2: Heap_3.c maps pvPortMalloc to malloc().

malloc() is implemented in project SR_Showroom in function _sbrk() in module syscalls.c

Please note that syscalls.c MUST be linked with the application and NOT with the BSP project. If syscalls.c is linked with the BSP project, the wrong implementation of _sbrk() is linked which is part of the gcc C run-time library, This “wrong” implementation of _sbrk() locates the heap into the bss section.

The _sbrk() of syscalls.c locates the heap here

1 #define NL_HEAP_START (&_nl_heap_start)
2 #define NL_HEAP_END (&_nl_heap_end)

These above symbols are located in the linker command files GCC-QSPI-APP.ld or GCC-RAM-APP.ld:

 1 .heap_section (NOLOAD) :
 2 {
 3 . = ALIGN(0x8);
 4 end = .;
 5 PROVIDE(end = .);
 6 _nl_heap_start = .;
 7 PROVIDE(_nl_heap_start = .); /* referenced by syscalls.c _sbrk() for heap management */
 8 
 9 . = ABSOLUTE(RAM_END - 4);
10 _nl_heap_end = .;
11 PROVIDE(_nl_heap_end = .); /* referenced by syscalls.c _sbrk() for heap management */
12 } > RAM

You can, of course, use another implementation of _sbrk() and map the heap into the bss section.