This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430 USB HID Windows API and Delphi

Expert 1030 points


TI's "MSP430 USB HID Windows API Programmer's Guide" (slaa453) mentions several routines that developers have to call from a host-side program in order to implement a USB interface, among them: HID_Init(), HID_Open(), HID_Close(), etc. Unfortunately, no mention is made of the DLL that incorporates them. Several DLLs come with their software, however, including the following in:

C:\Program Files (x86)\Texas Instruments\MSP430 Windows HID API\

mfc90.dll
mfcu90.dll
mfcm90.dll
mfcm90u.dll

My preferred programming language is Delphi (because I happen to have access to a Delphi compiler) and I have tried to call the HID_Init routine inside one or all of these DLLs from my Delphi code, but without success. The program compiles with no errors, but usually responds with something like:

"The procedure entry point HID_Init could not be located in the dynamic load library."

followed by:

Assertion failure: "(!" SetThreadContext failed ")" in ..\win32src\thread32.cpp
at line 422.

I know USB is not everyone's favourite project on an MCU, but is there anybody out there with some experience in these matters who can help me. Thanks.

  • I use the TJvHidDeviceController component in Delphi. I think it came from jedi.org.

    Paul.

  • Thanks for your reply, Paul. I've tried googling this and come up with a lot of JEDI stuff, including 'jcl-2.3.1.4197.zip' and 'JVCL347CompleteJCL241-Build4571.zip'. The first of these, JEDI Code Library jcl-2.3.1.4197, installed okay, but the second, JEDI Visual Component Library JVCL..., gives me trouble. When I run the install.bat file for it, the following error is reported:

    Error 2003 Undeclared identifier 'FileHistory'.

    This seems to originate from the JvAppStorage.pas file, where a call is made to FileHistory(FullFileName, Path, StorageOptions.BackupHistoryCount, Now);.

    Another error I've had is:

    GenerateDefines.pas (46Fatal: F1026 File not found: 'System.types.dcu'

    I've looked and I can't find the corresponding System.Types.pas.

    I've also found the separate file that makes up the TJvHidDeviceController component, viz., HidControllerClass.pas, which uses DBT.pas, SetupAPI.pas, Hid.pas and HidUsage.pas, but can't get the component to install. I'm using CodeGear Delphi 2007 and can't decide whether under the 'Component' menu I should be using 'New VCL Component...', 'Install Packages...' or 'Import Component...'.

    By the way, I presume that if things install properly, a new Item will appear on the Tool Palette ... something beginning with 'Project JEDI'

    Any help you could give me would be greatly appreciated. Thanks.

  • 1805.HID.zip

    This the component that I use, I think it includes a few examples.

    Paul.

  • Thanks, Paul. It didn't quite behave as I thought it might, but it does work. Most of the problems are due to my being a bit of a beginner. I think I'll be able to use it without too much difficulty, though. Thanks again.

    Harry.

**Attention** This is a public forum