Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First, notice in the apps/examples/hello Kconfig file that the PROGNAME is only selected for the kernel build (CONFIG_BUILD_KERNEL). It is not defined or used in other build modes.

Code Block

    config EXAMPLES_HELLO_PROGNAME
        string "Program name"
        default "hello"
        depends on BUILD_KERNEL
      ---help--

...

Code Block
-
                This is the name of the program that will be use when the NSH ELF
                program is installed.

Kernel Build Mode

...

Code Block
    ifeq ($(CONFIG_BUILD_KERNEL),y)
    $(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ)
        @echo "LD: $(PROGNAME)"
        $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS)
        $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME)
  	install: $(BIN_DIR)$(DELIM)$(PROGNAME)

...

Code Block
    	else
    	install:
    	endif

Notice that the final linked programs are stored in INSTALL_DIR which will be apps/bin.

...

Code Block
    6a. General build directions (boot from SD card):
    
        $ tools/configure.sh sama5d4-ek:kernel : Establish this configuration
        $ export PATH=???                      : Set up the PATH variable
        $ make                                 : Build the kerne with a dummy ROMFS image
                                               : This should create the nuttx ELF
        $ make export                          : Create the kernel export package
                                               : You should have a file like
                                               : nuttx-export-*.zip
        $ cd apps/                             : Go to the apps/ directory
        $ tools/mkimport.sh -x <zip-file>      : Use the full path to nuttx-export-*.zip
        $ make import                          : This will build the file system.
    
      You will then need to copy the files from apps/bin to an SD card to
      create the the bootable SD card.

   6b. General build directions (boot from ROMFS image):

...

Code Block
    
        $ tools/configure.sh sama5d4-ek:kernel : Establish this configuration
        $ export PATH=???                      : Set up the PATH variable
        $ touch boards/arm/sama5/sama5d4-ek/include/boot_romfsimg.h
        $ make                                 : Build the kernel with a dummy ROMFS image
                                               : This should create the nuttx ELF
        $ make export                          : Create the kernel export package
                                               : You should have a file like
                                               : nuttx-export-*.zip
        $ cd apps/                             : Go to the apps/ directory
        $ tools/mkimport.sh -x <zip-file>      : Use the full path to nuttx-export-*.zip
        $ make import                          : This will build the file system
        $ tools/mkromfsimg.sh                  : Create the real ROMFS image
        $ mv boot_romfsimg.h ../nuttx/boards/arm/sama5/sama5d4-ek/include/boot_romfsimg.h
        $ cd nuttx/                            : Rebuild the system with the correct
        $ make clean_context all               : ROMFS file system

...