In my project based on smartfusion, I am using UART of cortex M3 to communicate with PC. The problem i am facing is that when Cortex M3 program is running in debug mode i receive correct data in PC, but when i put the same in release mode timings go haywire and it does not work.
Please suggest what may be missing. Please Ask any additional input if required.
I will really appreciate early reply.
Thanks
What do you mean with debug mode and release mode? Compilation options? Or switching between simulator or real hardware? Running with or without JTAG adapter? Something else?
You say the communication timing go haywire. But you don't tell how. - Wrong baudrate? - Received characters lost? - Transmitted characters lost? - Characters sent too close after each other? - ...
Have you used a scope to look at the signals? What do they look like? What did you expect them to look like?
we are using uart communication from smart fusion evaluation board card to PC using virtual COM port on evaluation board itself using CP2102 IC. UART0 is initiliazed with baud rate of 1500000. I am trying to send 4 bytes one by one by calling uart_polled_tx function four times with a delay of some minimum duration in between. This code works fine when i am running in debug mode, but in release mode i.e. when the code is loaded in the envm of smartfusion , then the data through UART is missed out or its incorrect. The error is only in sending data from smartfusion to PC, but PC to smartfusion data transfer works fine with same baud rate.
In release mode we are running without JTAG adapter and in debug mode we are running with JTAG adapter. In debug mode programm is running on PC, we can have breakpoints to stop the program at required step but in release mode we cant do this.
How can debug mode be both "running on PC" and "running with JTAG"?
You connect a JTAG adapter to virtual hardware in the simulator???
Next thing - the simulator doesn't emulate all hardware fully. How are you making sure your UART is ready to accept more serial data? If you don't have code pacing the transfer, then you are likely to lose characters. The simulator will probably not care about the baudrate when figuring out how fast a UART can swallow new data.