Skip to content

USB TMC Updates#724

Merged
hathach merged 4 commits into
hathach:masterfrom
xmos-jmccarthy:master
Mar 18, 2021
Merged

USB TMC Updates#724
hathach merged 4 commits into
hathach:masterfrom
xmos-jmccarthy:master

Conversation

@xmos-jmccarthy
Copy link
Copy Markdown
Contributor

Describe the PR
Adds alignment to buffers in usbtmc_interface_state_t struct.
Updates the visaQuery.py script for PyVisa module import deprecation and to support Linux.

Additional context
It was found that the CFG_TUSB_MEM_ALIGN attributes were missing from the buffers in the usbtmc_interface_state_t struct. This caused exceptions due to alignment issues on the XCore platform. This addition is untested on other platforms.
Additionally the existing visaQuery.py script was hardcoded for use with Windows. Linux support was added.

Michael Bruno and others added 2 commits March 16, 2021 10:48
Fix buffer alignment in TMC device class
Replaces visa include with pyvisa, as visa use with PyVISA is being
deprecated.
Copy link
Copy Markdown
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the modificaiton of usbtmc_device.c looks good to me. Though can you also add the CFG_TUSB_MEM_SECTION to the usbtmc_state as well at line 128, that will help some mcu that has picky DMA.

CFG_TUSB_MEM_SECTION static usbtmc_interface_state_t usbtmc_state =
{
    .itf_id = 0xFF,
};

For the visaQuery.py changes, I have no idea, @pigrew do you have time to help reviewing this.

@pigrew
Copy link
Copy Markdown
Collaborator

pigrew commented Mar 17, 2021

My putting a particular RM DLL path was a bad idea, in retrospect. It was a hacky way for me to get it working on my laptop, and I shouldn't have done it. Also, it may not work for all installs of Windows.

What are your thoughts about if we remove all of the os-detection, and just have a call to:

rm = visa.ResourceManager()

With that, one can create a .pyvisarc with the proper library path based on which VISA library the user wants (if pyVISA's auto-selection doesn't work)?

(And, in general, it's good to see other people trying out the class driver. If you think there should be API changes, let me know.)

@xmos-jmccarthy
Copy link
Copy Markdown
Contributor Author

PR is updated to only add the CFG_TUSB_MEM_ALIGN and CFG_TUSB_MEM_SECTION attributes to the usbtmc implementation.

I will log an issue for how the test script is used for it to be handled external to this PR.

@pigrew
Copy link
Copy Markdown
Collaborator

pigrew commented Mar 17, 2021

@xmos-jmccarthy,

Thanks. I'll create a PR to edit the python script.

@hathach,

I'm happy to merge this PR.

Copy link
Copy Markdown
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @xmos-jmccarthy for your PR and @pigrew for reviewing it.

@hathach hathach merged commit 881321e into hathach:master Mar 18, 2021
7FM pushed a commit to 7FM/tinyusb that referenced this pull request Aug 23, 2025
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

Successfully merging this pull request may close these issues.

3 participants