Author Topic: pfm3 : usb midi not working in 0.99b?  (Read 14874 times)

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #15 on: December 14, 2020, 04:23:53 PM »
Is there a debug mode available that could show me this info somehow?
The clock frequency i mean... Will boot up Linux later, since I am more familiar with lsusb and dmesg...
« Last Edit: December 14, 2020, 05:29:03 PM by lokki »

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #16 on: December 14, 2020, 09:43:21 PM »
I just tried also on my work macbook (10.15.5) and it also works fine. I can see "preenfm3"  in the MacOS "midi studio".

Quote
    It will give you a list of all devices and the driver it uses etc. preenfm3 is not even listed here when I boot it normally. I will next try to boot without usb power and a wall wart supply to see if it changes something.

I don't understand, in your message #2 you list the output of the command that shows the preenfm3.
Now you say it does not show up. Did it stop working ?

Quote
    it seems this is not related to my macbook air after all. i cannot get my preenfm3 to be seen on any other computer as well!


What is this other computer ?

Have you tried with an other USB cable ?

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #17 on: December 15, 2020, 12:49:09 AM »
I have tried with several cables. That output was of one time it was working(approximately one out of 30 times it works).

In dfu mode it works every time which really makes me think it is not a hardware issue.

I have access to several macs, some with Linux other with osx on them. Will try to find a pc with windows on it...

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #18 on: December 15, 2020, 01:08:51 AM »
Ok on Linux it is better, it works one out of 10 I would say :) no pattern...

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #19 on: December 15, 2020, 08:07:41 AM »
EDITED : What i wrote here is wrong.. the preenfm3 midi driver actually uses the internal 48Mhz. Not a derived PLL from the 8Mhz crystal as i wrote in this message.

I have tried with several cables. That output was of one time it was working(approximately one out of 30 times it works).
In dfu mode it works every time which really makes me think it is not a hardware issue.
I have access to several macs, some with Linux other with osx on them. Will try to find a pc with windows on it...

I thought about what can be the difference between DFU and Usb MIDI, and it can be a hardware problem.

USB requires a precise 48Mhz clock.
The DFU is built in in the STM32H7 and use a internal clock, the MIDI use the pfm3 8Mhz crystal to build the 48Mhz.
(The "USBKey access from computer" in the bootloader also use the pfm3 8Mhz crystal, does it work reliably ?).

Can you boot in the bootloader, then simply click reboot and see if it's better ?
If yes, that would mean your crystal needs a bit more time to stabilize.



« Last Edit: December 17, 2020, 10:34:27 AM by Xavier »

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #20 on: December 15, 2020, 10:05:37 AM »
Interesting...

The SD Card access from bootloader is slow but it works reliably. I can copy files, delete them or create new folders...

This seems to rule out a hardware issue.

The bootloader reboot thing did not help, the preenfm3 is still not recognized.

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #21 on: December 15, 2020, 10:11:13 AM »
sd card access gives me this:

Code: [Select]
+-o STM32 Mass Storage@14100000  <class AppleUSBDevice, id 0x100000a38, registered, matched, active, busy 0 (3 ms), retain 21>
        {
          "sessionID" = 1922088129427
          "iManufacturer" = 1
          "bNumConfigurations" = 1
          "idProduct" = 22314
          "bcdDevice" = 512
          "Bus Power Available" = 250
          "USB Address" = 14
          "bMaxPacketSize0" = 64
          "iProduct" = 2
          "iSerialNumber" = 3
          "bDeviceClass" = 0
          "Built-In" = No
          "locationID" = 336592896
          "bDeviceSubClass" = 0
          "bcdUSB" = 512
          "USB Product Name" = "STM32 Mass Storage"
          "PortNum" = 1
          "non-removable" = "no"
          "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
          "bDeviceProtocol" = 0
          "IOUserClientClass" = "IOUSBDeviceUserClientV2"
          "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=3,"CapabilityFlags"=65536,"MaxPowerState"=4,"DriverPowerState"=3}
          "kUSBCurrentConfiguration" = 1
          "Device Speed" = 1
          "USB Vendor Name" = "STMicroelectronics"
          "idVendor" = 1155
          "uid" = "USB:0483572A375F35743030"
          "IOGeneralInterest" = "IOCommand is not serializable"
          "USB Serial Number" = "375F35743030"
          "IOClassNameOverride" = "IOUSBDevice"
        }

with the above command...

DFU:

Code: [Select]
   +-o DFU in FS Mode@14100000  <class AppleUSBDevice, id 0x100000a8b, registered, matched, active, busy 0 (2 ms), retain 16>
        {
          "sessionID" = 2206053589421
          "iManufacturer" = 1
          "bNumConfigurations" = 1
          "idProduct" = 57105
          "bcdDevice" = 512
          "Bus Power Available" = 250
          "USB Address" = 15
          "bMaxPacketSize0" = 64
          "iProduct" = 2
          "iSerialNumber" = 3
          "bDeviceClass" = 0
          "Built-In" = No
          "locationID" = 336592896
          "bDeviceSubClass" = 0
          "bcdUSB" = 512
          "USB Product Name" = "DFU in FS Mode"
          "PortNum" = 1
          "non-removable" = "no"
          "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
          "bDeviceProtocol" = 0
          "IOUserClientClass" = "IOUSBDeviceUserClientV2"
          "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=3,"CapabilityFlags"=65536,"MaxPowerState"=4,"DriverPowerState"=3}
          "Device Speed" = 1
          "USB Vendor Name" = "STMicroelectronics"
          "idVendor" = 1155
          "IOGeneralInterest" = "IOCommand is not serializable"
          "USB Serial Number" = "200364500000"
          "IOClassNameOverride" = "IOUSBDevice"
        }

and normal boot shows nothing, nada, rien :-)

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #22 on: December 15, 2020, 10:24:45 AM »
ok, did another firmware reflash to 0.97 and usb-midi works again, strange.

did re-update to 0.99b and it works for 2 or 3 reboots and then stops working again. really f***ing strange.

will have to reflash 0.97 and do more then a couple of reboots to check if it is really reliable then.



Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #23 on: December 15, 2020, 01:37:34 PM »
will have to reflash 0.97 and do more then a couple of reboots to check if it is really reliable then.

Yes that would be interesting.

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #24 on: December 15, 2020, 10:50:53 PM »
Unfortunately I can confirm, that 0.97 is also only working VERY sporadically.
Interestingly it always seems to work after the firmware upload...so the first boot is ok. I wonder how and why that could be, since I unplug the preenfm3 in between and set the jumper...

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #25 on: December 15, 2020, 10:55:50 PM »
this is from one time it worked:

Code: [Select]
"sessionID" = 3911869770800
          "iManufacturer" = 1
          "bNumConfigurations" = 1
          "idProduct" = 22336
          "bcdDevice" = 256
          "Bus Power Available" = 250
          "USB Address" = 3
          "bMaxPacketSize0" = 64
          "iProduct" = 2
          "iSerialNumber" = 0
          "bDeviceClass" = 0
          "Built-In" = No
          "locationID" = 336592896
          "bDeviceSubClass" = 0
          "bcdUSB" = 272
          "USB Product Name" = "preenfm3"
          "PortNum" = 1
          "non-removable" = "no"
          "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
          "bDeviceProtocol" = 0
          "IOUserClientClass" = "IOUSBDeviceUserClientV2"
          "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=4,"CapabilityFlags"=32768,"MaxPowerState"=4,"DriverPowerState"=4}
          "kUSBCurrentConfiguration" = 1
          "Device Speed" = 1
          "USB Vendor Name" = "Xavier Hosxe"
          "idVendor" = 1155
          "IOGeneralInterest" = "IOCommand is not serializable"
          "IOClassNameOverride" = "IOUSBDevice"

do you get the same readings and values? i.e. power state etc.? and bus power available?

from the packet size it looks like you made the device usb 1.1 compatible, right? could you make it usb 2.0 with 512 bytes packet size?

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #26 on: December 16, 2020, 10:00:18 AM »
What i get is

Code: [Select]
   +-o preenfm3@14200000  <class AppleUSBDevice, id 0x100000387, registered, matched, active, busy 0 (0 ms), retain 16>
        {
          "sessionID" = 1697173677
          "idProduct" = 22336
          "iManufacturer" = 1
          "bDeviceClass" = 0
          "bMaxPacketSize0" = 64
          "bcdDevice" = 256
          "iProduct" = 2
          "iSerialNumber" = 0
          "bNumConfigurations" = 1
          "Bus Power Available" = 250
          "USB Address" = 5
          "Built-In" = No
          "locationID" = 337641472
          "bDeviceSubClass" = 0
          "bcdUSB" = 272
          "USB Product Name" = "preenfm3"
          "PortNum" = 2
          "non-removable" = "no"
          "AppleUSBAlternateServiceRegistryID" = 4294968197
          "bDeviceProtocol" = 0
          "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBHostFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
          "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=3,"CapabilityFlags"=65536,"MaxPowerState"=4,"DriverPowerState"=3}
          "kUSBCurrentConfiguration" = 1
          "Device Speed" = 1
          "USB Vendor Name" = "Xavier Hosxe"
          "idVendor" = 1155
          "IOGeneralInterest" = "IOCommand is not serializable"
          "kUSBProductString" = "preenfm3"
          "kUSBVendorString" = "Xavier Hosxe"
          "IOClassNameOverride" = "IOUSBDevice"
        }


If you unplug the TFT, the current required will be 50mA lower. You can give it a try, to see if that makes a difference.
« Last Edit: December 16, 2020, 10:02:21 AM by Xavier »

forestcaver

  • Team member
  • *
  • Posts: 18
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #27 on: December 16, 2020, 07:58:19 PM »
An extra datapoint if it helps:

Just tested my preenFM3 on v100 - I can't see the preenFM3 over USB either. (MacOS 10.15.7, Macbook Pro 13” early 2015)

As a sanity check - same cable, port; Mac sees the PreenFM2 (pcb R6, latest fw) with no problems

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #28 on: December 16, 2020, 09:33:35 PM »
OK, I'm able to reproduce it on my Linux machine.
My current dev pfm3 does not have this problems which is my excuse for being slow on this one  ;) My 2 others have it.

Usb is great for users, but a nightmare for devs.
Now i have to investigate  :-\
« Last Edit: December 16, 2020, 09:39:23 PM by Xavier »

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: usb midi not working in 0.99b?
« Reply #29 on: December 17, 2020, 08:17:13 AM »
Can you try the attached firmware when you get a chance ?
Thanks
« Last Edit: December 17, 2020, 08:40:42 AM by Xavier »