Hi
I have a simple code with uart2. When i running code in debug mode and i have to send 4 bytes of data all data been send but when I off debug button in keil and click reset button on board , code run but only first byte been send. What might be a problem? I think in keil might be a debug mode and release mode? Code stops in while(!(USART2_SR & USART_TXE_FLAG)). Looks like TXE flag is reset and in USART_DR is data to send.
Present the actual code, not a vague description of it. The processor will do exactly what you tell it too, there is likely a flaw in your logic. Read the posting instructions for source code thoroughly.
Make sure BOOT0 is pulled low in your design, and when debugging don't place a peripheral viewer over the USART