No announcement yet.

How to include(inherit) file from a different directory or drive?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to include(inherit) file from a different directory or drive?

    I need to include "Constant/Global/Data" file into my ViSi Genie project but I would like to keep it separate from the main source code. I tried to enter path (#inherit "F:\ConfidentialData\") but it didn't work. I got this error message: "Can't open include file: F:\Main Code Directory\Project Name\". NOTE that two slashes(or whatever they are called in English) are missing in the error message.
    Please help me if there is a way how to keep confidential data away from the main code.
    Thank you!
    Last edited by Bobi_bo; 13 May 2021, 05:16 PM.

  • #2
    Try putting \\ (double back slashes) in the includes filename


    • #3
      Great, it works! Thank you very much, Mark!


      • #4
        Even though I was given an useful answer I would like to continue the topic. There is even more convenient way to keep the confidential data secret. I am using GEN4-50DT with Diablo16 controller, I can upload the main code with rubbish where the confidential data has to be and NO read protection, then to run different software from a different bank which will save the confidential data on position of the rubbish. I know I can not choose its location in the flash memory during compilation but I don't think it is a big deal to find it after uploading .4XE file... My question is: Is it possible to set the read protection by a software run from a different bank? Or any other way different than preprocessor directive(#MODE FLASHBANK_0 | FLASH_READ_PROTECT).....

        And one question off topic.... I just discovered PICADILLO 35-T. Probably it is a new product.... I could not find 5 or 7 inch 800x480 resistive touch display. Are there such? Diablo16 from my current project communicates with a PIC-microcontroller anyway and will be great if I can program both controllers using MPLAB X IDE.

        Thank you!


        • #5
          You can set the Read_Only tag programmatically. I've attached a sample, the key is simply this line
          fbu[7] |= FLASH_READ_PROTECT ; // turn on read protection
          The PICADILLO 35-T is 'End of Life' (it dates from 2014), it was never created in any size other than 3.5". Regardless, it does not have the graphics performance of Diablo.
          Attached Files


          • #6
            Thanks again, Mark! I do appreciate your help! I will use this technique with my next project. One more question, please. It might be stupid and unnecessary.... On some microcontrollers a flash block(page) must be erased manually prior to writing in it. Obviously I can not afford to wipe out entire bank, I don't know if there is a command which erases a single page, and I want to make sure that flash_WriteBlock(Buffer, Bank, Page) saves the information reliably. Thank you in advance!


            • #7
              As you can see in the comment on line 40 "need to erase as flash_WriteBlock() fails for executables"

              Which means your entire Flashbank needs to be erased.

              flash_WriteBlock() does an erase before write, but no verify. If you need to do that you will need to re read it and compare in your program, which, of course, you can't do in this case, ouch.

              That said, I've never seen a Flash write failure on Diablo.

              Maybe the secret data could be in a 'small' bank with some sort of verification call after write?

              How often is this confidential data updated?

              Most people seem to be happy using a 'special' location on a uSD. Perhaps using the uSD serial to prevent a clone copy from working.