Yeah. I heard your idea of resetting only USB. I think that just disabling the 1.5k pullup for a few ms should do the trick. Even if "tinyusb" doesn't know about it.
On a different project with a different CPU I was seeing unwanted behavior when the CPU rebooted and the pullup stayed active. Now I disable the pullup for 1500 ms and it works as I want it to work. I haven't tested how short I can go, but I'm expecting a factor of 100 will be possible. Maybe 1000 (i.e. 1.5 ms) is enough.
Let me go and look for documentation on how to do that. .... looking... found. SIE_CTRL,. bit 16 . I'm going to test lowering that for 10ms. Wrote the code. .... have no hardware here... test later.
edit: Client tested this on a production machine. I thought he wasn't near his production machines. Anyway... Works! ... most of the time. I tried 20ms but that didn't work on the third try. Lets try 100 next. But not on the production machines.
On a different project with a different CPU I was seeing unwanted behavior when the CPU rebooted and the pullup stayed active. Now I disable the pullup for 1500 ms and it works as I want it to work. I haven't tested how short I can go, but I'm expecting a factor of 100 will be possible. Maybe 1000 (i.e. 1.5 ms) is enough.
Let me go and look for documentation on how to do that. .... looking... found. SIE_CTRL,. bit 16 . I'm going to test lowering that for 10ms. Wrote the code. .... have no hardware here... test later.
edit: Client tested this on a production machine. I thought he wasn't near his production machines. Anyway... Works! ... most of the time. I tried 20ms but that didn't work on the third try. Lets try 100 next. But not on the production machines.
Statistics: Posted by rew — Wed Jul 24, 2024 9:31 am