<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I was fighting with the STM32F4 BSP today, trying to get a serial port to talk and I had an odd experience.<div class=""><br class=""></div><div class="">Previously I used the MCF5282 family of BSPs and I used fopen(“/dev/tty01”,”w”); to open tty01 for write.</div><div class=""><br class=""></div><div class="">I tried this syntax on the STM32F4 BSP, fopen(“/dev/ttyS1”,”w”); and it bombed. perror told me that I had an invalid argument. Check, check, check, read, read, read, hack, hack, hack, I eventually figure out that if I use mode “rw” or “a”, the port will open and I can use fputs to send out stuff.</div><div class=""><br class=""></div><div class="">1) Could someone explain to me why “w” won’t succeed, but “rw” or “a” will?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">2) On a similar vein, after enabling TTY1, 2, and 3 (instead of just TTY3) in configure.ac, the console port migrates down from TTY3 to TTY1. Apparently the first declared TTY will be picked up as the console. Is the recommended way of having 3 ports with TTY3 being the console, to reorder the ports in console-config.c, since BSP_CONSOLE_MINOR gets set to 0 in bsp.h (overriding my attempt at setting it in configure.ac)?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Andrei</div><div class=""><br class=""></div><div class="">(I may need to work with someone to provide a patch to io.h, since TTY2 has three possible sets of tx and rx pins, not just two).<br class="">
<br class=""></div><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><div class="">---------------------</div><div class="">Andrei Chichak</div><div class=""><br class=""></div><div class="">Systems Developer</div><div class="">CBF Systems Inc.</div><div class="">4-038 NINT INNOVATION CENTRE</div><div class="">11421 SASKATCHEWAN DRIVE</div><div class="">EDMONTON, ALBERTA</div><div class="">T6G 2M9</div><div class="">CANADA</div><div class=""><br class=""></div><div class="">Phone: 780-628-2072</div><div class="">Skype: andrei.chichak</div><div class=""><br class=""></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br class=""></body></html>