Raspberry Pi IoT In C - VS Code Remote C
Written by Harry Fairhead   
Monday, 05 October 2020
Article Index
Raspberry Pi IoT In C - VS Code Remote C
Arm Headers

If you want to make sure that you have all of the ARM headers for your program you can enter and run the following task:

  "label": "copyARMheaders",
  "type": "shell",
  "command": "mkdir ${workspaceFolder}/include/;
       scp -r  ${config:sshUser}@${config:sshEndpoint}:
             /usr/include ${workspaceFolder}/include/ ",
  "problemMatcher": [],
   "presentation": {
        "showReuseMessage": true,
        "clear": true

This copies all of the headers to a new include folder. You will also need to add:

#define __ARM_PCS_VFP

to the start of some of your programs to make all of the spurious intelligent errors go away. This symbol is defined by the compiler at run time to select hardware or software floating point operations. Programs that use headers that depend on the hardware specification generate errors on the local machine as they don’t know the configuration. Notice that none of this has any effect on the program that runs on the remote machine it simply suppresses errors that you see on the local machine as VS Code attempts to find pre-compile errors.


The complete tasks.json is:

 "version": "2.0.0",
    "label": "copyToRemote",
    "type": "shell",
    "command": "scp -r ${fileDirname} ${config:sshUser}@
    "problemMatcher": [],
    "presentation": {
     "showReuseMessage": false,
     "clear": true
     "label": "copyHeader",
     "type": "shell",
     "command": "mkdir ${workspaceFolder}/headers/ ;
       scp -r  ${config:sshUser}@${config:sshEndpoint}:
          ${config:header} ${workspaceFolder}/headers/ ",
     "problemMatcher": [],
     "presentation": {
      "showReuseMessage": false,
      "clear": true
     "label": "buildRemote",
     "type": "shell",
     "command": "ssh ${config:sshUser}@
${config:sshEndpoint}  'gcc -g -std=${config:std} ${config:remoteDirectory}/${relativeFileDirname}/ ${fileBasename} ${config:libs} -o${config:remoteDirectory}/${relativeFileDirname}/ ${fileBasenameNoExtension}.exe'", "problemMatcher": [], "presentation": { "showReuseMessage": false, "clear": false } }, { "label": "runRemote", "type": "shell", "command": "ssh ${config:sshUser}@${config:sshEndpoint}  '${config:remoteDirectory}/${relativeFileDirname}/ ${fileBasenameNoExtension}.exe'", "problemMatcher": [ "$gcc" ], "presentation": { "showReuseMessage": true, "clear": false } }, { "label": "CopyBuildRunRemote", "dependsOrder": "sequence", "dependsOn": [ "copyToRemote", "buildRemote", "runRemote" ], "problemMatcher": [], "group": { "kind": "build", "isDefault": true } }, { "label": "CopyBuildRemote", "dependsOrder": "sequence", "dependsOn": [ "copyToRemote", "buildRemote", ], "problemMatcher": [], }, { "label": "StopREmoteC", "type": "shell", "command": "ssh ${config:sshUser}@
${config:sshEndpoint} 'pkill ${fileBasenameNoExtension}.exe'", "problemMatcher": [], "presentation": { "showReuseMessage": true, } }, { "label": "copyARMheaders", "type": "shell", "command": "mkdir ${workspaceFolder}/include/; scp -r  ${config:sshUser}@${config:sshEndpoint}:
/usr/include ${workspaceFolder}/include/ ", "problemMatcher": [], "presentation": { "showReuseMessage": true, "clear": true } }, ], }

All of the files can be downloaded from iopress.info.

Raspberry Pi And The IoT In C Second Edition

By Harry Fairhead


Buy from Amazon.


  1. Why Pi For IoT?
  2. Getting Started
  3. Getting Started With The GPIO
  4. Simple Output
  5. Some Electronics
  6. Simple Input
  7. GPIO The Linux Way
       Extract 1:The Linux GPIO Driver 
  8. Advanced Input – Events, Threads, Interrupts
       Extract 1: Events & Interrupts 
  9. Pulse Width Modulation - Servos And More
       Extract 1:Basic Pulse Width Modulation 
  10. Using The I2C Bus
  11. The DHT22 Sensor Implementing A Custom Protocol
  12. Exploring - 1‑Wire Bus Basics ***NEW!
  13. Using iButtons
  14. DS18B20 Temperature Sensor
      Extract 1: The DS18B20 Temperature Sensor 
  15. The Multidrop 1‑Wire Bus
  16. The Serial Port
      Extract 1: 1-wire Via Serial 
  17. Getting Started With The SPI Bus
  18. A to D With The SPI Bus
  19. Connecting With The Web - Sockets
  20. Memory-Mapped GPIO
  21. Almost Real-Time Linux
  22. Appendix I GPIO Sysfs Interface



To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.


Helidon Microservices Framework Version 4 Reaches General Availability

Helidon, the open source microservices framework by Oracle, has been updated to version 4, just a month after the release of Java 21. With this release Helidon becomes the world’s first virtual [ ... ]

How High Can Kotlin Go?

Having entered the Top 20 of the TIOBE Index in September 2023, Kotlin has continued its upward trend. Is it going to break into the Top 10 any time soon? Could it emulate Python and rise to the top?

 [ ... ]

More News




or email your comment to: comments@i-programmer.info


Last Updated ( Monday, 05 October 2020 )