No announcement yet.

uSD_Image hangs using GC

  • Filter
  • Time
  • Show
Clear All
new posts

  • uSD_Image hangs using GC

    I've created a project using GC

    and followed the directions from the uSD_Image page see below...
    the uSD_Image call never returns... That is I see the start message but not the end.

    What have I missed?

    Requires Graphics Composer version

    The image and video formats under 4DGL has changed slightly from the serial platform versions.
    The image height, width and colour_mode(colour bits per pixel) parameters are now embedded into the
    image data block and does not require the user to pass these parameters to the image/video display functions.

    Getting Started:
    - Make sure to download the latest Graphics Composer version
    - You'll need a SD card reader/writer.
    - Run the GC and create a new project.
    - Enable the following settings:

    "Device" -> "Load Options" -> "Com Port/Drive" = (your drive name for the card reader, eg J
    "Device" -> "Load Options" -> "Write Command Block" = NO
    "Device" -> "Load Options" -> "Image Format" = Image & Pixel Data

    - Change the properties of the display resolution to

    X = 240, Y = 320

    - On the left "Actions" window pane right click the mouse button and add the following images:


    - Save your project, e.g ImageDemo1.gcs
    - Select "Device" -> "Load" to save all of the image data into the uSD card.
    - Using a text editor (eg Notepad) open the ImageDemo1.txt file the GC has created.
    Note down each of the sector addresses for each of the images. You will need these for the
    uSD_SetSector(SectHiWord, SectLoWord) function. In this case the sector addresses have already been
    inserted into the uSD_SetSector() function calls for each image for this example programas can be seen below.


    func screenSplash()
    uSD_SetSector(0x0020,0x0000); //from GC .txt file Location=0x200000


    func main()

    while(uSD_Init() == 0) // initialise and test the uSD card

    print("PLEASE INSERT uSD CARD\r");


    // ...

  • #2

    The value in the .txt file created by the Graphics Composer is the byte address of the image. In order to set the "uSD_SetSector" sector address, you must divide by 0x200 (512 bytes/sector).

    For an image stored at 0x00200000, use "uSD_SetSector(0x0000, 0x1000);".

    See the 4DGL demo program code below the comments section that you quoted above. The first image on the uSD card is always written at byte 0x200000 or sector 0x1000 by the Graphics Composer.

    Any technology, sufficiently developed, is indistinguishable from magic. A.C. Clark(RIP)

    NEW! Lower prices on all 4D Systems products for 2009 and continuing into 2010!