hello! i m using stm32lo73rz in keil micro vresion 5 in hll format. I cant initialize char and int. I m using unsigned char i[]= "giga" but warning will generate that i not decleared. and when compile the programe in docklight giga will not print correctly any other word will come there at rx side when tx something according to code.this is my email abhij752@gmail.com please help me out from this.
Hello Abhi,
I assume you are using this part: www.st.com/.../stm32l073rz.html
And you are using the ARMCC compiler version 5
It sounds like you are used to programming using the C99 programming standard - that is not the default setting in the Keil tools, C90 is.
Project » Options for Target » Compiler on the "C/C++" tab, check "C99 mode"
See: http://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm
Otherwise in C90, you must first define your variables then use them.
Here are some of the features the ARMCC compiler supports in the C99 standard.
www.keil.com/.../armcc_chr1359124237277.htm
thank you so much sir for your help and i have checked c99 is already selected.
Presumably it was not selected originally, which is why you got the errors - as explained?
But now you are asking a different question:
"if i am sending uart(4 char letter) then according to code docklight shows 'w' i.e. is right similarly same with skit. but if i am sending 5 char letter or less than 4 char letter by docklight then docklight shows no response problem is that"
For a start, your code is hard-coded to send only 3 characters:
USART2->TDR = i[4]; USART2->TDR = i[3]; USART2->TDR = i[2];
So how is that supposed to cope with changing the string length??
But there is a fundamental flaw here:
USART comms are slow relative to the speed of the processor. Therefore, you need to wait for each character to complete transmission before you load the next character!
There will be status bits to tell you when the USART is ready to accept the next character.
Study the processor User Manual for details.
Look at the examples provided by ST.
See: community.st.com/.../46923-stm32l162 for ST tutorials materials.
thank you sir for your suggestion. but please tell me should i put any function which tells that usart ready for the next char. Like-LL_USART_EnableInStopMode,LL_USART_EnableDirectionRx.
View all questions in Keil forum