-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serial port RX problem with IAR compiler #749
Comments
Can you post the exact program you are using? @mstevanovic |
Hi, I am using example from mbed. Serial_HelloWorld_Mbed... Code: Serial pc(USBTX, USBRX); // tx, rx int main() { Also, I noticed that mbed test faild for IAR compiler (serial echo test...): |
Also, I noticed, from retarget.cpp next function is called and length parameter is 512... but from main, getc is called... regards |
Yes regarding serial echo test. gets(buffer, buffer size) call never returns. __read that is overwritten never returns -1 because it reads a unsigned char. fgets (a dlib function for IAR) allocates pages of 512 bytes to store the stream. When it encounter EOF it stops and fills the input buffer with as much of the pages as it can contain. The problem is that __read never encounter EOF and therefore just more pages get filled. |
OK. but in this example getc is called and in __read I see that length is 512... Why? |
Hi Gustav, I see some fix for on github for this problem. I take example and export to IAR and still have same problem. I am using next mbed revision: 92:4FC01DAAE5A5 |
@mstevanovic Did you use mbed-src (replace mbed lib with mbed-src)? I believe the revision is for the mbed library. |
OK. I will try with mbed-src. My fault, I used mbed lib. |
Yes. It is OK. Thanks a lot. |
Glad to hear that. Good luck! |
I am using ST Nucleo F103RB platfrom with IAR compiler 7.20.
printf to serial port is OK. But, if I want to read from serial port this is not possible.
I am using Serial_HelloWorld_Mbed example and function is blocked on getc
There is no problem with ARM or GCC compiler. Only with IAR...
Best regards
Milan
The text was updated successfully, but these errors were encountered: