Announcement

Collapse
No announcement yet.

uVGA-II in GFX mode - How to update the user program from a micro-SD card

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

  • uVGA-II in GFX mode - How to update the user program from a micro-SD card

    Hi,

    From the Application Note: 4D-AN-1012 "Loading a Pre-Compiled 4DGL program" I understood that to update the program loaded by the user into the FLASH memory of the PICASO-GFX2 one should do the following :
    - use a programmer (programming cable or USB-CE5) connecting a PC to the uVGA-II
    - transfer the program from the 4DWorkshop3 IDE or from DOS command line using Load4DGLProgram.4dSrcipt

    I was wondering if there is a way to upload the user program into the FLASH memory of the PICASO-GFX2 from a micro-SD card inserted in the reader of the uVGA-II?

    Reading though the "PICASO-GFX2-4DGL-Internal-Functions-rev6.pdf" I discovered that the following functions can load 4DGL code from the micro-SD card :
    - file_LoadFunction(fname.4XE)
    - file_Run(fname.4XE, arglistptr)
    - file_Exec(fname.4XE, arglistptr)
    As far as understand, these functions load pre-compiled code into RAM but not into flash.

    If the user program cannot be loaded into FLASH from the micro-SD, I looks like these functions could be used to load a program from the micro-SD card into RAM to be executed. So if the program to be pickup from the card is updated (with same file name) then the upload program is run from the card.

    Could someone tell me what is really possible to update the program in the FLASH memory?

    The project I am working on involves a ARDUINO MEGA that will communicate with the uVGA-II. There will be a connection betwenn the UART1 port of the uVGA-II and the UART0 port on the ARDUINO MEGA. The PORT0 is used to program the ARDUINO MEGA through USB with the help of the BootLoader. I was wondering if it would be possible for the u-VGA-II to read the ARDUINO program to be uploaded in the FLASH memory of the ARDUINO MEGA from the micro-SD card and then transmit it to the ARDUINO so that the Bootloader puts that program in the FLASH memory.

    My aim is to have all the firmware updates onto a micro-SD card so that they can be loaded in the uVGA-II and the ARDUINO MEGA. This would avoid having to update through a USB connection and then from the micro-SD card for the uVGA-II.

    Thanks in advance for the help,


    Cheers,
    ERIC

  • #2


    Looks likes the feature to be able to load user program updates from the SD-card was already asked for :

    http://4d.websitetoolbox.com/post/Module-updating-strategies-4591988?highlight=firmware+update

    Comment


    • #3


      Actually the way I read it he was asking for something quite different and two different things.

      The FLASH program update the way he asked can be done today, using Load4DGLProgram.4dScript which you seem to have followed.

      I can't quite understand what you are asking for, but anyway here's the two 'bits' with question marks

      I was wondering if there is a way to upload the user program into the FLASH memory of the PICASO-GFX2 from a micro-SD card inserted in the reader of the uVGA-II?
      No, that cannot be done.

      Could someone tell me what is really possible to update the program in the FLASH memory?
      You can use the same technique Load4DGLProgram.4dScript uses.

      Trying to read between the lines and still follow what you are saying it looks like if you were going to use the Arduino to (re) program the display you would need to use the display to load the program off its uSD first. This sounds quite prone to error and/or 'effective' bricking.

      Wouldn't it be better to have a small constant stub program in the display's FLASH that simply does a file_Run of a constant filename?
      Mark

      Comment


      • #4


        Sorry If was not very clear in my questions.

        OK, so direct update of the user program loaded in the uVGA-II from the micro-SD card. But as we discussed in another thread if the loaded program "load" a subprogram from the microSD card, just replacing that sub-program's file on the card amounts to updating the running program. That is cool!

        Ok for Load4DGLProgram.4dScript. But I would like not to use a PC linked through a USB-serial connection to the uVGA-II.


        Thanks for "trying to read between the lines". Not an easy task.

        Actually for that last point, the aim is to update the program running on the ARDUINO. So I was wondering if the uVGA-II could actually act as a ARDUINO programmer. Normally the ARDUINO program is send by the IDE (or avrdude) to the board through the USB-Serial connection. It woulb be nice to be able to connect the UART1 port of the uVGA-II to the UART0 port on the ARDUINO MEGA and have the uVGA-II send the ARDUINO program through that connection. Actually the ARDUINO program would be stored on the micro-SD card (of the uVGA-II) and the uVGA-II (in GFX mode) would need to read the file and send it "at the same time". Hope it is clearer. To me it sound theoretically feasible, though may be not that easily implemented.

        Comment


        • #5


          I have no idea what the Arduino loading algorithm is, but I can see no reason why it couldn't be written in 4DGL.
          Mark

          Comment


          • #6


            Thanks for the help.

            I might give a try to loading the ARDUINO prog from the uVGA-II, but that will be after I have learned how to efficiently use the 4DGL language and I have been able to program a nice looking interface.

            Comment

            Working...
            X