Announcement

Collapse
No announcement yet.

Issues With Passing Values Back From File_Exec()

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

  • Issues With Passing Values Back From File_Exec()

    I am currently handling all of my serial functions through a separate program on the SD card that gets loaded into ram. From this program I pass back an array of 12 values and I seem to have an issue with certain values not getting passed back to the main program correctly. I have no issues when running this method from the main program in flash but when running it in the separate program in ram I have an issue with values being inaccurate.

    Are there any things I make sure I'm doing when using File_Exec()? From the documentation I think I should have things set up correctly but there are things I'm not sure on. One of the being what #STACK value I should be using.

  • #2
    Hello,

    The file_Exec() funtion have 2 parameter first the filename of the program save in the uSD card to be called and then the pointer to the list of arguments to pass to the new program.

    Also in the main program make sure that the sd card is initialized.. I've attached a sample code for you as reference. Hope it helps.

    Best regards,
    Bern
    Attached Files

    Comment


    • JohnLemonade12
      JohnLemonade12 commented
      Editing a comment
      Sorry for the late response.

      I won't be able to give your sample code a test until tomorrow but I do currently have a question about it.

      In all of the sample code for the Picasso dealing with running programs from the SD card I noticed #STACK was always included in the program. #STACK was then followed by its value and a comment stating something along the lines of, "make sure you have enough space in RAM for all programs". Why is it that in this example you did not set a value to #STACK? I haven't been able to find anything in terms of documentation on this.

  • #3
    Hello,

    Hardware stacks are implemented for the purpose of memory allocation and access using a fixed origin and size.
    Thus the #STACK with corresponding value after it is just a way of setting a stack size. So when your default stack can still handle the operation in your program there is no need to reset the Stack size. For reference the ViSi has the default stack value of 200 while the maximum stack size 4096. You can use print(EVE_SSIZE()); for debugging purposes, it will return the current stack size.

    Best regards,
    Bern

    Comment

    Working...
    X