Shop OBEX P1 Docs P2 Docs Learn Events
Question about including binary files — Parallax Forums

Question about including binary files

Mike GreenMike Green Posts: 23,101
edited 2012-06-23 21:10 in Propeller 1
The Propeller Tool and its equivalents allow a file to be included as a file image in a program's DAT area. How would this be done with PropGCC?

Comments

  • jazzedjazzed Posts: 11,803
    edited 2012-06-23 20:13
    Mike Green wrote: »
    The Propeller Tool and its equivalents allow a file to be included as a file image in a program's DAT area. How would this be done with PropGCC?


    There is the #include directive for text.

    The propeller-elf-objdump utility can be used to create a .o for a binary file.
    There are examples of this with SimpleIDE in the toggle folder when compiled.
    The makefile examples are in the demos/toggle folder and demos/common/common.mk file.
  • pedwardpedward Posts: 1,642
    edited 2012-06-23 21:10
    Like Steve pointed out, the conventional approach is to convert the file into an embedded array in a C header file.

    If you want to include it without doing the conversion, you would need to link it into a special section with a linker script and give it a pointer in the code that can access the data.

    That said, I haven't looked into exactly how to make that happen.
Sign In or Register to comment.