Community

Unable to load DLL 'nuttx'

Hi,

I’ve just upgraded my Meadow Board to MeadowOS Version: 0.4.0 (Sep 19 2020 14:37:21) and now if I create a vanilla application (or try and run any of the samples, using the 0.18 package versions), I get the following exception:

    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Meadow.Devices.UPD' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'nuttx': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Meadow.Core.Interop.Nuttx.open(String pathname, DriverFlags flags)
at Meadow.Devices.UPD..cctor()
--- End of inner exception stack trace ---
at Meadow.Devices.UPD.SetRegister(UInt32 address, UInt32 value)
at Meadow.Devices.F7GPIOManager.ConfigureGpio(GpioPort port, Int32 pin, GpioMode mode, ResistorMode resistor, GPIOSpeed speed, OutputType type, Boolean initialState, InterruptMode interruptMode, Int32 alternateFunctionNumber, Double debounceDuration, Double glitchDuration)
at Meadow.Devices.F7GPIOManager.Initialize()
at Meadow.Devices.F7Micro..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance[T]()
at Meadow.App`2.get_Device()
at McpLeds.MeadowApp..ctor()

Any ideas?

Hi Howard,

Have you figured out the problem? My current dev stack is:

  • Visual Studio 16.7.6
  • VS Tools for Meadow 0.12.12
  • Meadow.OS 0.4.0
  • Meadow.Foundation 0.19.0

You mentioned you’re using 0.18 package versions. Make sure to match my version stack, and try again. If you do a file-> new project, please make sure the Meadow.Foundation package is up-to-date.

Hi,

I realise (from spotting a comment on another post) that the default F5 behaviour is to deploy the application to the device AND to launch the .exe locally and it’s the local instance that generates the nuttx runtime error - which is obvious when you realise it, but it would be nice if this was called out in the getting started documentation (or figure out a way to deploy via F5 and not to run the .exe locally).

I have spent the last two days trying to get an app running and yesterday, did try the toolchain you mention above, but have been seeing the following two issues:


The only combination that I’ve found to work are:

  • Visual Studio 16.7.6
  • VS Tools for Meadow 0.11.1
  • Meadow.OS 0.4.0
  • Meadow.Foundation 0.18.0

Hi Howard,

We took a closer look at the extension, and we pushed an update with a small fix that should unblock you from deploying apps to your board. See if you get the update, latest version of the extension is now 0.12.3, and give that a try, we’re getting reports that the update fixed the Mono.Cecil problem.

Thanks,
Jorge