Observe the following restrictions when editing a user application project:

Programming language

Source file encoding

Using external editor

Project folder structure

Edit version name

Add source file

Include header file

Add library file

Use of inline assembler

Programming language

  • Write the program in C language.
  • The extension of the source file should be ".c" or ".h".
  • The int type is 32 bits.

Source file encoding

  • Encode the source file to UTF-8.

Using external editor

  • You can edit the source file with the e² studio editor, but you can also edit it with an external editor. In that case, the file encoding must be set to UTF-8.

Project folder structure

  • Create a user application project according to the procedure in "4.Create new Project". The folder structure of the project is as follows, but do not manually change this folder structure or the files in it unless instructed to do so.

          [Project folder]
            │  .ApplicationDebuglinker
            │  .cproject
            │  .info
            │  .project
            │  .Releaselinker
            │  custom.bat
            │  libSTARTUPOPH5000.a
            │  makefile.init
            │  rx_checksum.exe
            │  
            ├─.settings
            │  │  ...
            │  │  
            │  └─...
            │          
            ├─Release
            │  │  ...
            │  │  
            │  └─...
            │          
            └─src
                    app_version.c
                    lib.h
                    logapi.h
                    main.c
    

  • The project's Release folder contains the build output files. When you duplicate a project, the output file of the replication source remains in this Release folder. You can safely delete those old output files by deleting the Release folder and running the build again.

Edit version name

  • For the version name of the user application, edit the setting value of app_version[16] in app_version.c in the src folder of the project.

    Sample of app_version.c: app_version = "My App 1.0"
    //
    // Version settings
    //
    #define VERSION_SECT  __attribute__ (( section (".version")))
    VERSION_SECT const char app_version[16]="My App 1.0";
    
    

  • The version name specified in app_version.c is displayed in System menuSwitch application.

Add source file

  • When you add source files (.c, .h), add them to your project's src folder. Source files added to the src folder will be automatically compiled.
  • Do not add the ANSI-C library header file. The header files contained in the development environment are automatically searched.

Include header file

  • When you include the header file for the ANSI-C library, enclose the filename in < >.
  • When you include other header files, enclose the file name in double quotes.

Add library file

  • When adding a library file (.a), follow the steps below to modify the project.
    1. Copy the library file to the root folder of your project.

    2. Select the project in the [Project Explorer] view of e² studio and click [Properties] on the [Project] menu to display the [Properties] screen.

    3. Click [C/C++ Build] → [Settings] → [Tool Settings] → [Linker: Input] → [ button].


    4. When the [Add file path] dialogue appears, specify the library file in the following format in the [File] field and click [OK].

      "${workspace_loc:/${ProjName}/Library file name}"
      



    5. When the added library file is displayed in the list of [Additional input files], click button to move the libSTARTUPOPH5000.a line to the bottom of the list.


    6. Confirm that the line libSTARTUPOPH5000.a has moved to the bottom line, and click [OK] to close the [Properties] screen.

      Note:

      • libSTARTUPOPH5000.a should always be linked last to avoid errors due to the linking order when linking static libraries.
      • When you use a library that has dependencies on other libraries, link them in the order described in the manual for the library you are using.

Use of inline assembler

  • Do not use inline assembler.


Last updated: 2021/09/24