In ModusTool ,how to use the pseudo operator INCBIN of GCC compiler?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
13_4788251
Level 2
Level 2
10 questions asked 5 replies posted 5 questions asked

In ModusTool ,how to use the pseudo operator INCBIN of GCC compiler?

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

GNU asm supports the .incbin command. The arguments to these commands appear to be identical like in ARM, and in all cases take a filename and optional offset and length.

Usage: .incbin "file" [, skip[, count]]

Example: .incbin "filename.dat",16,1024

You can find all the directives here.

Hope this helps

Regards,

Dheeraj

View solution in original post

0 Likes
3 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

GNU asm supports the .incbin command. The arguments to these commands appear to be identical like in ARM, and in all cases take a filename and optional offset and length.

Usage: .incbin "file" [, skip[, count]]

Example: .incbin "filename.dat",16,1024

You can find all the directives here.

Hope this helps

Regards,

Dheeraj

0 Likes
13_4788251
Level 2
Level 2
10 questions asked 5 replies posted 5 questions asked

Thank you very much..

I used it in the startup file: .incbin "boot.bin",16,1024

I put the file "boot.bin" and the startup file in the same path.

But the compiler error can not find the file "boot.bin".

what path should the file "boot.bin" be placed in ?

0 Likes

Please make sure that the compiler can find the .bin file. ModusToolbox has an auto-discovery process that will compile all files of the extension .c, .cpp, .h, .hpp, .S, .s, .o, and .a. But for .bin file you need to manually include it by making use of the SOURCES makefile variable.

what path should the file "boot.bin" be placed in ?

You can place it anywhere in the project directory.

Please refer to the following KBA for more information on how to use these variables: Managing the Makefile for ModusToolbox® v2.x – KBA229177

Once you have pointed to the .bin file using the SOURCES variable, you should be able to compile without seeing any errors.

Regards,

Dheeraj

0 Likes