Search code examples
windowsvisual-studio-codesonymsys2spresense

Sony Spresense SDK -VS code Extension - Invalid argument # include <arch/types.h> on fresh Build of HelloWorld


Well as life tends to be frustrating, i have found yet another interesting bug in the great conglomerate of which makes up VS-Code and it's list of 'useful' extensions...

Back Story:

To begin - i purchased a new Sony - Spresense Main Board and Expansion Board for development and testing purposes. Everything arrived in great shape with the highest quality of product and packaging.

The First Step:

As with every micro-controller purchased, I always test every aspect offered with the device when it comes to programming. I used the well known Arduino ide to throw a few basic examples on the Spresense main board. They all flashed correctly, worked properly and i was happy to see the device works!

The Problem:

At this point i had gotten my fill of using the arduino ide... I decided to download the vscode extension , following the vscode setup guide provided by Sony Spresense Web Site.

  • I noted the "setup guide" was using out of date versions from the most up to date available versions.
  • I tried using the both older and most recent version with same issues.
  • Every step was followed perfectly and matches the setup guide to the T.
  • VsCode installs and loads the extension, workspace and workspace configuration properly.
  • I also followed the instruction for installing the MSYS2 on windows and verified it was working correctly

The All Stop Error:

Excited to see my first hello world printf statment cruise thru the serial terminal i began the project spresense application build.

The Makefile proceeds thru the steps checking directories and performing required duties.

  • Suddenly towards the end of the make build i get --- BUILD ERROR

make[3]: Entering directory '/c/msys64/home/Anon/spresense/sdk/apps/builtin' In file included from C:/msys64/home/Anon/spresense/nuttx/include/sys/types.h:47:0, from C:/msys64/home/Anon/spresense/nuttx/include/nuttx/lib/builtin.h:51, from ./builtin_list.c:44: C:/msys64/home/Anon/spresense/nuttx/include/stdint.h:49:12: fatal error: C:/msys64/home/Anon/spresense/nuttx/include/arch/types.h: Invalid argument

include <arch/types.h>

compilation terminated. ERROR: arm-none-eabi-gcc failed: 1 command: arm-none-eabi-gcc -M -fno-builtin -mabi=aapcs -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Wshadow -Wundef -g -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -I. -isystem /c/msys64/home/Anon/spresense/nuttx/include -isystem /c/msys64/home/Anon/spresense/nuttx/../sdk/include -D__KERNEL__ -pipe -gdwarf-3 -I /c/msys64/home/Anon/spresense/sdk/apps/include ./builtin_list.c make[3]: *** [/c/msys64/home/Anon/spresense/sdk/apps/Application.mk:209: .depend] Error 1 make[3]: Leaving directory '/c/msys64/home/Anon/spresense/sdk/apps/builtin'

The Make proceeds to throw 10 or so more errors of the same variety, all invalid argument..

I feel like this should be working... I mean with all the fan fair behind this product line one would think the basic setup guide and IDE should work out of the box...

I think i am figuring out why this product line is failing miserably in the public realm...

The Most Basic of Code

#include <sdk/config.h>
#include <stdio.h>

int myAppS_main(int argc, char *argv[])
{
  printf("Hello Spresense!!!");
  return 0;
}

I have spent a few days trying to make heads or tails of this but from what i can tell, Sony has a broken extension offered thru vscode.

I have to admit i am a bit stumped....

Developing under win10, may try using linux as this appears to be an issue with Win10 using MSYS2 terminal.


Solution

  • Well,

    Thanks to @cmm for the confirmation on the build integrity.

    I was able to install the dev stack on another windows 10 computer, without the latest feature update. Just to be sure that was not creating an issue.

    In my great quest for knowledge, i feel i may have found a solution to my problem after researching this in great length.

    What I could verify:

    • VS Code was fully updated

    • MSYS2 was properly installed and updated fully from terminal

    • VS Code extension version is 1.20 updated to current release

    • Terminal was set in VS Code to MSYS directory and accepted for changes

    • SDK configuration was default with no additional config options

    • Project folder location and SDK location are properly set in workspace config

    • Every step was completed as per the Getting Started with SDK guide described

    What I Think Happened

    • ...... Internet Security Program........

    During the install of MSYS2 and Vs Code ext i was not paying close attention to the install process. I simply let it run as i went about my work. During this process unbeknownst to me a number of attempts were made and blocked by my firewall and internet security protocols.. I really cannot believe how stupid this whole issue might actually be...

    • It appears certain sub modules are fetched from different server locations. I checked my firewall logs and for some reason these connection attempts are flagged and blocked.

    Always Watch Your INSTALL!!

    After whitelisting the flagged connection attempts and full dev stack refresh/re install i was able to build past the issues that plagued me so intensively...

    To anyone that encounters this issue, i believe the issue lies in the install process and ensuring proper connections to external servers during MSYS install.

    I have to say... This one threw me for one heck of a loop.... :P