Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- So can I pass the parameters from the NIOS II SBT or from the NIOS II command shell ? ( i am just a beginner in those two) --- Quote End --- No, you can't. main() is invoked by the Altera HAL wrapper "alt_main()" and it initializes argv[] with NULL and argc with zero. In your BSP folder, see ./HAL/src/alt_main.c They leave the door open for other software to set it to non-NULL, but it is kind of a dead-end. In addition to using stdin/stdout, if you include the altera_hostfs BSP component you can also fopen/fread/fwrite files on your PC hard drive (to take commands/arguments from, or to initialize your sample data tables in RAM, etc. etc. etc)