Quantcast
Channel: Objective Development Forums
Viewing all 4524 articles
Browse latest View live

Re: Does usbPoll() get executed before entry to the ISR?


Re: Does usbPoll() get executed before entry to the ISR?

$
0
0
Well then next time I'll include a link to the sources Im working with. There is no DeviceDisconnect, DeviceConnect functions in them. Anyway, my concern was with respect to the thread title, and I now see I was the victim of a blunder (made by me). Now I see that the host interrupts the device (activates the INT0 pin) each SYNC. I'd forgotten the interrupts are set to edge triggered, positive edge. It is the first K in the SYNC that triggers the interrupts if unmasked and global enabled. This changes everything in my perspective.

By this time I'm busy with the usb_control_msg() function of libusb (linux). I see its parameters nearly match the ones in table 9-2 of USB specications 1.1 and 2.0, which by now I know well, with the exception of... What a pity! The bmRequestType is 0xC0, with the result that the type is type=vendor, and those specifications only cover standard device requests!

Re: Dreamweaver CC webyep Xtension

$
0
0
Hallo Ricardo,
ich wollte aktuell in WebYep einsteigen, finde aber nirgends Code zum downloaden bzw. verwertbare Manuals.

Ich nutze Dreamweaver CS4, CS6 und CC unter Windows.
Kannst Du mir eventuell den letzten funktionierenden Code für CS6 zusenden ?

Hast Du Infos, wie es mit dem Produkt weitergeht ?

Gibt es Alternativen zu WebYep ?

Ich hoffe, Du kannst mir da helfen...
Mit freundlichem Gruß otti

usb.h and libusb.

$
0
0
Hi:
#include <usb.h>
#include <stdio.h>
#include <string.h>
unsigned short IDVendor=   0x1384;              /*VID must be changed. */
unsigned short IDProduct=  0x8888;              /*PID must be changed. */

...........................

int main(int argc, char **argv)
{
        usb_dev_handle *d=NULL;
        unsigned char buffer[3];
        int i, mode, ret;
        char string[256];

        if(argc <2)
        {
                printf("give the voltage value.\n");
                exit(1);
        }
        i=floor(atof(argv[1])*51) ;
 if(i>255){printf("value must be between 0 and 5V\n"); exit(1);}
        mode=0;
usb_init();
ret=usbOpenDevice(&d, IDVendor,IDProduct);
if(ret!=0){printf("usbOpenDevice failed\n"); return 0;}

   ret=usb_control_msg(d, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, mode, i, 0, (char *)buffer, sizeof(buffer), 5000);

//      printf("buffer %d \n", buffer[0]);
        return 0;
}

This is part of an application program running on linux. Looking for documentation for usb_control_msg(), shown in the last lines above, I first went to /usr/include/usb.h, that is in the #include's (first lines), and the function was there. Looking for the source, I found /usr/src/linux-3.2.29/drivers/usb/core/message.c, where it is defined but, alas, here it has the arguments in different order and they are 9 instead of 8). As the author asks for the libusb library, the logical thing was to look in its sources, which I installed, just now, from the O.S. distribution disks. But here there is no usb_control_msg(), nor even the usb.h file!

So, what should the source for usb.h be?

Note: in usb.h there is declared a function usb_control_msg with the same number and order of parameters as in my source.

How to block ALL SSH traffic except one IP address

$
0
0
So I'm wondering how I go about blocking all SSH traffic except for one (my work IP) ip address? Right now I have it set to let traffic in after 45 seconds (which blocks most script kiddies) but a few still wait. I was wondering how I can either block a range of ip addresses or better yet, block all traffic except for a specific few IP addresses.

Thanks

Re: USBaspLoader condition / BVZ55-C3V6

$
0
0
Please take a look at the revised USBaspLoader: https://github.com/baerwolf/USBaspLoader

In the current testing-branch: https://github.com/baerwolf/USBaspLoader/tree/testing
I included some features for removing the need of a bootloader-condition (i.e. a button or jumper)

* CONFIG_HAVE__BOOTLOADER_ALWAYSENTERPROGRAMMODE
* CONFIG_BOOTLOADER_LOOPCYCLES_TIMEOUT=16 & CONFIG_HAVE__BOOTLOADER_ABORTTIMEOUTONACT
* CONFIG_HAVE__BOOTLOADER_IGNOREPROGBUTTON

Thre you can configure (this eample):

Always enter the bootloader, but leave it automatically if no usbasp command was received within some timeout (16 cycles = a few seconds). Do not leave automatically if any command has received.
(Leaving bootloader means starting the firmware last programmed to the AVR)
Normally USBaspLoader would still be wathcing the PROGButton (condition) to also enter/leave bootloadermode depending of the state of the button.
However it is not necessary anymore and can be disbaled via "CONFIG_HAVE__BOOTLOADER_IGNOREPROGBUTTON".

BR Stephan

Re: USBaspLoader condition / BVZ55-C3V6

$
0
0
cpldcpu wrote:I think for reliable detection of the presence of a USB host you'd have to do this:

0) For enumeration
1) Wait for reset (long SE0). If reset times out, quit bootloader
2) After that, wait for n keepalive pulses (short SE0). If reset times out, quit bootloader

All of this will take at least 500ms if successull and longer of no host is present.

In my opinion it is better to rely on other methods to enter a bootloader.

I think mupf was suggesting using the USB positive power itself as a signal that USB is connected:

mupf wrote:Could it work to use the USBs VCC to trigger the programming mode condition? I'm not using USB for power supply anyways.


This way the user just plugs it into USB and doesn't need to do anything else to begin PC communication. The code is likewise simple, just watching for the USB V+ line going high for a while, then running the bootloader. bootloaderCondition() could also be the USB V+ high, so the moment it's unplugged the bootloader exits.

Re: Minimal USB implementation

$
0
0
At least with avr-gcc 4.5.3, I think I was able to silence the optimizer warnings by initializing a variable with itself, e.g.char c = c;. Too bad there are so many snags to inlining assembly, as otherwise it could be possible to get more optimal code by using just C rather than mixing it with assembly.

Re: How to block ALL SSH traffic except one IP address

$
0
0
As the general case, you can make rules of the form

Deny any connection
Allow specific connection 1
Allow specific connection 2

because narrowly-defined rules have precedence over more general ones.

I hope that helps.

Re: USBaspLoader condition / BVZ55-C3V6

$
0
0
Oh, I agree, that could work. You'd need to activate the pull-up resistors because otherwise the zener diodes may pull the inputs low.

Re: Minimal USB implementation

$
0
0
That looks like something that would break arbitrarily with new compiler versions :)

Re: How to block ALL SSH traffic except one IP address

$
0
0
That makes perfect sense, thanks for your reply.

Agent Quitting Unexpectedly

$
0
0
When I wake my iMac, the Little Snitch Agent sometimes quits unexpectedly. I do have the console page that goes to Apple

Where do the requirements for CPU clock accuracy come from?

$
0
0
I am wondering about the reasoning behind the clock accuracy requirements of V-USB. After all, the USB specification itself is much more relaxed:

  • High speed data is clocked at 480.00Mb/s with a data signalling tolerance of ± 500ppm.
  • Full speed data is clocked at 12.000Mb/s with a data signalling tolerance of ±0.25% or 2,500ppm.
  • Low speed data is clocked at 1.50Mb/s with a data signalling tolerance of ±1.5% or 15,000ppm.
from http://www.beyondlogic.org/usbnutshell/usb2.shtml

The specified tolerance to clock deviation in the USB spec is +-1.5%, while even the "PLL" implementations of V-USB at 12.8Mhz and 16.5MHz require +-1%?

As I understand, there are two sources of timing errors:
a) Jitter caused by discrete sampling of the input during SYNC
b) A clock-rate divergence between host and client.

For the 16.5 Mhz implementation, each USB bit-time equals 11 clock cycles.

To sample the center of a bit, we would have to sample 6 cycles after the edge of the sync-pulse, which equals the total allowable clock-error margin.

a)
"waitForK" samples the input every two cycles. That means that up to one cycle jitter is introduced.
Furthermore, another cycle can be added due to the phase difference between cpu clock and host.

Therefore, jitter reduces the clock-error margin by two cycles to 4.

b)
Since the clocks are resynched at the beginning of every packet, only the clock deviation between the end of SYNC and the beginning of EOP (SE0) is relevant. EOP is two bits of SE0 and is therefore immune to single bit clock errors.
The maximum data packet payload for low-speed USB is 8 bytes. The total relevant packet length is therefore 1+8+2=11 bytes, or even only 9 bytes when the CRC16 is ignored.
This equals 88 bits. In the hypothical worst case all data is FF, which is practictally impossible. In that case 14 bits are "stuffed", resulting in a total maximum critical packet lengths of 102 bits or 84 without CRC.

102 bit-times equal 1122 CPU clock cycles. If a maximum of 4 clock cycles deviation is allowed, then the allowed CPU clock deviation is 4/1122=0.35%. When ignoring the CRC16, the maximum allowed deviation is 4/924=0.43%. Note that almost all V-USB projects ignore the CRC16.

So, my conclusion is that the allowed clock deviation is 0.35% or 0.43% at 16.5 Mhz for receiving data, and 1.5% for sending.

Did I miss anything?

From my experience, it is possible to adjust the internal RC oscillator of the newer ATtinies within these specs. I have tried serveral corner cases (ATtiny84 at 12Mhz, ATtiny10 at 12 Mhz, ATiny 85 at 12/16 MHz, ATtiny 841 at 16 MHz) and never found an obvious timing issue.

Of course, there are some potential pitfalls:
- It is also possible that the host does not use an accurate clock. In that case, both timing errors would add up in the worst case. However, this is not relevant when the RC osc. is calibrated from the keepalive pulses.
- The RC oscillator is not immune to long term drift. This is a serious issue and would either require an application that is only active for a short time (e.g. a bootloader) or continuous recalibration. The newest generation oscillators in the ATtiny 841 have a temperature compensated RC-oscillator which should be more stable.

FEATURE: Deny for N number of seconds.

$
0
0
The smallest increment of time i can deny some connection is 15 minutes.
Often I want to block one website from connecting to some third party, but within a few minutes afterward i want to allow a different tab to connect.
I can not simply deny once because the browser will attempt to connect some 20 times — that makes for a lot of 'o' 'esc' keypresses.
If i could deny a connection for something like 30 seconds, that would silence that tab, and then 30 seconds later allow another tab.

A simple use-case is to deny connections to Google on most websites, but then when i want to log into webmail or something on an actual Google site i can allow it.

Michael

Browse into other contact information

$
0
0
Hi,
Anybody have a tip as to how to use LB to browse into a contact and see all the fields without having to open Contacts.app?

I use the spouse/child/parents fields all the time and would love for that information to be available directly in LaunchBar.

Thanks in advance,

Dean

Re: Little Snitch behaviour

$
0
0
Still having this issue on the latest nightly (Version 3.3.1 nightly (4071))

Re: Little Snitch behaviour

$
0
0
I am still having this same issue, as well as an error that says the daemon has quit and it crashes the preferences or rules window that is open.

usbFunctionSetup and usbFunctionWrite in action?

$
0
0
Hi: Any example of a usbFunctionSetup and usbFunctionWrite in action? Of course they are for the user to write them, but has some user tried to transfer data to the device via a control output transfer (8 bytes maximum if I understood it)?

Re: Firefox connecting to my ip on startup?

$
0
0
Nobody out there who would like to explain this? I'm still looking for an answer.
Thanks in advance
Viewing all 4524 articles
Browse latest View live