Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to use pin for pwm after calling SetPinMode. #1470

Closed
007roy opened this issue Mar 4, 2021 · 4 comments
Closed

No way to use pin for pwm after calling SetPinMode. #1470

007roy opened this issue Mar 4, 2021 · 4 comments
Labels
area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins bug Something isn't working duplicate This issue or pull request already exists

Comments

@007roy
Copy link

007roy commented Mar 4, 2021

Describe the bug
On Raspberry Pi 4
If GpioController.SetPinMode or OpenPin are used to set PinMode.Output at anytime system must be rebooted before PwmChannel can be used.

Steps to reproduce
Add 'dtoverlay=pwm,pin=18,func=2' line to /boot/config.txt and reboot

exec this code:
...
var pwm=PwmChannel.Create(0,0,500,1);
pwm.start();
...

exec this code:
...
controller.OpenPin(18,PinMode.Output);
...

then repeat:
...
var pwm=PwmChannel.Create(0,0,500,1);
pwm.start();
...

Expected behavior

Describe what did you expect to happen

Actual behavior

Describe what actually happened

Versions used

Add following information:

.NET SDK (reflecting any global.json):
Version: 5.0.100
Commit: 5044b93829

Runtime Environment:
OS Name: raspbian
OS Version: 10
OS Platform: Linux
RID: linux-arm
Base Path: /home/pi/dotnet/sdk/5.0.100/

Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7

.NET SDKs installed:
5.0.100 [/home/pi/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0 [/home/pi/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0 [/home/pi/dotnet/shared/Microsoft.NETCore.App]

@007roy 007roy added the bug Something isn't working label Mar 4, 2021
@ghost ghost added the untriaged label Mar 4, 2021
@pgrawehr
Copy link
Contributor

pgrawehr commented Mar 5, 2021

Hi @007roy

This is a known problem, see #874, #878 and others. If you've got wiringpi installed (the latest version), you can use a command like gpio -g mode 12 ALT0 to reset pin 12 to PWM.

PR #1128 is going to fix this. Since it's a big change, review is taking its time. But we definitelly want this in the next release.

@pgrawehr pgrawehr added area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins duplicate This issue or pull request already exists and removed untriaged labels Mar 5, 2021
@krwq
Copy link
Member

krwq commented Mar 5, 2021

@007roy thank you for filing the issue - this gives us feel that this is not a potential problem happening with tests abusing the APIs and it's an actual pain point. Just to clarify: next release => next major release timeline. This is something we do want to ship but it has non-trivial design - getting this wrong would have really bad long-term user experience impact which we'd prefer to avoid and that's why we prefer to take extra time on the APIs.

@ghost
Copy link

ghost commented Mar 6, 2021

This issue has been marked as duplicate and has not had any activity for 1 day. It will be closed for housekeeping purposes.

@ghost ghost closed this as completed Mar 6, 2021
@ghost
Copy link

ghost commented Mar 7, 2021

This issue has been marked as duplicate and has not had any activity for 1 day. It will be closed for housekeeping purposes.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 7, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants