Storing font & Emwin to external flash

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Storing font & Emwin to external flash

      Hi
      I want to store fonts generated from font converter software and pages generated from GUI Builder software to the SST25VF016B (spi flash) with the LPC1788 .


      Can anyone help please.

      Best regards,
      Amir.

      The post was edited 1 time, last by amirsh ().

    • Hello,

      I think this question goes beyond the scope of emWin like that. It is more about making appropriate drivers which will work with external flash (storing, reading data...) and making options in your linker files for placing data at corresponding sections within the flash. Since you use LPC you better should contact NXP forum.
      Regards,

      Anthony
    • Hello amirsh,

      I had the same problem and found this solution:
      You have to convert the fonts with the fontconverter to the xbf format.
      This format is especially made to have the fonts stored in slow external memories like sd card or spi flash.
      There is something like a lookahead table stored in the file, similar as an index in a database. Thus the access to the font works very efficient.
      The whole thing is described here:
      kb.segger.com/Set_external_XBF_font_(Sample)
      But don`t use the
      GUI_XBF_TYPE_PROP_AA4_EXT constant for generating the font. It doesn´t work with standard windows fonts. Use GUI_XBF_TYPE_PROP_EXT instead. I found this with try & error.
      Good luck
      Andreas
    • Hello,

      just let me simply add another way to realize this. The mentioned external flash is a NOR-flash which can operate in memory-mapped mode. So we can just configure linker files and enable memory-mapped mode at the start of MCU code. Then we can deal with usual "C-code-style" fonts in Font Converter without adding an extra code for getting XBF-data.
      Regards,

      Anthony
    • cilmagemlu wrote:

      Hello,

      I think this question goes beyond the scope of emWin like that. It is more about making appropriate drivers which will work with external flash (storing, reading data...) and making options in your linker files for placing data at corresponding sections within the flash. Since you use LPC you better should contact NXP forum.
      That way works - i had done this on a STM32F746 and Flash. The way is not different from protected bootloader.
      You have to build a structure that contains pointer to the memory start of every font (or others) your store into the flash. The start of the structure can be stored by the linker on a fixed memory address. In the program code, you point with teh strutre to the start address of the flash memory where the structure stores.
      I had seen a different methode, where every object like a font, Picture or ever, stored in an ROM, marked by a unique lable at the start address. Inthe programm memory , a routine search the relevant memory range the symboles and store the address into a structure pointer. This methode is flexible, but need startup time to find all symbols. A varius version of them i had used to find symbols in a protected bios to find the init entry point of API structures for upcalls.
      Some things have to be more care like IRQ or DMA processes. I had enought memory and copy the used objects into the RAM. For large objects like pictures or databases, it's required to declare the flash memory as Read-Only in the linker file / ld-file or memory-map; depended on the toolchain you prefere. That's important that you do this exact. In the GNU toolchain, that's a worse job. I hate ld-scripts, even they are powerfull. In SES, that's a quite easy job. Hope this will helps you to find a solution for you.

      BTW: I had found an example for the STM32F746Disco and the STm32H747 Disco board. ST distribute a demonstration how flexible and powerfull the both MCU and Boards are. This are available from ST, and they load up every static objects into the external QSPI Flash and load them at startup. The source is free and it could be easy mirated into SES by using an extern toolchain Build.
      The source is not pretty writen like them from Segger. But for just an example and inspiration that's could be helpfull.
      Good luck
    • Andy_AN2 wrote:

      The whole thing is described here:
      kb.segger.com/Set_external_XBF_font_(Sample)
      But don`t use the
      GUI_XBF_TYPE_PROP_AA4_EXT constant for generating the font. It doesn´t work with standard windows fonts. Use GUI_XBF_TYPE_PROP_EXT instead. I found this with try & error.
      Good luck
      Andreas
      The link is emty, but thank's alot for that info about the GUI_XBF_TYPE_PROP_EXT for convered windows font sets. I never had used the windows fonts, but i plan to do this. There are many free fonts are available. Good to know.
      Thanks again..