96boards / 96boards-uart Goto Github PK
View Code? Open in Web Editor NEW96Boards UART adapter hardware design files
License: BSD 2-Clause "Simplified" License
96Boards UART adapter hardware design files
License: BSD 2-Clause "Simplified" License
I've compiled 96boardsctrl on my ARM-based Raspberry Pi running Raspbian Jesse Lite but found that it just shows its usage when I ask it to reset:
root@pi:/home/pi/96boards-uart/96boardsctl# ./96boardsctl reset
Usage: ./96boardsctl [OPTION]... command
Control the power button and reset lines with a 96boards USB console adaptor
-h, --help Display this help and exit
-o, --old Using old v0.3 prototype board
-l, --list List available devices and exit
-L, --long Use long 5s pulse, useful to force board to power off
-p, --pulse-width=TIME Length of signal pulse in ms
-s, --serial <serial> Specify device to open by serial number
Commands:
power Pulse the power button signal
reset Pulse the reset button signal
This program causes the kernel's ftdi_sio driver to disconnect from the UART device
It can be reconnected by echoing the device name into /sys/bus/usb/drivers/ftdi_sio/bind
I believe this is because getopt_long() returns -1 when it has finished parsing options, but this is being assigned to an (unsigned) char which is always greater than zero, so the while loop never exits, causing the switch statements default to be chosen.
The following patch solved this for me:
index a2bead7..d2e0a7d 100644
--- a/96boardsctl/96boardsctl.c
+++ b/96boardsctl/96boardsctl.c
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
ftdi_init(&ftdi);
- while ((c = getopt_long(argc, argv, optstring, long_options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, optstring, long_options, NULL)) != (char) -1) {
switch (c) {
case 1:
if (count >= 3) {
What is:
SOT-23_Seeed
USB_MICRO_B_ST-USB-001E
Socket_Strip_SMD_2x20_Pitch2mm
SW_PUSH_DTSM_62K
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.