Vista Normal

Hay nuevos artículos disponibles. Pincha para refrescar la página.
AnteayerSalida Principal

Coupling STM32 And Linux? Consider HID over I2C

26 Junio 2024 at 08:00
screenshot of the code defining a hid descriptor by using essentially macros for common descriptor types

If you’re pairing a tiny Linux computer to a few peripherals — perhaps you’re building a reasonably custom Pi-powered device — it’s rightfully tempting to use something like an STM32 for all your low-level tasks, from power management to reading keyboard events.

Now, in case you were wondering how to tie the two together, consider HID over I2C, it’s a standardized protocol with wide software and peripheral support, easily implementable and low-power. What’s more, [benedekkupper] gives you an example STM32 project with a detailed explanation on how you too can benefit from the protocol.

There are several cool things about this project. For a start, its code is generic enough that it will port across the entire STM32 lineup nicely. Just change the pin definitions as needed, compile it, flash it onto your devboard and experiment away. Need to change the descriptors? The hid-rdf library used lets you define a custom descriptor super easily, none of that building a descriptor from scratch stuff, and it even does compile-time verification of the descriptor!

The project has been tested with a Raspberry Pi 400, and [benedekkupper] links a tutorial on quickly adding your I2C-HID device on an Linux platform; all you need is DeviceTree support. Wondering what’s possible with HID? We’ve seen hackers play with HID aplenty here, and hacking on the HID standard isn’t just for building keyboards. It can let you automate your smartphone, reuse a laptop touchpad or even a sizeable Wacom input surface, liberate extra buttons on gamepads, or build your own touchscreen display.

Uncovering Secrets Of Logitech M185’s Dongle

16 Junio 2024 at 05:00
the Logitech receiver in question next to the mouse it's paired to

[endes0] has been hacking with USB HID recently, and a Logitech M185 mouse’s USB receiver has fallen into their hands. Unlike many Logitech mice, this one doesn’t include a Unifying receiver, though it’s capable of pairing to one. Instead, it comes with a pre-paired CU0019 receiver that, it turns out, is based on a fairly obscure TC32 chipset by Telink, the kind we’ve seen in cheap smart wristbands. If you’re dealing with a similarly obscure MCU, how do you even proceed?

In this case, GitHub had a good few tools developed by other hackers earlier — a Ghidra integration, and a tool for working with the MCU using a USB-UART and a single resistor. Unfortunately, dumping memory through the MCU’s interface was unreliable and frustrating. So it was time to celebrate when fuzzing the HID endpoints uncovered a memory dump exploit, with the memory dumper code helpfully shared in the blog post.

From a memory dump, the exploration truly began — [endes0] uncovers a fair bit of dongle’s inner workings, including a guess on which project it was based on, and even a command putting the dongle into a debug mode where a TC32-compatible debugger puts this dongle fully under your control.

Yet another hands-on course on Ghidra, and a wonderful primer on mouse dongle hacking – after all, if you treat your mouse’s dongle as a development platform, you can easily do things like controlling a small quadcopter, or pair the dongle with a SNES gamepad, or build a nifty wearable.

ATtiny85 Mouse Jiggler Lets You Take a Break

Por: Tom Nardi
3 Junio 2024 at 23:00

The good news is that more and more people are working from home these days. The bad news is that some of the more draconian employers out there aren’t too happy about it, to the point of using spyware software to keep tabs on their workers. Better make that bathroom break quick — Big Brother is watching!

One simple way to combat such efforts is a mouse jiggler, which does…well it does exactly what it sounds like. If you find yourself in need of such a device, the WorkerMouse from [Zane Bauman] is a simple open source design that can be put together with just a handful of components.

The WorkerMouse is designed to be assembled using through-hole parts on a scrap of perfboard, but you could certainly swap them out for their SMD variants if that’s what you have on hand. The circuit is largely made up out of passive components anyway, except for the ATtiny85 that’s running the show.

[Zane] decided to embrace modernity and couple the circuit with a USB-C breakout board, but naturally you could outfit it with whatever USB flavor you want so long as you’ve got a cable that will let you plug it into your computer.

The project’s C source code uses V-USB to connect to the computer and act as a USB Human Interface Device (HID). From there, it generates random speed and position data for a virtual mouse, and dumps it out every few seconds. The end result is a cursor that leaps around the screen whenever the WorkerMouse is plugged in, which should be enough to show you online while you step away from the computer. As an added bonus, [Zane] has put together a nice looking 3D printable enclosure for the board. After all, the thing is likely going to be sitting on your desk, might as well have it look professional.

If you’ve got the time to get a PCB made, you might also be interested in the MAUS we covered last year, which also keeps the ATtiny85 working so you don’t have to.

MicroPython 1.23 Brings Custom USB Devices, OpenAMP, Much More

2 Junio 2024 at 14:00
A screenshot of the release page, showing the headline and a crop of the release notes

MicroPython is a wonderful Python interpreter that runs on many higher-end microcontrollers, from ESP8266 to STM32 to the RP2040. MicroPython lets you build devices quickly, and its latest release, 1.23, brings a number of improvements you should be aware of.

The first one is custom USB device support, and it’s a big one. Do you want to build HID devices, or play with MIDI, or do multiple serial streams with help of PIO? Now MicroPython lets you easily create USB devices on a variety of levels, from friendly wrappers for creating HID or MIDI devices, to low-level hooks to let you define your own USB descriptors, with user-friendly libraries to help all the way through. Currently, SAMD and RP2040 ports are supported in this part of code, but you can expect more in the future.

Hooray to 10 years of MicroPython!

There’s more – support for OpenAMP, an inter-core communication protocol, has received a ton of improvements for systems where MicroPython reigns supreme on some of the CPU cores but also communicates with different systems on other cores. A number of improvements have made their way through the codebase, highlighting things we didn’t know MicroPython could do – for instance, did you know that there’s a WebAssembly port in the interpreter, letting you run MicroPython in your browser?

Well, it’s got a significant overhaul in this release, so there’s no better time to check it out than now! Library structure has been refactored to improve CPython compatibility, the RP2040 port receives a 10% performance boost thanks to core improvements, and touches upon areas like PIO and SPI interfaces.

We applaud all contributors involved on this release. MicroPython is now a decade old as of May 3rd, and it keeps trucking on, having firmly earned its place in the hacker ecosystem. If you’ve been playing with MicroPython, remember that there are multiple IDEs, graphics libraries, and you can bring your C code with you!

❌
❌