Thank you very much alexxx. It worked fine as you said but can you explain me why 10*9600 is not working. I mean I have used this kind of statements in IAR, RIDE etc.
I also do not have such problems in IAR. GCC is an older and more "strict" compiler. The problem is that when the compiler sees raw numbers < 65536, then it interprets them as 16-bit.
So 10*9600 = 96000 = 0x17700.
But since this result is interpreted as 16-bit, then the remaining result will be 0x7700 = 30464. You have to use this "ul" to declare that this is an unsigned long value.
Depending on the value you can use ui for 16-bit, ul for 32-bit and ull for 64-bit values.
Try google with "integer constant suffix" as keywords. This is not only a GCC issue but a C issue in general.
I've googled a couple of references to get you started: