Menu

FF on chips with more than 64K flash : Can we load the base FF code at addresses higher than 64k to save space?

Amt
2021-09-15
2021-09-15
  • Amt

    Amt - 2021-09-15

    Given how FF can't access beyond 64K (due to the 16 bit address size), can the FF code be loaded at locations beyond this range? This way the lower 64K can be used for user forth code.

     
    • Mikael Nordman

      Mikael Nordman - 2021-09-15

      The FF kernel, the user code, ram and eeprom have to exist in the 16-bit adress space.

      The eeprom emulation is hidden outside the 16-bit address space, if the chip has enough flash.

      If you link to some external libraries, those could be put outside the FF address space. To achieve that you will need to use a special linker script. I did that once for the floating point library.

       
      • Amt

        Amt - 2021-09-15

        Seems like a good place to store font data with a custom flash routine written in Forth!

        So, there is no way to extend FF's address space limits?

        Also, is there an assembler for PIC24? I couldn't find one in the forth directory.

         

        Last edit: Amt 2021-09-15
        • Mikael Nordman

          Mikael Nordman - 2021-09-15

          There is no need for a custom flash routine, just use X! and X@. They take 32-bit flash addresses.

          You could rewrite FF to be a 32-bit forth on PIC-24.
          Or you could rewrite FF to have 16-bit data and 32-bit addresses.
          Or you could rewrite FF to have separate address spaces for flash, ram and eeprom.
          But then you would miss the point of having a single easy to use address space.

          But how many applications are you planning to write that don't fit into 16-bit FF ?

          There is only a minimal assembler for bitmanipulation.
          This will show you the assembler words.

          words ,
          

          Also look in wordsAll.txt.

           
          👍
          1
  • Amt

    Amt - 2021-09-15

    the 'hi' word reports only about 18K. Shouldn't it be 64K? how could this be resolved? This is on a fresh setup with .equ FLASH_SIZE, 0x2a800

    ok<#,ram> 
    hi  ok<#,ram> 18431 
    here  ok<#,ram> 18431 5836 
    
     
  • Mikael Nordman

    Mikael Nordman - 2021-09-15

    Try 'flash hi here ram'.
    hi should be 65535 and here 29696..

     
    👍
    1

    Last edit: Mikael Nordman 2021-09-15

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.