Quantcast
Channel: Forum - Recent Threads
Viewing all 4262 articles
Browse latest View live

How to implement window switching on the LCD screen

$
0
0

Hi,everyone

I created some small objects in GUIX and I hope to implement window switching by operating on small objects. In e2 studio, after running the code, I didn't have any errors or warnings, but when I was burning the program, only the first window's interface could be displayed on the LCD screen, and the window could not be switched by clicking. . I hope you can help me.
The source code is as follows:

 

UINT window1_handler(GX_WINDOW *widget, GX_EVENT *event_ptr)
{
UINT result = gx_window_event_process(widget, event_ptr);

switch (event_ptr->gx_event_type)
{
case GX_SIGNAL(ID_CHECKBOX, GX_EVENT_TOGGLE_ON):
button_enabled = true;
update_text_id(widget->gx_widget_parent, ID_PROMPT_MAIN, GX_STRING_ID_BUTTON_STATUS);
update_text_id(widget->gx_widget_parent, ID_TEXT_BUTTON_STARTED, GX_STRING_ID_BUTTON_CONTINUE);
break;
case GX_SIGNAL(ID_CHECKBOX, GX_EVENT_TOGGLE_OFF):
button_enabled = false;
update_text_id(widget->gx_widget_parent, ID_PROMPT_MAIN, GX_STRING_ID_PROMPT_HOME);
update_text_id(widget->gx_widget_parent, ID_TEXT_BUTTON_STARTED, GX_STRING_ID_BUTTON_STATUS);
break;
case GX_SIGNAL(ID_TEXT_BUTTON_STARTED, GX_EVENT_CLICKED):
if(button_enabled){
show_window((GX_WINDOW*)&window2, (GX_WIDGET*)widget, true);
}
break;
default:
gx_window_event_process(widget, event_ptr);
break;
}

return result;
}

UINT window2_handler(GX_WINDOW *widget, GX_EVENT *event_ptr)
{
UINT result = gx_window_event_process(widget, event_ptr);

switch (event_ptr->gx_event_type)
{
case GX_SIGNAL(ID_BUTTON_HOME, GX_EVENT_CLICKED):
button_enabled = true;
if(button_enabled){
show_window((GX_WINDOW*)&window1, (GX_WIDGET*)widget, true);
}
break;
default:
gx_window_event_process(widget, event_ptr);
break;
}
return result;
}

 

Best regards,

ghg


Debugger stops "can't find source file", even with "step over"

$
0
0

Hello Forum,

I' using SSP 1.3.3 and S7 MCU, I had a small but working hhtp server application, web content started from usb mass storage.

But since a few days I always get the following debugger message (sse screenshot below) even if I want to step over the function call or place a breakpoint right after the function call.     USB media works without problem because I can read the volume name before calling fx_file_open().

    /* return requested resource or query */
    if(strcmp((const char*)resource,(const char*)"/index.html")==0)
    {
        fx_status = fx_file_open(p_eth->http.cfg.pv_fx_media, &fx_file_html,(CHAR *)"index.html", FX_OPEN_FOR_READ);

            if (fx_status != FX_SUCCESS)
            {
                tx_thread_sleep(TX_WAIT_FOREVER);
            }

   ......

}

 

 

I'm not sure whether I've changed something unintended in the project/debugger settings, or what ever could have happened?


Any idea or help, is very appreciated.

Thanks in advance and best regards

Ralph

 

 

Translator xliff format

$
0
0

Hi.

Once I have exported a file in xliff format from GUIX Studio, what steps should I take to translate the texts into the selected language and get the new file with the translated texts and be able to export it?

Thank you.

SSP 1.4 and ether_phy.c

$
0
0

I am using the functions phy_read() and phy_write() in ether_phy.c to access the ethernet chip registers.

With SSP 1.3, the preamble sent out 32 ones.  With SSP1.4, at the end of Phy_Init(), the preamble is set to 1.  This is done by: phy_record[channel].preamble_length = R_PHY_SUPPRESSED_PREAMBLE;.  Because of this, subsequent phy_read and phy_writes fail.  The chip needs the preamble to be 32 to respond.  What was the purpose of this change?

Filex ftell() equivalent

$
0
0

Hi,

I'm trying to port a file handling library that uses the ftell() function

Filex does not seem to have a direct equivalent

the ftell() function returns the current file position of the given stream (file pointer).

 

I see FX_FILE contains the fx_file_current_file_offset field

is the what is sound like? the current position of the internal read write pointer?

 

thanks

gx_system_canvas_refresh()

$
0
0

Hi team,

In a program derived from your 5228.GUIApp_draw_shapes_PEHMI1_130.zip file I get different behaviors of the function gx_system_canvas_refresh ().

The following subroutines is defined in window3 | Draw Function property of GUIX Studio:

VOID window3_draw(GX_WINDOW *cur_window)
{
  GX_RECTANGLE rect;
  GX_POINT pixelpos;
  GX_VALUE ix,iy;
  UINT status;
  ioport_level_t s1btn;

  /* Invoke GUIX window drawing function. */
//status = gx_window_draw(widget);   // Produces compile errors
  gx_window_draw(cur_window);           // Correctly compiled

  /* Define the brush of the current screen context. */
  status = gx_context_brush_define(GX_COLOR_ID_SELECTED_FILL,
                                                     GX_COLOR_ID_SELECTED_FILL,
                                                     GX_BRUSH_ALIAS | GX_BRUSH_SOLID_FILL);

  /* Draw 1 pixels frame around the display. */
  status = gx_context_brush_width_set(1);
  status = gx_context_brush_define(GX_COLOR_ID_RED, GX_COLOR_ID_RED, GX_BRUSH_OUTLINE);
  rect.gx_rectangle_left = 0;
  rect.gx_rectangle_top= 0;
  rect.gx_rectangle_right = 799;
  rect.gx_rectangle_bottom = 599;
  status = gx_canvas_rectangle_draw(&rect);

  /* Set 3 pixels brush width. */
  status = gx_context_brush_width_set(3);

  /* Draw empty shapes */
  status = gx_context_brush_define(GX_COLOR_ID_BLUE, GX_COLOR_ID_RED, GX_BRUSH_OUTLINE);
  status = gx_canvas_line_draw(10, 10, 110, 70);
  rect.gx_rectangle_left = 10;
  rect.gx_rectangle_top= 100;
  rect.gx_rectangle_right = 110;
  rect.gx_rectangle_bottom = 130;
  status = gx_canvas_rectangle_draw(&rect);
  status = gx_canvas_circle_draw(60, 200, 50);
  status = gx_canvas_arc_draw(60, 320, 50, 0, 90);
  status = gx_canvas_ellipse_draw(60, 400, 10, 50);
  status = gx_canvas_pie_draw(60, 540, 50, 0, 90);

  /* Draw filled shapes */
  status = gx_context_brush_define(GX_COLOR_ID_BLUE, GX_COLOR_ID_RED, GX_BRUSH_SOLID_FILL);
  status = gx_canvas_line_draw(210, 10, 310, 70);
  rect.gx_rectangle_left = 210;
  rect.gx_rectangle_top= 100;
  rect.gx_rectangle_right = 310;
  rect.gx_rectangle_bottom = 130;
  status = gx_canvas_rectangle_draw(&rect);
  status = gx_canvas_circle_draw(260, 200, 50);
  status = gx_canvas_arc_draw(260, 320, 50, 0, 90);
  status = gx_canvas_ellipse_draw(260, 400, 10, 50);
  status = gx_canvas_pie_draw(260, 540, 50, 0, 90);

  /* Draw a square using single points */
  for (ix=400; ix<450; ix++)
  {
    for (iy=10; iy<60; iy++)
    {
      pixelpos.gx_point_x=ix;
      pixelpos.gx_point_y=iy;
      status = gx_canvas_pixel_draw(pixelpos);
    }
  }

  /* Draw texts */
  status = gx_context_font_set(GX_FONT_ID_VERABD06);
  status = gx_canvas_text_draw(400, 100, "MPAutomation", 12);
  status = gx_context_font_set(GX_FONT_ID_VERABD08);
  status = gx_canvas_text_draw(400, 150, "MPAutomation", 12);
  status = gx_context_font_set(GX_FONT_ID_VERABD16);
  status = gx_canvas_text_draw(400, 200, "MPAutomation", 12);
  status = gx_context_font_set(GX_FONT_ID_VERA16);
  status = gx_canvas_text_draw(400, 250, "MPAutomation", 12);
  status = gx_context_font_set(GX_FONT_ID_VERABL16);
  status = gx_canvas_text_draw(400, 300, "MPAutomation", 12);
  status = gx_context_font_set(GX_FONT_ID_VERALT16);
  status = gx_canvas_text_draw(400, 350, "MPAutomation", 12);
  status = gx_context_font_set(GX_FONT_ID_VERABD24);
  status = gx_canvas_text_draw(400, 400, "MPAutomation", 12);
  status = gx_context_font_set(GX_FONT_ID_VERABD32);
  status = gx_canvas_text_draw(400, 450, "MPAutomation", 12);
  status = gx_context_font_set(GX_FONT_ID_VERABD40);
  status = gx_canvas_text_draw(400, 500, "MPAutomation", 12);
  status = gx_system_canvas_refresh();              // 11111111111111111111111111111

  s1btn = IOPORT_LEVEL_HIGH;                         // On DK-S7G2 Main board S5 must be ON
  do
    g_ioport.p_api->pinRead(IOPORT_PORT_00_PIN_06, &s1btn);
  while (IOPORT_LEVEL_HIGH == s1btn);           // Wait S1 pressed
  do
    g_ioport.p_api->pinRead(IOPORT_PORT_00_PIN_06, &s1btn);
  while (IOPORT_LEVEL_LOW == s1btn);            // Wait S1 released

  status = gx_context_brush_define(GX_COLOR_ID_WHITE, GX_COLOR_ID_WHITE, GX_BRUSH_SOLID_FILL);
  rect.gx_rectangle_left = 0;
  rect.gx_rectangle_top= 0;
  rect.gx_rectangle_right = 799;
  rect.gx_rectangle_bottom = 599;
  status = gx_canvas_rectangle_draw(&rect);      // Clear display
  status = gx_context_font_set(GX_FONT_ID_VERABD16);
  status = gx_canvas_text_draw(50, 50, "MPAutomation", 12);
  status = gx_system_canvas_refresh();             //2222222222222222222222222222222

  s1btn = IOPORT_LEVEL_HIGH;
  do
    g_ioport.p_api->pinRead(IOPORT_PORT_00_PIN_06, &s1btn);
  while (IOPORT_LEVEL_HIGH == s1btn);              // Wait S1 pressed
}

It works perfectly up to first call of  gx_system_canvas_refresh()  // 11111111111111111111111111111).

But after I do not see the other few representations despite with the debug I see the code executed and I always get correct results (status always = 0). The second call of  gx_system_canvas_refresh(); //2222222222222222222222222222222  has no effect.
is it a threads problem?

I add the reason for this code. I should quickly bring on Synergy S7G2 another old firmware that used elementary graphic functions (lines, rectangles, text, etc.) to represent different windows, depending on external events (state of digital inputs and actions on the touch screen).

Any help will be really appreciated.

Thanks in advance and best regards.

MPGA

 

ssp 1.4.0

$
0
0

I have update ssp version 1.3.0 to 1.4.0 and Its gives Error in my program, anyone can give me ans why this error is generated???

 

 

How to make "pixelmap slider" automatically slide according to the change of value

$
0
0

Hi,everone

I am working on a GUIX to achieve an animation effect, I have encountered some problems, I hope you can help me. In the algorithm in e2 studio, I calculate a percentage of data (the percentage will gradually change from 100% to 10%) and create a pixelmap slider in GUIX. I want to make the pixelmap slider change at the same time as the percentage data, but also at the same time (from the original length), what function should I call? How to achieve this function? I hope you can give me some advice.

Best regards,

ghg


Generate prf pulse using timer

$
0
0

i want to generate prf pulse 512hz using timer R7FS7G27H3A01CFC CONTROLLER so which timer i can use agt timer or gpt timer? and how? plz suggest ...

Flashloader Application change: bootloader + Downloader in Blocking mode flashloader project

$
0
0

Hello All,

 

I gone through the application note of the synergy flashloader.

 

I want to build the Blocking mode bootloader which have Bootloader as well as downloader in single file and the remaining application code is in another code so my basic flow is some what like below mention :

 

1) first in application if someone push the button then it will reset the MCU.

2) By this the application is in bootloader mode as the program counter starts from the 0x000000h so that resides the bootloader code .

3) in that i will download the new code in the same slot as the old version code resides by erasing the slot and writing new one.

4) Now i jump to the application by AppStart command .

 

Is this possible any way please suggest me solution of the same!

 

In the flashloader example code the technique is quite different it has the technique of the swapping between two codes, but what about i use the upper method ?

 

thanks  in advance ...

SHA-256 generation didn't works on the S7

$
0
0

Hi

I want to  use the hash S7 function.

I starts with the sha2_example function:

static uint32_t    sha256InitialValue[8] =
{
    0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
    0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
};

/* padded message buffer (for message string "abc") */
static uint32_t  InputMessage[16] =
{
    0x61626380, 0x00000000, 0x00000000, 0x00000000,
    0x00000000, 0x00000000, 0x00000000, 0x00000000,
    0x00000000, 0x00000000, 0x00000000, 0x00000000,
    0x00000000, 0x00000000, 0x00000000, 0x00000018
};

/* expected output sha1 message digest */
static uint32_t ExpectedMD[8] =
{
    0xBA7816BF, 0x8F01CFEA, 0x414140DE, 0x5DAE2223,
    0xB00361A3, 0x96177A9C, 0xB410FF61, 0xF20015AD
};

static uint32_t InputMessageLen = 16;


/* The example below shows usage for the SHA1 driver.
 * The example below computes the sha2 hash for an input message "abc".
 */
void sha2_example (void)
{
    ssp_err_t iret;
    int i = 0;

    uint32_t OutputMD[8];

    /* configure the SHA256 driver */
    iret = (ssp_err_t) g_sce_hash_sha256.p_api->open(g_sce_hash_sha256.p_ctrl, g_sce_hash_sha256.p_cfg);
    if(iret != SSP_SUCCESS)
    {
        printf("ERROR open [%d]\r\n", iret);
        return;
    }

    /* initialize the sha2 hash value */
    memcpy(OutputMD, sha256InitialValue, 32);

    /* process the input message data and update the sha2 hash value
       64-byte blocks from the input message are processed
    */
    iret = (ssp_err_t) g_sce_hash_sha256.p_api->hashUpdate(g_sce_hash_sha256.p_ctrl,InputMessage, InputMessageLen, OutputMD);
    if(iret != SSP_SUCCESS)
    {
        printf("ERROR hashUpdate [%d]\r\n", iret);
        return;
    }

    /* close the sha2 driver */
    iret = (ssp_err_t) g_sce_hash_sha256.p_api->close(g_sce_hash_sha256.p_ctrl);
    if(iret != SSP_SUCCESS)
    {
        printf("ERROR close [%d]\r\n", iret);
        return;
    }

    printf("\n\rSHA2 Input Message\n\r");
    printf("InputMessage[%d] = ", InputMessageLen);
    for(i=0; i < InputMessageLen; i++)
    {
        printf(" 0x%08x,", InputMessage[i]);
    }
    printf("\n");
    printf("OutputMD[%d] = ", 8);
    for(i=0; i < 8; i++)
    {
        printf(" 0x%08x,", OutputMD[i]);
    }
    printf("\n");
    printf("ExpectedMD[%d] = ", 8);
    for(i=0; i < 8; i++)
    {
        printf(" 0x%08x,", ExpectedMD[i]);
    }
    printf("\n");

    /* check if the sha2 value returned matches the expected value */
    if (memcmp(OutputMD, ExpectedMD, 32) != 0)
    {
        printf("! SHA2 hashing failed !\n\r");
    }
}

But I've got a bad result !

OutputMD[8] =  0xa94b467f, 0x38048650, 0x785dc28a, 0x8679266a, 0x41aed18a, 0x0fb178b4, 0x95f3b17f, 0x2e9a21d3,

 

Nobody have the same problem ?

Thanks

SD RAM

$
0
0

Hello everyone,In S7G2 Board I have not SDRAM I Have SDCARD so In LCD program What I Should Write In place of sdram.

 

Is it possible to install newer GNU toolchains?

$
0
0

I'm wondering if it is possible to install newer toolchains to get support for newer language standards, such as C++17.

According to https://en-us.knowledgebase.renesas.com/English_Content/Renesas_Synergy%E2%84%A2_Platform/Renesas_Synergy_Knowledge_Base/How_do_I_Manually_Integrate_the_GCC_Toolchain_into_e2_Studio_and_SSP%3F it should be possible to manually integrate the GNU ARM toolchain but if I try this, e2 Studio won't recognize it and complain with "Unable to detect toolchain in specified path, please ensure e2 studio toolchain support is installed for target device.".

 

Does Renesas Synergy use a customized toolchain or is it possible to use this one: developer.arm.com/.../gnu-rm

START and STOP bit disable in SIMPLE SPI MODE

$
0
0

Hello.

 

I'm working with and S124 and I would like to know if it is possible to skip the "start" and "stop" bits while sending data through the UART in SIMPLE SPI MODE.

I want to send ONLY 8 bits, not 10. 

 

Thanks.

After ID-CODE setting, How to disable?

$
0
0

Hi. 

 

After ID-Code setting, I would like to disable protection. 
so I set IDCODE by "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 
After build, I tried to download .

but it can't download by J-Flash Lite
How to solve this problem.
Or is it not possible to release it once it is set?

 

 

 

Thanks


Timer to use

$
0
0

i have our own custom board use R7FS7G2H3A01CFC controller , i want to generate frequency 512 hz using timer so which timer i can use agt timer or gpt timer ? and how give me suggest..

FileX causes memory corruption on read with SF_EL_FX_BlockDriver triggered by USB-mass-storage-device

$
0
0

The SF_EL_FX_BlockDriver function doesn't respect the defined size of the media memory on read.
At first, the SSC has an issue showing a senseless warning when setting the memory size greater than 512 bytes (the sector size). But the definition of the buffer size of g_media_memory_g_fx_media0 will be made correct. May be that there are other settings affected by this issue.

But independent from the settings of the media-size the SF_EL_FX_BlockDriver-function reads the number of sectors requested by the USB-read-function.
Here is the end of the g_media_memory_g_fx_media0 to see. Direct subsequent lies the memory for the packet-pool of the network interface.

As long as the USB-driver wants to read only 1 or 2 sectors at a time the system works normally. But often the USB wants to read more sectors (8 in this case). Now the border of the media-memory is busted and 4096 Bytes (8 sectors) of disk-content were read flooding the packet-pool of the network-interface and brings it out of function because no new packet can be allocated and processed. From this point on USB continues working normally and network is dead.

the and of the media-memory

 

the end of the 4096 bytes read by the driver

Attached is an example to test this issue on an DK-S7G2 eval board.Connect network an both USB (J2 and J7) with your PC.
After flashing and starting the programm the IP got by DHCP is to see within a breakpoint in the variable "gtext". Type in browser "http://<the_IP>/usbon". Now you will hear the typical USB-sound on your PC and there will be a new drive. Format this drive and copy some files on it.
Restart the board (because network was dead already) and enter in browser "http://<the_IP>". Now you will see directory of the drive just formatted and be able to download the listed files. The USB-drive will not be visible on the PC till now.
If you now call "http://<the_IP>/usbon" again, the USB-drive will appear on the PC but you will not longer be able to access the network.

(Please visit the site to view this file)

ThreadX periodic task awakening (analogue of FreeRTOS vTaskDelayUntil() )

$
0
0

Hello!


Is there a way in ThreadX to make thread awake from sleep in loop with constant frequency? tx_thread_sleep() suspends thread for count of ticks relative to tick on which it was called. What I need is, for example, wake up my thread every 100ms regardless of execution time before sleep is called.


In FreeRTOS there is a function vTaskDelayUntil() for exactly this. You just need to store tick count (let's say it's variable TICKS) before first vTaskDelayUntil(PERIOD) call and everytime you call it it would suspend thread until TICKS+PERIOD tick and add PERIOD to TICKS variable for subsequent call.


Is there a simple way to do the same in ThreadX? I'd prefer to avoid creating timers and toggling semaphores for such task.


Thanks in advance, Eighth

snprintf (printf) 64 bit integer uint64_t

$
0
0

We fail to use snprintf() with typical printf-formatter to create hex or decimal strings from uint64_t values.

    uint64_t a = 0x1122334455667788L;
    snprintf( buf, 20, "%x", a); // => 11223344
    snprintf( buf, 20, "%lx", a); // => 11223344
    snprintf( buf, 20, "%llu", a); // => lu
    snprintf( buf, 20, "%llx", a); // lx

Any ideas?

 

SDCARD

$
0
0

If Anyone has SDCARD Reference program Then please Give me. 

Viewing all 4262 articles
Browse latest View live