BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - mmottola

Pages: [1]
1
Discussion - EVE / Stencils with Fonts
« on: February 02, 2023, 06:40:04 PM »
I'm trying to use the stencil buffer to mask text outside of a set region. Below are the commands run in ESE. My intuition was that the text could be treated as a rectangular box which appears incorrect. I'm assuming the issue is related to how the font's bitmap cells may be overlapping?
  • Any explanation of how the stencil buffer is being incremented with regards to a font's bitmap cells and why there appears to be artifacts from some of these cells?
  • How can I achieve the desired effect shown in RECTS Ref 1 but with text?

Code: [Select]
CLEAR_COLOR_RGB(128,128,128)
CLEAR(1, 1, 1)

STENCIL_OP(INCR, INCR)
COLOR_A(128)
BEGIN(RECTS)
VERTEX2F(720, 576)
VERTEX2F(16383, 9600)
END()
COLOR_A(255)
STENCIL_FUNC(GEQUAL, 0, 255) // Ref 0-4
COLOR_RGB(96,96,96)
BEGIN(RECTS)
VERTEX2F(720, 0)
VERTEX2F(1504, 1152)
END()
COLOR_RGB(255,255,255)

//BEGIN(RECTS)
//VERTEX2F(0, 768)
//VERTEX2F(1504, 960)
//END()

CMD_TEXT(0, 36, 30, 0, "TESTS")

2
Discussion - EVE / Issues Porting ESD Exports with Animations
« on: November 17, 2022, 06:56:40 PM »
I am attempting to port an exported ESD project to the STM32H743/753 series MCUs by following this guide.
https://brtchip.com/wp-content/uploads/2021/06/ESD-4.10-Exported-Project-Porting-Guide-for-STM32L4-Discovery-Board-and-FreeRTOS.pdf
The ports of "EVE_HalImpl_....c" & "EVE_Platform_....h" for the STM32 were derived from the files found here.
https://github.com/kaetemi/nuklear_eve/tree/master/samples/STM32L476GDISCOVERY/Src/Eve/dependencies/eve_hal

The screen would appear as a white blinding effect and glitches whenever an animation was displayed. I verified that the flash was properly functioning and programmed with the flash file from the ESD exported project Data folder using the EAB. In addition to the EVChargePoint project, I exported and ported the PlayAnimation project. Similar issues were encountered, and the attached GIFs show what occurred.
  • AnimationIssue_Init.gif: Following powerup, the last calibration point is touched
  • AnimationIssue_Start.gif: Following calibration, the location where "Start" pushbutton should be displayed is touched
  • AnimationIssue_Stop.gif: Following starting the animation, the location where "Stop" pushbutton should be displayed is touched

Here's the output when running the project:
Code: [Select]
Copyright (C) Bridgetek Pte Ltd
sizeof(Esd_GpuHandle): 4
sizeof(Esd_ResourceInfo): 16
sizeof(Esd_FontInfo): 44
sizeof(Esd_RomFontInfo): 8
EVE ROM_CHIPID after wake up 0
EVE ROM_CHIPID after wake up 0
EVE ROM_CHIPID after wake up ffffffff
EVE chip id 817 1.0
EVE register ID after wake up 7c
EVE clock frequency set to 72 MHz
Single channel SPI
All engines are ready
Display refresh rate set to
Configure coprocessor defaults
EVE configuration ready
Esd_Calibrate: Start Frame
Esd_Calibrate: End Frame
Touch screen transform values are A 0x1069c,B 0xffffed07,C 0xef03a,D 0x335,E 0xffc3, F 0xfff3f012
Flash OK
Use handle 0, font 31
Use handle 1, font 27

In a new STM32 project I implemented a similar approach to drawing animations using a modified version of Rudolph's library and a simple 250x250 2 frame gif converted to an animation.
https://github.com/RudolphRiedel/FT800-FT813
The commented lines labeled TEST CODE were uncommented to match the commands being executed within the exported project file Esd_lion.c's Esd_lion_lionStart_Signal, Esd_lion_lionEnd_Signal, & Esd_lion_Render_Signal functions. Regardless, calling the below SAMAPP_Animation function within the main while loop resulted in the animation being rendered properly as shown in the AnimationSimple.gif.
Code: [Select]
static void SAMAPP_Animation(uint8_t *init, uint8_t *refresh, Button_Param_s **buttons, uint8_t num_buttons, uint8_t* anim_state)
{
  uint32_t rd32_val;
  static uint8_t anim_state_prev = 0;
 
  if(*init){
    if(!cmd_fifo_busy_blk()){
      *anim_state = 0;
      anim_state_prev = 0;
   
      cmd_fifo_buffer_clr();
      cmd_fifo_buffer_wr(CMD_DLSTART);
      cmd_fifo_buffer_wr(CLEAR(1, 1, 1));
     
      cmd_fifo_buffer_wr(BEGIN(RECTS));
      cmd_fifo_buffer_wr(TAG(SAMAPP_ANIMATION_TOUCHTAGS_BACKGROUND));
      cmd_fifo_buffer_wr(COLOR_RGB(0,0,0));
      cmd_fifo_buffer_wr(VERTEX2F(0, 0));
      cmd_fifo_buffer_wr(VERTEX2F(16383, 9600));
      cmd_fifo_buffer_wr(END());
     
      cmd_fifo_buffer_wr(BEGIN(RECTS));
      cmd_fifo_buffer_wr(TAG(SAMAPP_ANIMATION_TOUCHTAGS_ANIMATION));
      cmd_fifo_buffer_wr(COLOR_RGB(255,255,255));
      cmd_fifo_buffer_wr(VERTEX2F(6192, 2800));
      cmd_fifo_buffer_wr(VERTEX2F(10192, 6800));
      cmd_fifo_buffer_wr(END());
     
      cmd_animframe(EVE_HSIZE/2,EVE_VSIZE/2,SIMP_ANIM_ADDR,0);
//      cmd_animdraw(1); // XXX: TEST CODE
           
      button_widget_loop_cfb(buttons,num_buttons);
     
      cmd_fifo_buffer_wr(DISPLAY());
      cmd_fifo_buffer_wr(CMD_SWAP);
      cmd_fifo_buffer_tx_blk();
     
      *init = 0;
    }
  }
  else if( *refresh || *anim_state ){
    if(!cmd_fifo_busy_blk()){
   
      host_rd32_blk(REG_DLSWAP,&rd32_val);
      if( 0 == rd32_val ){
        cmd_fifo_buffer_clr();
        cmd_fifo_buffer_wr(CMD_DLSTART);
        cmd_fifo_buffer_wr(CLEAR(1, 1, 1));
       
        cmd_fifo_buffer_wr(BEGIN(RECTS));
        cmd_fifo_buffer_wr(TAG(SAMAPP_ANIMATION_TOUCHTAGS_BACKGROUND));
        cmd_fifo_buffer_wr(COLOR_RGB(0,0,0));
        cmd_fifo_buffer_wr(VERTEX2F(0, 0));
        cmd_fifo_buffer_wr(VERTEX2F(16383, 9600));
        cmd_fifo_buffer_wr(END());
       
        cmd_fifo_buffer_wr(BEGIN(RECTS));
        cmd_fifo_buffer_wr(TAG(SAMAPP_ANIMATION_TOUCHTAGS_ANIMATION));
        cmd_fifo_buffer_wr(COLOR_RGB(255,255,255));
        cmd_fifo_buffer_wr(VERTEX2F(6192, 2800));
        cmd_fifo_buffer_wr(VERTEX2F(10192, 6800));
        cmd_fifo_buffer_wr(END());
       
        if( *anim_state != anim_state_prev ){
          if(*anim_state){
            cmd_animstart(1,SIMP_ANIM_ADDR,ANIM_LOOP);
            cmd_animxy(1,EVE_HSIZE/2,EVE_VSIZE/2);
            cmd_animdraw(1);
          }
          else{
            cmd_animstop(1);
            cmd_animframe(EVE_HSIZE/2,EVE_VSIZE/2,SIMP_ANIM_ADDR,0);
//            cmd_animdraw(1); // XXX: TEST CODE
          }
          anim_state_prev = *anim_state;
        }
        else{
          if(*anim_state){
//            cmd_animxy(1,EVE_HSIZE/2,EVE_VSIZE/2); // XXX: TEST CODE
            cmd_animdraw(1);
          }
          else{
            cmd_animframe(EVE_HSIZE/2,EVE_VSIZE/2,SIMP_ANIM_ADDR,0);
//            cmd_animdraw(1); // XXX: TEST CODE
          }
        }
       
        button_widget_loop_cfb(buttons,num_buttons);
       
        cmd_fifo_buffer_wr(DISPLAY());
        cmd_fifo_buffer_wr(CMD_SWAP);
        cmd_fifo_buffer_tx_blk();
      }
    }
  }
}

Following that I updated the displays flash with the exported projects bin file and changed the programs SIMP_ANIM_ADDR to point to the location of the lion animation object. The white blinding effect and glitches appeared again. I also tried to rebuild the bin file using the lion.anim file in EAB, but as expected there wasn't a difference between the files and the issues still occurred. I'm assuming there is some issue relating to the lion.anim file (and AnimationScreensaver.bin). Any idea what could be the underlying issue or potential limitations with respect to displaying animations on the physical hardware that may not appear within ESD?

Pages: [1]