David Stania
David Stania

Reputation: 148

Does .net core run on ARM Cortex-A7?

I created a small console app for testing it with an ARM Cortex-A7 device. I tried to use couple of runtimes

but without success. If I'm using a 32bit runtime, the executable will not found. If I'm using a 64bit runtime, it fails with the following output:

root@MC100:~# /root/publish/openwrttest /root/publish/openwrttest: line 1: can't open @▒@8: no such file /root/publish/openwrttest: line 1:ELF▒: not found /root/publish/openwrttest: line 2: @!@@@0ppp1▒1▒▒▒▒▒▒8 T 8▒8▒8▒p▒▒▒DDP▒td▒▒Q▒td▒▒▒▒R▒td▒▒▒▒▒▒H/lib/ld-linux-aarch64.so.1GNUGNU▒▒׽S▒Ym▒ a▒x|▒#p]| ▒ ▒ ▒▒▒▒▒: not found /root/publish/openwrttest: PuTTYline 2: L▒▒: not found /root/publish/openwrttest: line 4: syntax error: unterminated quoted string

So my question is, does it work with this cpu? Does anyone have already expirence with that or any idea where is my mistake?

UPDATE LDD trace gives the following info:

root@MC100:~# ldd /root/publish/openwrttest /lib/ld-linux-armhf.so.3 (0x76ee0000) libpthread.so.0 => /lib/ld-linux-armhf.so.3 (0x76ee0000) libdl.so.2 => /lib/ld-linux-armhf.so.3 (0x76ee0000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x76dc2000) libm.so.6 => /lib/ld-linux-armhf.so.3 (0x76ee0000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x76da7000) libc.so.6 => /lib/ld-linux-armhf.so.3 (0x76ee0000) Error loading shared library ld-linux-armhf.so.3: No such file or directory (needed by /root/publish/openwrttest)

Upvotes: 0

Views: 1581

Answers (1)

Frant
Frant

Reputation: 5895

Yes, .NET Core 3.0 works on a ARM Cortex-A7 - Tested on a quad Cortex-A7 nanopi2-m1 running Armbian buster - See Microsoft installation instructions here.

wget https://download.visualstudio.microsoft.com/download/pr/4a44d4d2-19c1-485a-8b58-fa06805cddcf/cc805a1ebd9d72099309dcd46492d36f/dotnet-sdk-3.0.103-linux-arm.tar.gz
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-3.0.103-linux-arm.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet


# Verify dotnet is working.
dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.103
 Commit:    b7ef045669

Runtime Environment:
 OS Name:     debian
 OS Version:  10
 OS Platform: Linux
 RID:         debian.10-arm
 Base Path:   /home/user/dotnet/sdk/3.0.103/

Host (useful for support):
  Version: 3.0.3
  Commit:  c03f2fe626

.NET Core SDKs installed:
  3.0.103 [/home/user/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.3 [/home/user/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.3 [/home/user/dotnet/shared/Microsoft.NETCore.App]

# Create HelloWorld application.
dotnet new console -o HelloWorld

cd HelloWorld/
dotnet run
Hello, World!

Please note that, according to Microsoft, .NET Core 3.0 is now obsolete and not supported anymore: This release has reached end of life, meaning it is no longer supported. We recommend moving to a supported release, such as .NET 7.0.

This having been said, .NET 7.0 works perfectly fine too on a Cortex-A7 using for example dotnet-sdk-7.0.101-linux-musl-arm (You can download it from here).

Tested this time on the same quad Cortex-A7 nanopi2-m1 running Alpine Linux 3.17.0 - See Microsoft installation instructions here.

Procedure:

wget https://download.visualstudio.microsoft.com/download/pr/bde0b4e5-2b2c-4046-a74f-6618bfa8ab8a/3170cd4312552c2eba2a0de3acd85337/dotnet-sdk-7.0.101-linux-musl-arm.tar.gz
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-7.0.101-linux-musl-arm.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet

# Verify dotnet is working.  
dotnet

Usage: dotnet [options]
Usage: dotnet [path-to-application]

Options:
  -h|--help         Display help.
  --info            Display .NET information.
  --list-sdks       Display the installed SDKs.
  --list-runtimes   Display the installed runtimes.

path-to-application:
  The path to an application .dll file to execute.
  
# Create HelloWorld application.
dotnet new console -o HelloWorld  -f net7.0

cd HelloWorld/
dotnet run
Hello, World!

Upvotes: 1

Related Questions