1

I am currently realizing a project in C # on a Raspberry Pi 3. On the Pi, Windows runs IoT Core in the latest stable release release (v.10.0.16299.309). When I initiate the PWM pins, the method runs in an exception (System.Runtime.InteropServices.SEHException: 'External component raised an exception.'). All rights are set and all releases are set on the Windows Fall Creators Update. Can someone be with me. Thank you.

here the Code:

private async void StartPWM()
    {
        GpioController gpioController = await GpioController.GetDefaultAsync();
        if (LightningProvider.IsLightningEnabled)
        {
            try
            {
                LowLevelDevicesController.DefaultProvider = LightningProvider.GetAggregateProvider();
                var pwmControllers = await PwmController.GetControllersAsync(LightningPwmProvider.GetPwmProvider());
                var pwmController = pwmControllers[1];
                pwmController.SetDesiredFrequency(50); //<---- Here it crasches

                dictionaryPwm = new Dictionary<int, PwmPin>
                {
                    {23,PWM.ActivatePwmPin(23,pwmController) },
                    {24,PWM.ActivatePwmPin(24,pwmController) }
                };
            }
            catch(Exception exception)
            {
                throw exception;
            }
        }
    }
user332070
  • 31
  • 1
  • 4
  • This you found a fix for this? I think I've a related issue: https://stackoverflow.com/questions/56378895/windows-10-iot-core-app-crashes-if-i-try-to-open-a-pwm-pin – Tobonaut May 30 '19 at 14:00

1 Answers1

0

I ran into this same issue. In your project properties, try setting up your Targeting as follows:

Targeting setup

Trev
  • 63
  • 5