Skip to content

Commit 176db5f

Browse files
committed
Fix issue on OSX (and other platforms) where stm32flash only works if the serial device name starts with /dev/tty, as on OSX some serial devices start with /dev/cu. Also corrected mistake about .a file in stm32 parsers folder, and hopefully removed the .a file from source control
1 parent 7217137 commit 176db5f

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ other/maple-bootloader/cscope.out
66
other/maple-bootloader/build
77
other/maple-bootloader/*~
88
*.o
9-
tools/src/stm32flash/src/parsers/parsers.a
9+
tools/src/stm32flash_serial/src/parsers/parsers.a

tools/macosx/stm32flash/stm32flash

624 Bytes
Binary file not shown.
-13.5 KB
Binary file not shown.

tools/src/stm32flash_serial/src/serial_posix.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,34 @@ static port_err_t serial_setup(serial_t *h, const serial_baud_t baud,
198198
return PORT_ERR_OK;
199199
}
200200

201+
/*
202+
* Roger clark.
203+
* This function is no longer used. But has just been commented out in case it needs
204+
* to be reinstated in the future
205+
201206
static int startswith(const char *haystack, const char *needle) {
202207
return strncmp(haystack, needle, strlen(needle)) == 0;
203208
}
209+
*/
204210

205211
static int is_tty(const char *path) {
206212
char resolved[PATH_MAX];
207213

208214
if(!realpath(path, resolved)) return 0;
209-
215+
216+
217+
/*
218+
* Roger Clark
219+
* Commented out this check, because on OSX some devices are /dev/cu
220+
* and some users use symbolic links to devices, hence the name may not even start
221+
* with /dev
222+
210223
if(startswith(resolved, "/dev/tty")) return 1;
211-
224+
212225
return 0;
226+
*/
227+
228+
return 1;
213229
}
214230

215231
static port_err_t serial_posix_open(struct port_interface *port,

0 commit comments

Comments
 (0)