Community

Linux Meadow F7 Micro Development

Hello,

I finally found some time to start exploring the Meadow F7. I know that officially only Mac and Windows are supported but since there is the dotnet CLI also for Ubuntu I thought I give it a try, because Ubuntu is my main system I work with.

I managed to do all the steps from the " Meadow OS Deployment" guide but it needed some udev rules and adding the user to an other group to get the meadow CLI. I then created a net5.0 console application and added the nuget packaged Meadow, Meadow.Core and Meadow.Foundation. I then started with the ‘Hello Word’ example with the pulsing LED and build the project using “dotnet build -r win-x86”.
Following files were then uploaded using the meadow CLI:

*System.dll
*System.Core.dll
*mscorlib.dll
*Meadow.Core.dll
*Meadow.Foundation.dll
*App.exe

I then used the command “meadow --MonoEnable” to get everything running and got following error:

App: Runtime critical type System.Object not found

Has anyone done the same and can help me out or can guide me what I need to do?

Kind regards,
Daniel

I activated the debug output which gives the following results:

meadow --MonoEnable
Opening port '/dev/ttyACM0'
Trace: [    1.164000] up_stackdump: c022fc80: 00000000 2003ab80 c022fc90 0811341d 00000000 0000005f c022fcb0 08101bcb
Trace: [    1.164000] up_stackdump: c022fca0: c018cb10 c006373d 00000000 080002f9 00000000 00000067 c0063759 c022fcc0
Trace: [    1.165000] up_stackdump: c022fcc0: 00000004 00000000 c022fcd0 080161f5 00000004 c0063737 c018cb10 c0063707
ID: Meadow by Wilderness Labs, Model: F7Micro, MeadowOS Version: 0.4.2 (Dec  8 2020 10:09:54), Processor: STM32F777IIK6, Processor Id: 23-00-40-00-0f-51-37-32-35-34-36-32,Serial Number: 327634623237, CoProcessor: ESP32, CoProcessor OS Version: 0.4.2.0
Trace: [  135.666000] (Debug) comms/hcom_host_parse.c@127-15 bytes added to cir buf
Trace: [  135.666000] (Debug) comms/hcom_host_parse.c@228-Non-data seq:0, len:12
Trace: [  135.667000] (Debug) -->Received non-data cmd. 0 bytes in header. RqstType:0x0112
Data: Mono has been enabled. Restarting F7 Micro
Trace: [    0.082000] hcom_nx/create_fs/hcom_nx_fs.c@233-Mounted partition 0 as '/dev/little0p0' to '/meadow0' for type 'littlefs'
Data: Meadow successfully started MONO
Data: Mono enabled, will run app.exe
Trace: [    0.083000] F/S creation complete
Trace: [    0.083000] +hcom_nx_upd_initialize
Trace: [    0.084000] (Debug) inicfg/meadow_inicfg.c@304-Config file:/meadow0/meadow.cfg could not be opened
Trace: [    0.084000] (Error) inicfg/meadow_inicfg.c@164-'Config file:/meadow0/meadow.cfg could not be opened'-file:(null), section:startup, key:tracelevel, errno:2
Trace: [    0.086000] (Debug) inicfg/meadow_inicfg.c@304-Config file:/meadow0/meadow.cfg could not be opened
Trace: [    0.086000] (Error) inicfg/meadow_inicfg.c@136-'Config file:/meadow0/meadow.cfg could not be opened'-file:(null), section:startup, key:monorun, errno:2
Trace: [    0.087000] (Note) Meadow 0.4.2 (Dec  8 2020@10:09:51) rebooted, Mono:Enabled, Trace level:0xff, to:Host, type:ramlog
Trace: [    0.088000] (Debug) inicfg/meadow_inicfg.c@304-Config file:/meadow0/meadow.cfg could not be opened
Trace: [    0.088000] (Error) inicfg/meadow_inicfg.c@136-'Config file:/meadow0/meadow.cfg could not be opened'-file:(null), section:startup, key:uart1, errno:2
Trace: [    0.091000] (Debug) comms/hcom_host_receive.c@243-usb open read /dev/ttyACM0
Trace: [    0.093000] (Debug) inicfg/meadow_inicfg.c@304-Config file:/meadow0/meadow.cfg could not be opened
Trace: [    0.093000] (Error) inicfg/meadow_inicfg.c@136-'Config file:/meadow0/meadow.cfg could not be opened'-file:(null), section:startup, key:monorun, errno:2
Trace: [    0.099000] (Debug) inicfg/meadow_inicfg.c@304-Config file:/meadow0/meadow.cfg could not be opened
Trace: [    0.099000] (Error) inicfg/meadow_inicfg.c@164-'Config file:/meadow0/meadow.cfg could not be opened'-file:(null), section:startup, key:ResetEsp32AtStartup, errno:2
Trace: [    0.100000] espcp/espcp_thread.c@154 Waiting for ESP initialisation to complete.
Trace: [    0.102000] (Note) mono/hcom_mono_control.c@161-Attempting to start mono
Trace: [    0.102000] (Info) mono/hcom_mono_control.c@175-MONO launched [pid:8, pri:100, stack size:65536]
Trace: [    0.260000] espcp/espcp_thread.c@156 ESP interface initialisation complete.
Trace: [    0.561000] (Info) nx_rqsts/hcom_via_nx_access.c@99-SUCCESS /dev/nxupd opened
Trace: [    0.562000] (Note) mono/hcom_mono_control.c@423-Mono has succesfully started
Trace: [    0.594000] (Debug) comms/hcom_host_receive.c@268-/dev/ttyACM0 ready for host comms
Trace: [    0.595000] (Debug) inicfg/meadow_inicfg.c@304-Config file:/meadow0/meadow.cfg could not be opened
Trace: [    0.595000] (Error) inicfg/meadow_inicfg.c@136-'Config file:/meadow0/meadow.cfg could not be opened'-file:(null), section:startup, key:monorun, errno:2
Trace: [    0.609000] (Debug) comms/hcom_host_receive.c@279-Waiting for '/dev/ttyACM0' message
App: Runtime critical type System.Object not found
Trace: [    1.169000] (Debug) mono/hcom_stdout_redirect.c@273-Read 46 bytes from fifo
Trace: [    1.170000] up_assert: Assertion failed at file:pthread/pthread_exit.c line: 85 task: mono
Trace: [    1.175000] up_registerdump: R0: 00000001 200209f0 0000004f 00000000 c018cb10 c006373d 00000000 c022fc10
Trace: [    1.180000] up_registerdump: R8: c022ff44 00000000 00000002 165129ff 00000000 c022fbf0 081005e9 08100e0c
Trace: [    1.186000] up_registerdump: xPSR: 61000000 BASEPRI: 000000f0 CONTROL: 00000000
Trace: [    1.190000] up_registerdump: EXC_RETURN: fffffff9
Trace: [    1.193000] up_dumpstate: sp:         c022fc28
Trace: [    1.195000] up_dumpstate: stack base: c0230018
Trace: [    1.198000] up_dumpstate: stack size: 0000ffec
Trace: [    1.200000] up_stackdump: c022fc20: c022fc28 c018cb10 c006373d 00000000 c022fc38 08100783 c022fc28 2003ae70
Trace: [    1.206000] up_stackdump: c022fc40: 0000ffec c0230018 c022fc58 08100867 00000055 2003b08c 00000055 08144fe4
Trace: [    1.211000] up_stackdump: c022fc60: c01027ee 2003ae70 c022fc70 08136285 c022fc78 00000000 c01027ee 2007fb1c
Trace: [    1.217000] up_stackdump: c022fc80: 00000000 2003ae70 c022fc90 0811341d 00000000 0000005f c022fcb0 08101bcb
Trace: [    1.223000] up_stackdump: c022fca0: c018cb10 c006373d 00000000 080002f9 00000000 00000067 c0063759 c022fcc0
Trace: [    1.229000] up_stackdump: c022fcc0: 00000004 00000000 c022fcd0 080161f5 00000004 c0063737 c018cb10 c0063707
Trace: [    1.234000] up_stackdump: c022fce0: 00000000 c0278020 c011b444 c00f8495 c010974e 00000000 c0278ec0 c0063843
Trace: [    1.240000] up_stackdump: c022fd00: c022fd1c c006385b 00000000 c022fd1c c011b444 c0079d09 c011b444 c00f8495
Trace: [    1.246000] up_stackdump: c022fd20: c010974e 00080838 c022fd30 08001a19 00000000 20030800 c0230f58 00000000
Trace: [    1.251000] up_stackdump: c022fd40: c0230fa8 c0230f98 c022fd50 080018c5 c0136216 c0230fa0 c0278ec0 c018f318
Trace: [    1.257000] up_stackdump: c022fd60: c018cf80 c006e22b 08113aa9 080092e7 000092c0 00000000 00000000 c022fdac
Trace: [    1.263000] up_stackdump: c022fd80: 00000002 00000028 00000002 c022fd90 00000000 00000000 c022fdac 00000002
Trace: [    1.269000] up_stackdump: c022fda0: c018b698 c0190844 00000002 00000001 c022ff44 c00245fd 00000000 20030800
Trace: [    1.274000] up_stackdump: c022fdc0: 00000000 00000000 c022fdd0 08113929 00000000 20030800 00000000 00000000
Trace: [    1.280000] up_stackdump: c022fde0: 08113917 08000a71 c0023d59 c0023d5d c0025a21 c0025a19 c0023615 c00236f1
Trace: [    1.286000] up_stackdump: c022fe00: c00236f5 c00339db c004909d c003f66f c0023759 c00281e5 c00281c1 c0035741
Trace: [    1.291000] up_stackdump: c022fe20: c0035839 c0026225 00000000 c0035a25 00000000 c002ef15 c003f1a1 c002436d
Trace: [    1.297000] up_stackdump: c022fe40: 00000008 00000000 00000002 00000000 00000004 c0022e5b 000000f0 f0000037
Trace: [    1.303000] up_stackdump: c022fe60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
Trace: [    1.308000] up_stackdump: c022fe80: 00000000 00000000 c022ff18 00000003 00000000 00000000 08113917 08000a71
Trace: [    1.314000] up_stackdump: c022fea0: 08000a50 81000000 20030964 00000019 00000041 c022feb8 08001119 20030964
Trace: [    1.320000] up_stackdump: c022fec0: c022fed0 0800111f 000001f4 0800355b 0800353a 00000005 c022fef0 00000041
Trace: [    1.325000] up_stackdump: c022fee0: 00000102 c022ff00 08004689 c022ff54 080090bc 00000000 c022ff10 00000000
Trace: [    1.331000] up_stackdump: c022ff00: 00000000 00000000 00000000 08008523 c022ffa4 00000000 08008ff8 08009000
Trace: [    1.337000] up_stackdump: c022ff20: c022ff44 00000000 fffffffd 10606080 a0c01010 40005030 08008ff8 08009000
Trace: [    1.343000] up_stackdump: c022ff40: c022ff44 61656d2f 30776f64 7070412f 6578652e e0506000 00000000 00000003
Trace: [    1.348000] up_stackdump: c022ff60: 00000003 ddccbbaa 00000000 00000002 00000000 00000000 c022ff88 0800499b
Trace: [    1.354000] up_stackdump: c022ff80: a0700020 901000d0 c023001c 00000001 70001000 00800000 d0f0f0d0 d02065b8
Trace: [    1.360000] up_stackdump: c022ffa0: 00200000 00004000 d000c0a8 00000000 c022ffb8 08000323 c023001c c023001c
Trace: [    1.365000] up_stackdump: c022ffc0: 00000001 08004939 c022ffd0 0811a4e3 c023001c 00000001 08004939 00000004
Trace: [    1.371000] up_stackdump: c022ffe0: 80d0a040 c022ffe8 30103000 c023001c 00000001 08004939 c0230000 0810ea47
Trace: [    1.377000] up_stackdump: c0230000: 00000000 00000000 2003ae70 00000001 00000000 00000000 000080b0 c0230024
Trace: [  135.740000] (Debug) comms/hcom_host_parse.c@127-15 bytes added to cir buf
Trace: [  135.741000] (Debug) comms/hcom_host_parse.c@228-Non-data seq:0, len:12
Trace: [  135.741000] (Debug) -->Received non-data cmd. 0 bytes in header. RqstType:0x0110

Is this error normal?

Trace: [ 0.088000] (Error) inicfg/meadow_inicfg.c@136-‘Config file:/meadow0/meadow.cfg could not be opened’-file:(null), section:startup, key:uart1, errno:2

The system is just telling you that it cannot find the file. If that file is not found then the system will revert to using default values.

Regards,
Mark

Thanks for your response! So this file does not need to be added?

Regards,
Daniel

This file is optional.

Regards,
Mark

Okay, thanks for your help Mark!

So I only need to figure out the cause for the Runtime critical type System.Object not found.

I know you say that Linux is your main machine but have you tried creating the project on say Visual Studio for Windows to see if that works? Just trying to work out where the problem is.

Regards,
Mark

I figured the out the problem. First thing was a problem with the System.dll which I replaced with one from the WildernessLabs.Meadow.Assemblies.0.4.0. The System.Object error was gone then but it would not run. By running the with the command meadow --MonoEnable --KeepAlive which keeps the connection open after starting. After a few seconds I got the error File does not contain a valid CIL image. Turns out the dotnet CLI creates a executable which misses some information for mono. I looked that problem up and found that I can try mono to build the project with the msbuild which turned out to be the solution.

I am going to create a clean project, try it again and document everything for other Linus users.

Good to know you are up and running.

If you are documenting this problem and the solution you could always create a PR for our Documentation repository with the additional information.

Regards,
Mark

I am already working on updating the Documentation, hope to be able to create the PR tomorrow.

Regards,
Daniel