Commit Graph

88 Commits

Author SHA1 Message Date
Roger Clark cb8b30bd6f add partial support for the new USB HID bootloader 2018-04-22 17:06:22 +10:00
Maik Wöhl 5287d86268
Use useradd instead of adduser
``adduser`` isn't available on all linux systems. 

usermod is available.
2018-02-25 14:00:13 +01:00
Alberto Alonso 9b03f0841d
Solve race condition with arduino IDE monitoring serial port
I encountered a race condition upon which, even though the udev rules were working and uploads succeed, the serial monitor can not re-establish communications.

If the serial monitor is left open when doing an upload the error shown is:

[...]
Copying data from PC to DFU device
Starting download: [##################################################] finished!
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
Waiting for /dev/ttyACM0 serial...Done
processing.app.SerialException: Error opening serial port '/dev/ttyACM0'. Try consulting the documentation at http://playground.arduino.cc/Linux/All#Permission
	at processing.app.Serial.<init>(Serial.java:145)
	at processing.app.Serial.<init>(Serial.java:82)
	at processing.app.SerialMonitor$4.<init>(SerialMonitor.java:101)
	at processing.app.SerialMonitor.open(SerialMonitor.java:101)
	at processing.app.AbstractMonitor.resume(AbstractMonitor.java:104)
	at processing.app.Editor.resumeOrCloseSerialMonitor(Editor.java:2218)
	at processing.app.Editor.access$2200(Editor.java:79)
	at processing.app.Editor$DefaultExportHandler.run(Editor.java:2196)
	at java.lang.Thread.run(Thread.java:748)
Error opening serial port '/dev/ttyACM0'. Try consulting the documentation at http://playground.arduino.cc/Linux/All#Permission

I traced it to the device being opened prior to the permissions/ownership changes.

When testing via -c the upload script waits for the character device creation, but at that point the udev rules have not changed the permissions. By testing the readability of the device via the -r test, we wait until the new permissions have been applied.

I imagine this is specific to the Linux kernel and the speed of the machine being used. In my case:
arduino-1.8.5
Linux 4.4.0-98-generic #121-Ubuntu SMP
but the change should work on any system with proper udev rules / permissions.
2017-11-13 12:15:07 -06:00
Roger Clark c5ed88921e Changed serial upload speed to 115200 as this speed is compatible with most USB to Serial adaptors 2017-11-08 15:29:25 +11:00
Roger Clark f8d28b8663 Removed unused cygwin dll's from tools/win 2017-09-21 17:35:20 +10:00
Jan Chrillesen f12bad6790 add JLink upload support for OSX 2017-08-31 20:54:29 +02:00
Roger Clark 437834a91f Added code by @danieleff to delay leaving the maple_upload script (in all platforms) until the Serial device has reconnected - this helps resolve the problem of needing to close the Arduino Serial Monitor prior to upload 2017-05-25 20:06:37 +10:00
Roger Clark ed82be4c6e Updated Linux 45-maple.rules
See http://stm32duino.com/viewtopic.php?f=16&t=1103&start=40#p20732
2016-12-02 10:32:17 +11:00
Roger Clark a1f154bc37 Added newer dfu-util for F4 DFU testing 2016-11-30 09:45:16 +11:00
Roger Clark 7985f25fbc Fixed path an permissions issue with linux jlink upload script 2016-10-17 12:43:16 +11:00
stevstrong 073aa23ed2 Merge remote-tracking branch 'refs/remotes/rogerclarkmelbourne/master' 2016-10-16 23:02:16 +02:00
Roger Clark 6bbb5dc506 Added JLink upload to Windows and fixed intermitten JLink upload issues 2016-10-16 16:46:40 +11:00
Roger Clark 293b693996 Added JLink upload method for F103C8 to Linux (untested) 2016-10-16 14:47:53 +11:00
Yoshitaka Kuwata 478ef73b48 update STM32F4 environment for macosx
remove extra definition in platform.txt
2016-09-06 18:12:11 +09:00
Roger Clark 8c6f302e9c Effecively disabled the code that waits for serial device re-enumeration
See http://stm32duino.com/viewtopic.php?f=35&t=1251
2016-07-16 09:15:32 +10:00
Roger Clark 2c25a5f7dd Recopied tools/linux to tools/linux64 and rebuilt stm32flash and stlink binaries for 64 bit, and replaced dfu-utl binary with 64 bit version from martinayotte 2016-05-07 12:08:17 +10:00
roger@rogerclark.net 7e06070ade Started to add linux 64 bit support, by copying the linux folder to linux64 and changeing platform.txt. Also copied scr folder into each platform's folder to allow the src to be distributed even if the tools are split up when using the Board Manager 2016-05-07 08:02:54 +10:00
Roger Clark 9695c368e0 Merge pull request #118 from mwm/master
Fix file open to actually turn on inbound parity checking.
2016-04-17 20:51:59 +10:00
WereCatf 9bf2af2dfc Install udev-rules for ST-link 2016-04-17 09:34:46 +03:00
Roger Clark ba5d4058f1 Merge branch 'development' 2016-02-28 14:52:14 +11:00
Sebastian Kostka cf16dcd8f6 Update dfu-utils for OS X 10.11.2 2016-01-10 15:32:01 +01:00
Roger Clark acf956a3e7 Compiled new version of stm32flash for OSX, with changes from @jcw 2015-11-21 19:42:53 +11:00
Roger Clark d0ed1941bb Merge branch 'master' into development 2015-11-20 20:27:18 +11:00
Jean-Claude Wippler 3e41a7458c remove the cflag check 2015-11-15 13:51:32 +01:00
David Brunell 44af152967 Partial reversion of maple_upload
Change at line 20 unnecessary.
2015-10-30 13:56:36 -05:00
David Brunell 5a1944c795 Fix case of spaces in path to linux tools directory 2015-10-30 13:21:41 -05:00
Roger Clark bd6d3b5092 Fixed issue in linux maple_upload.sh caused by paths with spaces in them 2015-10-29 19:55:47 +11:00
rogerclarkmelbourne 47e3050025 Added empty board.txt files to drivers, examples and tools, to stop the IDE warning messages (as these folders don't contain cores 2015-10-27 10:48:08 +11:00
Mike Meyer 09f6ccbb8d Fix file open to actually turn on inbound parity checking.
The INPCK bit is an i_flag bit, not a c_flag bit as originally done
here. I have no idea what setting INPCK in c_flag does on Linux, but
on FreeBSD it caused the test of the c_values after they were set to
fail. This fixes that, and presumably the serial interface will now
actually check the parity of incoming data.
2015-09-24 20:44:03 -05:00
Roger Clark f3c46b0842 Fixed OSX upload reset issue by appending -R to the dfu upload command in the macosx maple_upload script 2015-08-17 08:45:37 +10:00
Roger Clark 5bc3de4331 Fixed DFU upload reset issue by appending -R to the linux maple_upload script 2015-08-17 08:44:32 +10:00
Fergus 3b8b7a79f4 Bugfix for HardWire/I2C + configured/compiled dfu-util to work on Linux again
- Fixed 0 byte payload bug, stopping HardWire from sending only addresses to scan for devices
 - Fixed I2C bug accessing wrong status register for error flags
 - Improved Hardwire endTransmission() return flags to correspond with the actual I2C failure status
 - Removed dos endings from dfu-util autogen script breaking compilation
2015-08-01 18:58:14 +01:00
Roger Clark ce70ae4fce Added source to maple_loader.jar 2015-07-20 06:38:38 +10:00
Roger Clark 8ab4734573 Add cached dfu-util sources, as the original remote repo is no longer available for use as the source to the dfu-util folder as a submodule 2015-07-09 20:15:54 +10:00
Roger Clark 9056c63977 Removed submodule dfu-util 2015-07-09 20:09:11 +10:00
Roger Clark e0d6307685 Built Linux binary and also changed printed message to indicate this is a special version built for Arduino STM32 2015-07-08 19:48:57 +10:00
Roger Clark 176db5f9d0 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 2015-07-08 15:14:25 +10:00
Roger Clark cd9e17deea Merge branch 'master' of https://github.com/rogerclarkmelbourne/Arduino_stm32 2015-07-06 09:23:37 +10:00
Roger Clark 58a5799ace Added linux install file missing after previous name change to this file 2015-07-06 09:23:01 +10:00
Roger Clark 8c327aca05 Added OSX DFU binaries and changed the OSX maple-upload script to use them. (This saves users having to install dfu-util themselves, e.g. via Homebrew 2015-07-04 10:15:44 +10:00
Roger Clark 70403109c5 Updated Linux install script so that it also adds the current user to the dialout group. Also removed duplicate copy of the Linux install script from drivers/linux 2015-07-03 21:31:50 +10:00
Roger Clark 3b2c87de5a Updated linux tools to contain upload-reset (bin) utility, and modified maple-upload script to use this utility to reset the bootloader prior to upload. Also changed maple-upload so that it uses the pre-compiled dfu-util binary that is now part of the repo 2015-06-28 11:06:00 +10:00
Roger Clark 0ff9438aa1 Added osx upload-reset binary omitted from last commit 2015-06-16 21:25:40 +10:00
Roger Clark a25bb2b50b Merge branch 'master' of https://github.com/rogerclarkmelbourne/Arduino_STM32 2015-06-16 21:23:52 +10:00
Roger Clark a7244e0e89 Added upload-reset.c source. Added upload-reset OSX binary, and modified maple-upload script to use upload-reset 2015-06-16 21:23:43 +10:00
Martin Ayotte 53e4329a75 add dfuse_addr arguments option for tools/macosx/maple_upload 2015-05-31 13:22:21 -04:00
Martin Ayotte 44bfd8ae54 fix SetupClock168() for Netduino2Plus + add STM32Stamp/Netduino2Plus boards + add dfuse_addr in upload 2015-05-28 17:20:49 -04:00
rogerclarkmelbourne 8540c26429 Changed Windows STlink upload to use STM's own STLink CLI Exe as this supports more STLink hardware than Texane-STLink and some users had problems with Texane on F4 and F3 boards 2015-05-26 14:09:46 +10:00
rogerclarkmelbourne 973fa0268e Added Black Magic Probe upload support for C series boards, Note Windows BAT file has not been tested yet 2015-05-19 21:44:10 +10:00
Roger Clark f90929bfa8 Added dfu-util src as a sub module, also added compiled dfu-util files to tools/linux and added script to set udev rules, which I took from the old Maple IDE 2015-05-10 20:26:17 +10:00