Hi
It may be that you also have to create a release version instead of debug version. If the compiler adds debug information to the link(the hexfile) it can use up a lot of space. Also try to avoid using printf(), that function uses far to much space. Like the other guy said, access ports...