Announcement

Collapse
No announcement yet.

uSD initialization

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • uSD initialization

    Hi

    i m developing a GUI based on Workshop 3 IDE Visi and uLCD-32PT_GFX2. I was coding and downloading code and run. But i started getting an uSD initialization problem after adding a number of buttons into form5. gci file size is over 1MB while dat file is around 4Kb. Since uSd can not be initalized succesfully hndl=LoadImageControl causes reseting the module and this goes on forever.

    Could you please suggest what can i do?

    best regards,
    Serkan

  • #2


    If the problem occured when you added a couple of buttons, then maybe you are out of memory.

    But, really, a couple of buttons doesn't use that much memory.

    An image control uses (IIRC) 512 + 46 bytes, plus 28 times the number of image/video elements (i.e. lines in the .dat file)

    Of course, that doesn't mean those couple of buttons ( i.e. ~ 56 bytes) didn't drive your program over the edge.

    If you already have #MODE RUNFLASH and are compiling to FLASH then you need to look at why you are using so much memory and use it more efficiently
    Mark

    Comment


    • #3

      i replayed with uSD drive function and cleared that issue but another problem rised which i dont know what to do. Below is my uSD init function;

      func InitDrive()

      putstr("Mounting...\n");

      if (!(disk:=file_Mount()))
      while(!(disk :=file_Mount()))
      putstr("Drive not mounted...");
      pause(200);
      gfx_Cls();
      pause(200);
      wend
      endif

      putstr("Drive mounted...");

      hndl := file_LoadImageControl("IffEthUi.dat", "IffEthUi.gci", 1);

      pause(1000);

      endfunc

      it works well. but i m only seeing blue screen on the screen. therefore, i put a few putstr within my main menu and saw my logs on the screen.

      func main()

      gfx_Set(SCREEN_MODE,LANDSCAPE) ;

      touch_Set(TOUCH_ENABLE);

      gfx_TransparentColour(0x0020);

      gfx_Transparency(ON);

      InitDrive();

      InitSerialPort();

      InitTimer();

      AnaMenu();

      func AnaMenu () // FORM-1

      putstr("Ana menu -1");


      img_SetWord(hndl, icit, IMAGE_FLAGS, (img_GetWord(hndl, icit, IMAGE_FLAGS) | I_STAYONTOP) & ~I_TOUCH_DISABLE);
      img_SetWord(hndl, iaapgayar, IMAGE_FLAGS, (img_GetWord(hndl, iaapgayar, IMAGE_FLAGS) | I_STAYONTOP) & ~I_TOUCH_DISABLE);
      img_SetWord(hndl, isinyal, IMAGE_FLAGS, (img_GetWord(hndl, isinyal, IMAGE_FLAGS) | I_STAYONTOP) & ~I_TOUCH_DISABLE);
      img_SetWord(hndl, icalismamodu, IMAGE_FLAGS, (img_GetWord(hndl, icalismamodu, IMAGE_FLAGS) | I_STAYONTOP) & ~I_TOUCH_DISABLE);
      img_SetWord(hndl, iipayar, IMAGE_FLAGS, (img_GetWord(hndl, iipayar, IMAGE_FLAGS) | I_STAYONTOP) & ~I_TOUCH_DISABLE);

      putstr("Ana menu -2");
      repeat

      gfx_BGcolour(DODGERBLUE) ;

      gfx_Cls() ;

      putstr("Ana menu -3");

      img_Show(hndl,iStatictext1) ;

      img_SetWord(hndl, icit, IMAGE_INDEX, state);img_Show(hndl,icit) ;

      img_SetWord(hndl, iaapgayar, IMAGE_INDEX, state);img_Show(hndl,iaapgayar) ;

      img_SetWord(hndl, isinyal, IMAGE_INDEX, state); img_Show(hndl,isinyal) ;

      img_SetWord(hndl, icalismamodu, IMAGE_INDEX, state); img_Show(hndl,icalismamodu) ;

      img_SetWord(hndl, iipayar, IMAGE_INDEX, state); img_Show(hndl,iipayar) ;

      putstr("Ana menu -4");
      TouchListen();

      I m only seeing putstr results on the screen which indicates that image control functions are not working for some reason since none of the button like icalismamodu can be seen on the screen.

      Do you have any idea what may disable image control functionaly?

      Best regards,
      Serkan

      Comment


      • #4


        You need to check whether

        hndl := file_LoadImageControl("IffEthUi.dat", "IffEthUi.gci", 1);

        is working.

        Check the handle for a non 0 value.

        If it is 0 check that the files exist.

        Also check that you are not running out of memory. (Are you already using #MODE RUNFLASH and saving to flash?)
        Mark

        Comment


        • #5


          I tougth that run from flash automatically inserted by gui when i choose flash as destination. I added #mode runflash and problem cleared,havent seen the same problem again yet.

          Thanks for valuable helps

          Best regards,
          Serkan

          Comment


          • #6


            No, destination of flash just stores the program in flash (as opposed to ram).

            You need the extra line to get it to run from flash (as opposed to being copied to ram and run from there)
            Mark

            Comment


            • #7


              I see what you mean,

              Thanks a lot
              Serkan

              Comment

              Working...
              X