Build and Upload

To build and upload a project,

  • Select the target All or Fast.

  • Press the button Run or press Cmd+B.

The sketch is going to be built and linked, and the resulting executable uploaded to the board and open.

At the end, the Terminal application opens a serial console.

Define the Settings for Edison MCU

 If the application targets the Edison MCU and uses GPIO or PWM pins, I²C or UART ports, the ports need to be configured on the Linux side.

  • Open the main Makefile and edit the line MCU_CONFIGURATION with the settings.

  • Add the scripts among init_DIG.sh, init_i2c8.sh, init_mcu_PWM.sh, read_DIG.sh, set_DIG.sh and init_UART1.sh and specify the parameters.

The settings are automatically executed remotely on the Edison board during the upload process, as described at the section Upload MCU Application .

For more information,

Customise the Serial Port

The serial port is used for the upload of the sketches and for the console.

By default, embedXcode uses the names of the serial port defined in the board configuration file and set the speed to 9600 for the serial console.

Both parameters can be changed.

Change the Upload Serial Port

Each platform has a different implementation of the USB port naming. Arduino uses the physical USB port of the Mac while each LaunchPad has a unique port name.

Now, two issues may appear:

  • Some USB hubs change the USB port names.

  • When Mac goes to sleep and then wakes up, USB ports are enumerated with an different name.

In either case, the following error message is displayed when trying to upload.

As a solution,

Open the main Makefile and uncomment the line BOARD_PORT by removing the leading #.

#BOARD_PORT = /dev/tty.usbmodem1* 
BOARD_PORT = /dev/tty.usbmodem1* 
  • Edit the line and either specify a more general name.
BOARD_PORT = /dev/tty.usbmodem*. 
  • Or enter the specific USB port name of the board.
BOARD_PORT = /dev/tty.usbmodem1403

To know the USB port name of the active board, proceed as follow:

  • Launch a Terminal window

  • Plug the board on the USB port.

  • Run the following command and note the name of the port.

$ ls /dev/tty.usb*
/dev/tty.usbmodem1403

Change the Serial Console Speed

By default, the speed of the serial console is 9600. To change the speed,

  • Open the main Makefile.

  • Uncomment the line SERIAL_BAUDRATE and set the desired speed.

# SERIAL_BAUDRATE for the serial console, 9600 by default
# Uncomment and specify another speed
#
SERIAL_BAUDRATE = 19200

Change the Optimisation Options

By default, the optimisation options are set to standard. To change them,

  • Open the main Makefile.

  • Uncomment the line OPTIMISATION and set the desired options.

# OPTIMISATION for the optimisation and debugger levels
# Uncomment and specify another options
#
OPTIMISATION    = -O0 -g3

Select among Two Arduino Connected Boards

This section requires embedXcode+.

In case two similar boards are connected, for example two Arduino boards, a windows lists the connections and ask to select one:

The first port is the default option.

  • To select the default port, press Enter, click on the button 1 or wait 10 seconds.

  • To select the second port, click on the button 2.

The following message is added to the Log navigator:

==== 2 ports available ====
1: /dev/tty.usbmodem1411
2: /dev/tty.usbmodem1421
==== /dev/tty.usbmodem1411 port selected ====

This feature works with the Arduino boards and the boards using a serial through USB connection.

It is not available for the LaunchPads, as they use a different management that combines different services under a single USB port.

Display the Report Navigator

The Report navigator provides information about the compilation and the size of the final binary file.

  • To display the Report navigator, call the menu View > Navigators > Show Report Navigator, or press Cmd+8 or click on the rightmost icon.

The Report navigator provides the detail of the whole process.



Once compilation is completed, the Report Navigator displays the total size of the sketch on the flash memory and an estimation of the RAM usage.

It also provides the elapsed time spent for building and linking.

---- Size ----
Binary sketch size:  880 bytes (of a 16384 byte maximum)
Estimated SRAM used: 22 bytes (of a 512 byte maximum)
Elapsed time: 0.3 s
==== Make done ====

embedXcode+ provides additional information with remaining free memory and percentages.

---- Size ----
Estimated Flash:  880 bytes used (5.3% of 16384 maximum), 15504 bytes free (94.7%)
Estimated SRAM:   22 bytes used (4.2% of 512 maximum), 490 bytes free (95.8%)
Elapsed time: 1.1 s
==== Make done ==== 

Display the Serial Console on a Terminal Window

If the target All or Fast is selected, once the sketch is built, linked and uploaded to the board, the Terminal application opens a serial console.

To launch the serial console in a Terminal window,

  • Select the target Serial.

  • Click on Run.

To close the serial connection,

  • Use the Ctrl+A Ctrl+K key sequence.

  • Then press Y to confirm.

Otherwise, the USB port is no longer listed. This is a bug on Mac OS X 10.11.4.

For the moment, the serial console isn't displayed on the debug pane in the main Xcode window.

On embedXcode+, an option allows not to open the serial console after the upload.