Forum Discussion
5 Replies
- Altera_Forum
Honored Contributor
Not that I'm a software person but are those variables or C macros (all caps and their location in an include file makes them look like macros)? C macros look something like this "#define <some macro name> <optionally some macro value>". If those are macros you should be able to overwrite them using the -D flag in the project settings. You can learn more by searching the gcc documentation about the -D flag.
- Altera_Forum
Honored Contributor
Hi,
if that's the definition of C Macros, they are then macros. I tried with -D already but it doesn't seem to work. But perhaps my tcl line was wrong... I did something like: set_setting hal.make.bsp_cflags_defined_symbols -DTSE_MY_SYSTEM,-DMAXBIGPKTS=1000,-DNUMBIGBUFS=250 When doing a printf from main() I still get the old values. Not that I'm a software person too, but should't I first undefine those Macros first? In the description of cflags_defined_symbols it says that the effect is the same with# define... I tried using hal.make.bsp_cflags_undefined_symbols "-u DMAXBIGPKTS", "-u DNUMBIGBUFS" but still not working... - Altera_Forum
Honored Contributor
I found a slightly different syntax here: http://www.altera.com/support/kdb/solutions/rd11122009_293.html
- Altera_Forum
Honored Contributor
If by "slightly different" you refer to those the "--set " directive, that would be actually the same but called from a .sh script. When the list of settings is included in a .tcl script the set is not required.
Anyways, I figgured out that the syntax for multiple defined symbols isNIOS2_BSP_ARGS="--script settings.tcl hal my_bsp"
so parameters between quotes and separated by space not comma.set_setting hal.make.bsp_cflags_defined_symbols "-DTSE_MY_SYSTEM -DNUMBIGBUFS=250 -DMAXBIGPKTS=500" - Altera_Forum
Honored Contributor
Oops ya, I didn't notice those commas. That's the same syntax that compilers like gcc uses for overwriting C macros.