{"id":701,"date":"2018-05-12T11:35:14","date_gmt":"2018-05-12T09:35:14","guid":{"rendered":"http:\/\/systev.com\/?p=701"},"modified":"2019-06-09T20:04:17","modified_gmt":"2019-06-09T18:04:17","slug":"mangoh-red-using-a-linux-mint-vm-for-development","status":"publish","type":"post","link":"https:\/\/systev.com\/mangoh-red-using-a-linux-mint-vm-for-development\/","title":{"rendered":"mangOH Red: using a Linux Mint VM for development"},"content":{"rendered":"
Updated: 13-May-2018<\/strong><\/p>\n To develop for the mangOH Red board<\/a>, you can use an Ubuntu-based virtual machine, provided by the mangOH team<\/a>. It turns out that I prefer Linux Mint<\/a> to Ubuntu, mainly because of the window manager, and I wanted to start trying to understand how the mangOH development environment is structured and works. So I decided to set up my own development VM, based on Linux Mint.<\/p>\n In this article, I describe the various steps I followed to create this VM.<\/p>\n The host machine I use is a MacBook running macOS High Sierra, but provided explanations can be easily adapted to a Linux host, or to a Windows host.<\/p>\n You don’t need to be an expert in Linux nor in virtual machines to perform operations described below, as I tried to provide detailed information. Nevertheless, having a first experience is a good thing. And anyway, if you plan to develop for a mangOH board, you’ll need this experience \ud83d\ude42<\/p>\n The mangOH Red Getting Started Guide<\/a><\/em> is used as reference. All steps below are to be performed in the VM.<\/p>\n Proceed as explained here<\/a>. For me:<\/p>\n Proceed as explained here.<\/a> For me:<\/p>\n Given the fact that the USB attach is not automatic (see above), I had to manually reattach the board to the VM twice during firmware update: during the switch to firmware download mode, and after module reboot.<\/p>\n That’s it: the development environment is ready.<\/p>\n For more information, you can refer to following documents:<\/p>\n Updated: 13-May-2018 Introduction To develop for the mangOH Red board, you can use an Ubuntu-based virtual machine, provided by the mangOH team. It turns out that I prefer Linux Mint to Ubuntu, mainly because of the window manager, and I wanted to start trying to understand how the mangOH development environment is structured and works. … <\/p>\nIntroduction<\/h1>\n
Creation of the VM<\/h1>\n
\n
shasum -a 256 linuxmint-18.3-mate-64bit.iso\n<\/pre>\n
\n
\n
mangoh<\/code> (for instance)<\/li>\n
Linux<\/code><\/li>\n
Linux 2.6 \/ 3.x \/ 4.x (64-bit)<\/code><\/li>\n
4096 MB<\/code> (adapt to your host memory)<\/li>\n
Create a virtual hard disk now<\/code><\/li>\n
VDI<\/code><\/li>\n
Dynamically allocated<\/code><\/li>\n
\n
\n
Left-cmd<\/code>). You can use the
host+F<\/code> key combination to switch to\/from full-screen mode. Click on the Switch<\/strong> button<\/li>\n
1024 x 768<\/code> for instance. This will make the installation process easier<\/li>\n
\n
mangoh<\/code>, keep proposed computer’s name and username, use
mangoh<\/code> for password<\/li>\n
Enter<\/code> key when requested<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n
Configuration of the VM<\/h1>\n
\n
mangoh<\/code>)<\/li>\n
sharedFolder<\/code> for instance. Check Auto-mount<\/strong> and Make Permanent<\/strong><\/li>\n
sudo adduser mangoh vboxsf\n# This grants you read\/write access to the shared folder\n<\/pre>\n
\n
modemmanager<\/code> in the Quick filter<\/strong> input field. In the list of packages that is displayed as a result, right-click on
modemmanager<\/code> and select Mark for Complete Removal<\/strong>. Then click on Apply<\/strong> tool (if modemmanager is not removed, Linux Mint will try to use the mangOH board as a 3G modem)<\/li>\n
Installation of the development environment<\/h1>\n
Dependencies<\/h2>\n
\n
sudo apt-get install -y \\\n build-essential \\\n lib32z1 \\\n lib32ncurses5 \\\n cmake \\\n git \\\n ninja-build \\\n repo \\\n python-jinja2 \\\n python-git \\\n texinfo \\\n chrpath \\\n libxml2-utils \\\n gcovr \\\n libcurl4-gnutls-dev \\\n zlib1g-dev \\\n libbz2-dev \\\n bsdiff \\\n libssl-dev \\\n dh-autoreconf\n<\/pre>\n
Module firmware and toolchain<\/h2>\n
\n
WPx5xx_Release15_GENERIC_SPK.spk<\/code> file starts<\/li>\n
WP_Module_Firmware<\/code>, and move the above file to it:<\/li>\n<\/ul>\n
mkdir ~\/WP_Module_Firmware\nmv ~\/Downloads\/WPx5xx_Release15_GENERIC_SPK.spk ~\/WP_Module_Firmware\/\n<\/pre>\n
\n
poky-swi-ext-glibc-x86_64-meta-toolchain-swi-ext-armv7a-vfp-neon-toolchain-swi-ext-1.7.3.sh<\/code>. Associated Legato Distro Source version, displayed in the section, is
SWI9X15Y_07.12.14.00<\/code><\/li>\n
sudo .\/poky-swi-ext-glibc-x86_64-meta-toolchain-swi-ext-armv7a-vfp-neon-toolchain-swi-ext-1.7.3.sh\n<\/pre>\n
\n
\/opt\/swi\/y17-ext-SWI9X15Y_07.12.14.00<\/code><\/li>\n
cd \/opt\/swi\nsudo ln -f -s y17-ext-SWI9X15Y_07.12.14.00 y17-ext-wp85\n<\/pre>\n
\n
export PATH=\/opt\/swi\/y17-ext-wp85\/sysroots\/x86_64-pokysdk-linux\/usr\/bin\/arm-poky-linux-gnueabi:$PATH\ncd \/opt\/swi\/y17-ext-wp85\/sysroots\/armv7a-vfp-neon-poky-linux-gnueabi\/usr\/src\/kernel\/\nsudo chown -R $USER .\nARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- make scripts\nsudo chown -R root .\n<\/pre>\n
\n
wget http:\/\/updatesite.sierrawireless.com\/swiflash\/swiflash_latest.deb -O ~\/Downloads\/swiflash_latest.deb\nsudo apt-get install ~\/Downloads\/swiflash_latest.deb\n<\/pre>\n
MangOH development environment<\/h2>\n
\n
# Set git identity\ngit config --global user.email \"\"\ngit config --global user.name \"\"\n# Install Legato framework\ncd ~\nmkdir legato_framework\ncd legato_framework\nrepo init -u git:\/\/github.com\/legatoproject\/manifest -m \\\n legato\/releases\/18.04.0\/legato.xml\nrepo sync\n<\/pre>\n
\n
cd ~\ngit clone --recursive git:\/\/github.com\/mangOH\/mangOH\n<\/pre>\n
\n
.bashrc<\/code> file:<\/li>\n<\/ul>\n
export LEGATO_ROOT=~\/legato_framework\/legato\nexport WP85_SYSROOT=\/opt\/swi\/y17-ext-wp85\/sysroots\/armv7a-vfp-neon-poky-linux-gnueabi\nalias cfglegato=\"pushd . && cd ~\/legato_framework\/legato && source .\/bin\/configlegatoenv ; popd\"\n<\/pre>\n
\n
cd ~\/mangOH\nmake red_wp85\n<\/pre>\n
MangOH board setup<\/h1>\n
\n
VM configuration for the board<\/h1>\n
\n
Sierra Wireless, Incorporated WP8548 [0006]<\/code><\/li>\n
ping 192.168.2.2\n#\n# Reply should be: \n#\n# PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.\n# 64 bytes from 192.168.2.2: icmp_seq=1 ttl=64 time=1.20 ms\n# ...\n# use CTRL+C to exit from the command\n#\n<\/pre>\n
Board firmware update<\/h1>\n
\n
cd ~\/WP_Module_Firmware\nswiflash -m WP85XX -i WPx5xx_Release15_GENERIC_SPK.spk\n#\n# Reply should be:\n#\n# Detecting USB of the target\n# DONE\n# Communicating with the target\n# DONE\n# Switching to firmware download mode\n# .......................................DONE\n# Downloading the firmware\n# ....................DONE\n# Rebooting the module\n# ...........DONE\n# Firmware Download SUCCESS\n#\n<\/pre>\n
\n
ssh root@192.168.2.2\n#\n# Replay \"yes\" to the displayed message:\n#\n# The authenticity of host '192.168.2.2 (192.168.2.2)' can't be established.\n# RSA key fingerprint is SHA256:<aString>.\n# Are you sure you want to continue connecting (yes\/no)? yes\n#\n# The above message is displayed at the first connection only.\n#\n# Keep the \"no password\" configuration:\n#\n# Linux swi-mdm9x15 3.14.29ltsi-13c67b16ff_922830eb31 #2 PREEMPT Fri Apr 15 02:38:16 PDT 2016 # armv7l GNU\/Linux\n#\n# It is strongly recommended to setup credentials for remote login.\n# Please select one of the following options:\n# 1) Setup ssh keys and disable passwords-based authentication via ssh\n# (the most secure)\n# 2) Setup password (better than nothing)\n# 3) Do nothing\n3\n#\n# Would you like a reminder next time you log in [Y\/n]?\n#\n# OK, I will remind you next time.\n#\n# Request firmware information:\n#\ncm info\n#\n# Answer for firmware is:\n# Firmware: SWI9X15Y_07.12.14.00 r34472 CARMD-EV-FRMWR1 2017\/11\/29 18:24:42\n# Bootloader: SWI9X15Y_07.12.14.00 r34472 CARMD-EV-FRMWR1 2017\/11\/29 18:24:42\n#\n<\/pre>\n
\n
#\n# Define required environment variables and commands:\n#\ncfglegato\n# \n# Install platform:\n#\nupdate ~\/mangOH\/build\/update_files\/red\/mangOH.wp85.update 192.168.2.2\n#\n<\/pre>\n
\n
ssh...<\/code>), and execute the
app status <\/code>command. You should find the
redSensorToCloud<\/code> application in the returned list.<\/li>\n<\/ul>\n
\n
Limitations<\/h1>\n
\n
Developer Studio is not installed.<\/del> Check this article<\/a> to install and configure Developer Studio.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"