Difference between revisions of "Create project directory structure version 1"

From Wiki at Neela Nurseries
Jump to: navigation, search
m
m
Line 2: Line 2:
 
[[ARM_processor|ARM processor notes]]  :  [[stm32f100_notes|STM32F10x notes]]  :  [[LPCXpresso|LPCXpresso 1114]]  :  [[Heap-1-dot-c|heap_1.c build recipe]]  :  [[lpc_makefiles_full_mapping|LPCXpresso makefiles mapping]]
 
[[ARM_processor|ARM processor notes]]  :  [[stm32f100_notes|STM32F10x notes]]  :  [[LPCXpresso|LPCXpresso 1114]]  :  [[Heap-1-dot-c|heap_1.c build recipe]]  :  [[lpc_makefiles_full_mapping|LPCXpresso makefiles mapping]]
  
 +
 +
 +
== Overview ==
 +
 +
This article contains a few versions of a directory and file copying shell script, adapted from the FreeRTOS demo port project to LPCXpresso and the LPC1114 processor.  The first version of this script worked for the initial project copying experiments, but quickly broke on second try due to hard-coded paths.  Version two implements some variables which are still hard-coded in their assignment, but make for one point at which to adjust the source paths of the downloaded demo.  This article likely to remain small and narrow in scope, part of the larger effort to learn LPCXpresso's toolchain and way of building projects, and how to move between GNU GCC `make` based projects and LPC based projects.
 +
 +
 +
<!-- comment -->
 +
 +
=== [[#top|^]] Version 1 ===
  
 
<span id="script_version_1"></span>
 
<span id="script_version_1"></span>
Line 69: Line 79:
 
</pre>
 
</pre>
  
 +
 +
<!-- comment -->
 +
 +
=== [[#top|^]] Version 2 ===
 +
 +
Version 2 of this script adds a couple variables to make source file paths more easy to adjust:
  
 
<span id="script_version_2"></span>
 
<span id="script_version_2"></span>
Line 167: Line 183:
 
<!-- comment -->
 
<!-- comment -->
  
 +
=== [[#top|^]] Version 3 ===
  
 +
Version 3 not yet posted, but includes some improved messages including an early project identifier, to name to what the directory and file copying is related . . .
  
 +
 +
 +
<!-- comment -->
  
 
<center>
 
<center>

Revision as of 17:46, 17 July 2018

ARM processor notes  :  STM32F10x notes  :  LPCXpresso 1114  :  heap_1.c build recipe  :  LPCXpresso makefiles mapping


Overview

This article contains a few versions of a directory and file copying shell script, adapted from the FreeRTOS demo port project to LPCXpresso and the LPC1114 processor. The first version of this script worked for the initial project copying experiments, but quickly broke on second try due to hard-coded paths. Version two implements some variables which are still hard-coded in their assignment, but make for one point at which to adjust the source paths of the downloaded demo. This article likely to remain small and narrow in scope, part of the larger effort to learn LPCXpresso's toolchain and way of building projects, and how to move between GNU GCC `make` based projects and LPC based projects.


^ Version 1

Figure 1 - create-project-directory-structure.sh

#!/bin/bash

# 2018-05-14 - Monday, started by Ted to carry out the work of DOS batch file included with NXP's RTOS demo . . .

MKDIR=/bin/mkdir
MKDIR_OPTIONS="-p -v"
COPY=/bin/cp
COPY_OPTIONS="-v"


echo "$0:  creating the required directory structure . . ."
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/include
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/portable
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/portable/GCC
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/portable/GCC/ARM_CM0
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/portable/MemMang
${MKDIR} ${MKDIR_OPTIONS} Source/Common_Demo_Tasks
${MKDIR} ${MKDIR_OPTIONS} Source/Common_Demo_Tasks/Include


echo "$0:  copying core FreeRTOS kernel files . . ."
${COPY} ${COPY_OPTIONS} ../../../Source/tasks.c Source/FreeRTOS_Source
${COPY} ${COPY_OPTIONS} ../../../Source/queue.c Source/FreeRTOS_Source
${COPY} ${COPY_OPTIONS} ../../../Source/list.c Source/FreeRTOS_Source
${COPY} ${COPY_OPTIONS} ../../../Source/timers.c Source/FreeRTOS_Source


echo "$0:  copying common header files . . ."
${COPY} ${COPY_OPTIONS} ../../../Source/include/*.* Source/FreeRTOS_Source/include

echo "$0:  copying portable layer files . . ."
${COPY} ${COPY_OPTIONS} ../../../Source/portable/GCC/ARM_CM0/*.* Source/FreeRTOS_Source/portable/GCC/ARM_CM0

echo "$0:  copying basic memory allocation files . . ."
${COPY} ${COPY_OPTIONS} ../../../Source/portable/MemMang/heap_1.c Source/FreeRTOS_Source/portable/MemMang


echo "$0:  copying files that define the common demo tasks . . ."
${COPY} ${COPY_OPTIONS} ../../Common/Minimal/blocktim.c Source/Common_Demo_Tasks
${COPY} ${COPY_OPTIONS} ../../Common/Minimal/recmutex.c Source/Common_Demo_Tasks
${COPY} ${COPY_OPTIONS} ../../Common/Minimal/countsem.c Source/Common_Demo_Tasks
${COPY} ${COPY_OPTIONS} ../../Common/Minimal/IntQueue.c Source/Common_Demo_Tasks


echo "$0:  copying common demo file headers . . .":
${COPY} ${COPY_OPTIONS} ../../Common/include/blocktim.h Source/Common_Demo_Tasks/include
${COPY} ${COPY_OPTIONS} ../../Common/include/recmutex.h Source/Common_Demo_Tasks/include
${COPY} ${COPY_OPTIONS} ../../Common/include/countsem.h Source/Common_Demo_Tasks/include
${COPY} ${COPY_OPTIONS} ../../Common/include/IntQueue.h Source/Common_Demo_Tasks/include



# ${MKDIR} ${MKDIR_OPTIONS}

echo "$0:  done."
echo


exit 0


^ Version 2

Version 2 of this script adds a couple variables to make source file paths more easy to adjust:

Figure 2 - create-project-directory-structure.sh

#!/bin/bash

# 2018-05-14 - Monday, started by Ted to carry out the work of DOS batch file included with NXP's RTOS demo . . .

MKDIR=/bin/mkdir
MKDIR_OPTIONS="-p -v"
COPY=/bin/cp
COPY_OPTIONS="-v"


// 2018-06-26 - Adding path elements that can change: 
PATH_TO_FREERTOS_SOURCE=${HOME}/Downloads/freertos/FreeRTOSv10.0.1/FreeRTOS
# PATH_TO_FREERTOS_COMMON_MINIMAL=${HOME}/Downloads/freertos/FreeRTOSv10.0.1/FreeRTOS/Demo/Common/Minimal
PATH_TO_FREERTOS_COMMON_MINIMAL=${PATH_TO_FREERTOS_SOURCE}/Demo/Common/Minimal
PATH_TO_FREERTOS_COMMON_INCLUDE=${PATH_TO_FREERTOS_SOURCE}/Demo/Common/include




echo "$0:  creating the required directory structure . . ."
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/include
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/portable
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/portable/GCC
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/portable/GCC/ARM_CM0
${MKDIR} ${MKDIR_OPTIONS} Source/FreeRTOS_Source/portable/MemMang
${MKDIR} ${MKDIR_OPTIONS} Source/Common_Demo_Tasks
${MKDIR} ${MKDIR_OPTIONS} Source/Common_Demo_Tasks/Include


echo "$0:  copying core FreeRTOS kernel files . . ."
# ${COPY} ${COPY_OPTIONS} ../../../Source/tasks.c Source/FreeRTOS_Source
# ${COPY} ${COPY_OPTIONS} ../../../Source/queue.c Source/FreeRTOS_Source
# ${COPY} ${COPY_OPTIONS} ../../../Source/list.c Source/FreeRTOS_Source
# ${COPY} ${COPY_OPTIONS} ../../../Source/timers.c Source/FreeRTOS_Source

${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_SOURCE}/Source/tasks.c Source/FreeRTOS_Source
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_SOURCE}/Source/queue.c Source/FreeRTOS_Source
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_SOURCE}/Source/list.c Source/FreeRTOS_Source
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_SOURCE}/Source/timers.c Source/FreeRTOS_Source


echo "$0:  copying common header files . . ."
echo "$0:  copying common header files . . ."
# ${COPY} ${COPY_OPTIONS} ../../../Source/include/*.* Source/FreeRTOS_Source/include
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_SOURCE}/Source/include/*.* Source/FreeRTOS_Source/include

echo "$0:  copying portable layer files . . ."
# ${COPY} ${COPY_OPTIONS} ../../../Source/portable/GCC/ARM_CM0/*.* Source/FreeRTOS_Source/portable/GCC/ARM_CM0
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_SOURCE}/Source/portable/GCC/ARM_CM0/*.* Source/FreeRTOS_Source/portable/GCC/ARM_CM0

echo "$0:  copying basic memory allocation files . . ."
# ${COPY} ${COPY_OPTIONS} ../../../Source/portable/MemMang/heap_1.c Source/FreeRTOS_Source/portable/MemMang
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_SOURCE}/Source/portable/MemMang/heap_1.c Source/FreeRTOS_Source/portable/MemMang


echo "$0:  copying files that define the common demo tasks . . ."
# ${COPY} ${COPY_OPTIONS} ../../Common/Minimal/blocktim.c Source/Common_Demo_Tasks
# ${COPY} ${COPY_OPTIONS} ../../Common/Minimal/recmutex.c Source/Common_Demo_Tasks
# ${COPY} ${COPY_OPTIONS} ../../Common/Minimal/countsem.c Source/Common_Demo_Tasks
# ${COPY} ${COPY_OPTIONS} ../../Common/Minimal/IntQueue.c Source/Common_Demo_Tasks

${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_COMMON_MINIMAL}/blocktim.c Source/Common_Demo_Tasks
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_COMMON_MINIMAL}/recmutex.c Source/Common_Demo_Tasks
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_COMMON_MINIMAL}/countsem.c Source/Common_Demo_Tasks
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_COMMON_MINIMAL}/IntQueue.c Source/Common_Demo_Tasks


echo "$0:  copying common demo file headers . . .":
# ${COPY} ${COPY_OPTIONS} ../../Common/include/blocktim.h Source/Common_Demo_Tasks/include
# ${COPY} ${COPY_OPTIONS} ../../Common/include/recmutex.h Source/Common_Demo_Tasks/include
# ${COPY} ${COPY_OPTIONS} ../../Common/include/countsem.h Source/Common_Demo_Tasks/include
# ${COPY} ${COPY_OPTIONS} ../../Common/include/IntQueue.h Source/Common_Demo_Tasks/include

${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_COMMON_INCLUDE}/blocktim.h Source/Common_Demo_Tasks/include
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_COMMON_INCLUDE}/recmutex.h Source/Common_Demo_Tasks/include
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_COMMON_INCLUDE}/countsem.h Source/Common_Demo_Tasks/include
${COPY} ${COPY_OPTIONS} ${PATH_TO_FREERTOS_COMMON_INCLUDE}/IntQueue.h Source/Common_Demo_Tasks/include



# ${MKDIR} ${MKDIR_OPTIONS}

echo "$0:  done."
echo


exit 0


^ Version 3

Version 3 not yet posted, but includes some improved messages including an early project identifier, to name to what the directory and file copying is related . . .



- - - top of page - - -