Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USBaspHIDUART static linking #24

Closed
Franck78 opened this issue May 7, 2023 · 11 comments
Closed

USBaspHIDUART static linking #24

Franck78 opened this issue May 7, 2023 · 11 comments

Comments

@Franck78
Copy link

Franck78 commented May 7, 2023

The serial is not updated on my installation.

Perhaps 'hiblib' too old ?

Can you build the USBaspHIDUART with this lib in your code ?

https://github.com/libusb/hidapi/blob/master/BUILD.md#embedding-hidapi-directly-into-your-source-tree

:~/bin> USBaspHIDUART -u 3456

Enumerating USBasp HIDUART (Hid Api Library Version : 0.9.0_or_older )
-----------
USBasp List index : 0

Type : 16C0 05DC
Path : 0002:000d:01
Serial number : ????
Manufacturer  : www.fischl.de
Product       : USBasp
Release       : 1.11
Interface     : 1


Updating USBasp Serial Number ... Done .


Enumerating USBasp HIDUART (Hid Api Library Version : 0.9.0_or_older )
-----------
USBasp List index : 0

Type : 16C0 05DC
Path : 0002:000d:01
Serial number : ????
Manufacturer  : www.fischl.de
Product       : USBasp
Release       : 1.11
Interface     : 1
@dioannidis
Copy link
Owner

dioannidis commented May 7, 2023

Hi,

which hidapi version do you have ?

Isn't possible to upgrade to a newer version ? 0.9.0 is too old ...

regards,

@Franck78
Copy link
Author

Franck78 commented May 7, 2023

not now for the update of my opensuse.

As USBaspHIDUART may run on strange linux systems, maybe not a bad idea to eliminate a potential problem with embedding libs ?

@dioannidis dioannidis changed the title USBaspHIDUART -u 1000 USBaspHIDUART static linking May 8, 2023
@dioannidis
Copy link
Owner

dioannidis commented May 8, 2023

Hi,

@Franck78, @mcuee

The UART HID protocol is very simple . It's very simple easy to implement it in any language. As I love FreePascal I used that compiler to wrote USBaspHIDUART utility . This complicate things a little ...

Anyway, I'll take a look but is a low priority .

PS: You can always write a C/C++ USBaspHIDUART utility and contribute it to the project . After all, this is an Open Source / Free Software project ...

regards,

@dioannidis dioannidis added help wanted Extra attention is needed good first issue Good for newcomers labels May 8, 2023
@mcuee
Copy link

mcuee commented May 8, 2023

For Linux, usually it is better that the user should build from source, if the provided binary does not work.

Take note for avrdude project, we only provide Windows MSVC binary.
https://github.com/avrdudes/avrdude/releases/tag/v7.1

There is an enhancement request but nobody is working on it. Rather we refer the users to build from source or get static linking binary from Arduino-packing project.
avrdudes/avrdude#987

@mcuee
Copy link

mcuee commented May 8, 2023

BTW, for Linux and macOS, usually the preferred way is to use dynamic linking.

@Franck78
Copy link
Author

Franck78 commented May 8, 2023

Turbo Pascal 5 was my first language. So nothing strange to me when I read for example the bootloader you are contributing to. Even if I don't see the purpose of it (another boot loader).

Some years ago I dived a little in the the USB protocol (bulk, interrupt, endpoint etc etc). Most of it vanished.

@mcuee
yes, compiling from source, if you have time to cross compile when your device have no room for gcc, make, libs, headers, blah blah. And infinite rabbit hole.
I sometime reread for fun this https://groups.google.com/g/techos/c/63PDG_3vNns (in french sorry). Keyword=unikernel

So, for me this lib is/was a perfect candidate to be 'included' (eg eliminated) ;)

@dioannidis
Copy link
Owner

dioannidis commented May 8, 2023

Hi,

@Franck78

FYI, If you want to change the serial number you could edit the eeprom.eep.hex ...

:0A0000000A03300030003000300029
:00000001FF

The serial 0000 is stored as ASCII ( 0 -> 30 ) ( shows bold, italic above).

So if you want to change it to 1234 then edit it to look like these :

:0A0000000A03310032003300340029
:00000001FF

regards,

@dioannidis
Copy link
Owner

Hi,

@Franck78

Turbo Pascal 5 was my first language. So nothing strange to me when I read for example the bootloader you are contributing to. Even if I don't see the purpose of it (another boot loader).

Why not ? It's an opportunity to learn, to advance the fpc avr part and it's fun !!!

@mcuee yes, compiling from source, if you have time to cross compile when your device have no room for gcc, make, libs, headers, blah blah.

A quick search shows that Lazarus/FPC exists for openSuse . Just install it, recompile the USBaspHIDUART on your system and remove it to free up space ....

regards,

@Franck78
Copy link
Author

Franck78 commented May 8, 2023

I don't have have need to change it. I wanted to test only.

What is puzzling me is low speed usb unable to expose as a serial port (/dev/acm). Or not able to transfer payload of more than 8 bytes. I have to re-read all this USB stuff if I want to do something in the usbasp code !

@dioannidis
Copy link
Owner

dioannidis commented May 8, 2023

Hi,

@Franck78

What is puzzling me is low speed usb unable to expose as a serial port (/dev/acm). Or not able to transfer payload of more than 8 bytes.

It's simple, USB specs . No bulk or isochronous transfers, only control and interrupt and max 8 byte payload.

regards,

@dioannidis dioannidis removed help wanted Extra attention is needed good first issue Good for newcomers labels May 8, 2023
@mcuee
Copy link

mcuee commented May 8, 2023

USB 2.0 spec is actually a good read (The Original USB 2.0 specification released on April 27, 2000). It can be downloaded from here.
https://www.usb.org/document-library/usb-20-specification

As for a quick read, I think USB Made Simple is good.
https://www.usbmadesimple.co.uk/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants