Forum Discussion
Altera_Forum
Honored Contributor
20 years agoI cut out pretty much everything and got it to the point that if I add/remove a local variable to cyg_user_start it will not boot/boot. How can a local variable within the cyg_user_start function prevent the cyg_start and therefore cyg_user_start from being called? Functions follow.
With this code snippet the system does not boot and does not make it into the cyg_user_start routine - I never see the LED's update:# include <cyg/kernel/kapi.h># include <stdio.h># include <cyg/hal/io.h> // IOWR void cyg_user_start(void); void cyg_user_start(void) { FILE *US_LogFp = NULL; IOWR(0x901040, 0, 0xAA); // Update LED's so we know we got here. if (!US_LogFp) { IOWR(0x901040, 0, 0x55); } printf("\n\nRev Test, %s.\n", __DATE__); while(true); return; } If I change the cyg_user_start routine to comment out the local variable it does boot and I see the LED's update and the print message: void cyg_user_start(void) { // FILE *US_LogFp = NULL; IOWR(0x901040, 0, 0xAA); // Update LED's so we know we got here. // if (!US_LogFp) { IOWR(0x901040, 0, 0x55); } printf("\n\nRev Test, %s.\n", __DATE__); while(true); return; }