Fixed some tasks regarding priority and stack
Updated makefile structure to support multi build git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@362 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -5,11 +5,13 @@ AR = $(CROSS_COMPILE)ar
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
OBJDUMP = $(CROSS_COMPILE)objdump
|
||||
|
||||
OBJDIR = obj
|
||||
OBJDIR_PREFIX = obj
|
||||
OBJDIR = $(OBJDIR_PREFIX)_$(BUILD)_$(LANG)
|
||||
SRCDIR = src/
|
||||
ROOTDIR = ../
|
||||
|
||||
LIBRARY_NAME = libHAL.a
|
||||
LIB_PREFIX = libHAL
|
||||
LIBRARY_NAME = $(LIB_PREFIX)_$(BUILD)_$(LANG).a
|
||||
|
||||
CCFLAGS = -c -O2 -Wall -Werror -g -fno-common -mcpu=cortex-m3 -mthumb $(PLATFORM) $(RELEASE_DEFINES) $(ADDITIONAL_SWITCHES) \
|
||||
-Iinc \
|
||||
@@ -63,6 +65,6 @@ $(OBJDIR):
|
||||
mkdir -p $@
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR) $(LIBRARY_NAME)
|
||||
rm -rf $(OBJDIR_PREFIX)* $(LIB_PREFIX)*
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Define release version for firmware here
|
||||
RELEASE_PRODUCT = \""S0\""
|
||||
RELEASE_PRODUCT = S0
|
||||
RELEASE_MAJOR = 0
|
||||
RELEASE_MINOR = 9
|
||||
RELEASE_BRANCH = 0
|
||||
@@ -19,20 +19,22 @@ export RELEASE_DEFINES = \
|
||||
-DRELEASE_BRANCH=$(RELEASE_BRANCH) \
|
||||
-DRELEASE_PATCH=$(RELEASE_PATCH) \
|
||||
|
||||
|
||||
BINARY = hsb_mrts_$(PLATFORM_OLIMEX_STM32_H107).bin
|
||||
|
||||
# BUILD = undefined_target
|
||||
|
||||
all: release
|
||||
|
||||
release: export BUILD = release
|
||||
release:
|
||||
$(MAKE) pho_hsb_olimex_stm32_h107
|
||||
|
||||
debug: export ADDITIONAL_SWITCHES = -DENABLE_SERIAL_LOGGING -DENABLE_HW_VALIDATION
|
||||
debug: export BUILD = debug
|
||||
debug:
|
||||
$(MAKE) pho_hsb_olimex_stm32_h107
|
||||
|
||||
pho_hsb_olimex_stm32_h107: export PLATFORM = -D$(PLATFORM_OLIMEX_STM32_H107)
|
||||
pho_hsb_olimex_stm32_h107: export FILENAME = $(RELEASE_PRODUCT)_$(RELEASE_MAJOR)_$(RELEASE_MINOR)_$(RELEASE_BRANCH)_$(RELEASE_PATCH)_HSB_MRTS_$(PLATFORM_OLIMEX_STM32_H107)_$(LANG)_$(BUILD)
|
||||
pho_hsb_olimex_stm32_h107:
|
||||
@echo ------------------------------------------
|
||||
@echo MAKE: $@
|
||||
|
||||
@@ -5,11 +5,13 @@ AR = $(CROSS_COMPILE)ar
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
OBJDUMP = $(CROSS_COMPILE)objdump
|
||||
|
||||
OBJDIR = obj
|
||||
OBJDIR_PREFIX = obj
|
||||
OBJDIR = $(OBJDIR_PREFIX)_$(BUILD)_$(LANG)
|
||||
SRCDIR = src/
|
||||
ROOTDIR = ../
|
||||
|
||||
LIBRARY_NAME = libPlatform.a
|
||||
LIB_PREFIX = libPlatform
|
||||
LIBRARY_NAME = $(LIB_PREFIX)_$(BUILD)_$(LANG).a
|
||||
|
||||
CCFLAGS = -c -O2 -Wall -Werror -g -fno-common -mcpu=cortex-m3 -mthumb $(PLATFORM) $(RELEASE_DEFINES) \
|
||||
-Iinc \
|
||||
@@ -55,6 +57,6 @@ $(OBJDIR):
|
||||
mkdir -p $@
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR) $(LIBRARY_NAME)
|
||||
rm -rf $(OBJDIR_PREFIX)* $(LIB_PREFIX)*
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
@@ -11,8 +11,8 @@ INCLUDE_DIRS = \
|
||||
-I$(CORE_DIR) \
|
||||
-I$(STM32_STDPERIPH_INC) \
|
||||
|
||||
|
||||
OBJ_DIR = Libraries/STM32F10x_StdPeriph_Driver/obj
|
||||
OBJDIR_PREFIX = Libraries/STM32F10x_StdPeriph_Driver/obj
|
||||
OBJDIR = $(OBJDIR_PREFIX)_$(BUILD)_$(LANG)
|
||||
|
||||
CROSS_COMPILE = arm-none-eabi-
|
||||
|
||||
@@ -47,23 +47,24 @@ stm32f10x_tim.o \
|
||||
stm32f10x_usart.o \
|
||||
stm32f10x_wwdg.o
|
||||
|
||||
LIBRARY = libSTM_StdPeriph.a
|
||||
LIB_PREFIX = libSTM_StdPeriph
|
||||
LIBRARY = $(LIB_PREFIX)_$(BUILD)_$(LANG).a
|
||||
|
||||
vpath %.c $(SRC_DIR)
|
||||
vpath %.o $(OBJ_DIR)
|
||||
vpath %.o $(OBJDIR)
|
||||
|
||||
all: $(LIBRARY)
|
||||
|
||||
$(LIBRARY): $(OBJ_DIR) $(OBJECTS) | $(OBJ_DIR)
|
||||
$(AR) $(ARFLAGS) $@ $(addprefix $(OBJ_DIR)/, $(OBJECTS))
|
||||
$(LIBRARY): $(OBJDIR) $(OBJECTS) | $(OBJDIR)
|
||||
$(AR) $(ARFLAGS) $@ $(addprefix $(OBJDIR)/, $(OBJECTS))
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CCFLAGS) $< -o $(OBJ_DIR)/$@
|
||||
$(CC) $(CCFLAGS) $< -o $(OBJDIR)/$@
|
||||
|
||||
clean:
|
||||
rm -rf $(LIBRARY) $(OBJ_DIR)
|
||||
rm -rf $(OBJDIR_PREFIX)* $(LIB_PREFIX)*
|
||||
|
||||
$(OBJ_DIR):
|
||||
$(OBJDIR):
|
||||
mkdir -p $@
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
- Display backlight unstable
|
||||
- Display cursor unstable
|
||||
- repairMenu has bad reference to getmainrepairmenu
|
||||
- Makefile extention to have output file name corresponding to langugage and build targets
|
||||
- Display misses first character (row1/column1) when starting. Should be a delay problem in creating the start screen. (between putting cursor home and write action)
|
||||
|
||||
|
||||
|
||||
|
||||
FIXED
|
||||
0.9.0.5
|
||||
- Display misses first character (row1/column1) when starting. Should be a delay problem in creating the start screen. (between putting cursor home and write action)
|
||||
- Makefile extention to have output file name corresponding to langugage and build targets
|
||||
|
||||
0.9.0.4
|
||||
- PIN change verification not functional
|
||||
- Multi-Language support added to menu. All strings/messages outsourced to dedicated file. MakeFile adapted
|
||||
|
||||
@@ -70,30 +70,31 @@ INCLUDES = \
|
||||
-I$(HAL_DIR)/inc \
|
||||
-I$(PLATFORM_DIR)/inc \
|
||||
|
||||
OBJDIR_PREFIX = obj
|
||||
|
||||
all: OLI_STM32_H107
|
||||
|
||||
OLI_STM32_H107: export OBJ_DIR := obj_release/
|
||||
OLI_STM32_H107: export OBJ_DIR := $(OBJDIR_PREFIX)_$(BUILD)_$(LANG)/
|
||||
OLI_STM32_H107: export OBJECTS := $(OBJECTS_GEN)
|
||||
OLI_STM32_H107: export OBJECTS_MAIN := $(OBJECTS_MAIN)
|
||||
OLI_STM32_H107: export CROSS_COMPILE := arm-none-eabi-
|
||||
OLI_STM32_H107: export CCFLAGS := -c -O2 -Wall -Werror -g -lc -lm -fno-common -mcpu=cortex-m3 -mthumb $(PLATFORM) $(RELEASE_DEFINES) $(LANGUAGE) $(INCLUDES) $(ADDITIONAL_SWITCHES)
|
||||
OLI_STM32_H107: export ASFLAGS := -g -mapcs-32
|
||||
OLI_STM32_H107: export LDFLAGS := -g -nostartfiles -mcpu=cortex-m3 -mthumb -T$(LINKER_SCRIPTS_DIR)/$(LINKER_SCRIPT) -Wl,-Map=hsb_mrts_OLI_STM32_H107.map
|
||||
OLI_STM32_H107: export LDARCHIVES := -L. -L$(STM32_STDPERIPH_ROOT) -L$(PLATFORM_DIR) -L$(HAL_DIR) -lhsb_mrts_OLI_STM32_H107 -lPlatform -lHAL -lSTM_StdPeriph
|
||||
OLI_STM32_H107: export LDFLAGS := -g -nostartfiles -mcpu=cortex-m3 -mthumb -T$(LINKER_SCRIPTS_DIR)/$(LINKER_SCRIPT) -Wl,-Map=$(FILENAME).map
|
||||
OLI_STM32_H107: export LDARCHIVES := -L. -L$(STM32_STDPERIPH_ROOT) -L$(PLATFORM_DIR) -L$(HAL_DIR) -l$(FILENAME) -lPlatform_$(BUILD)_$(LANG) -lHAL_$(BUILD)_$(LANG) -lSTM_StdPeriph_$(BUILD)_$(LANG)
|
||||
OLI_STM32_H107: export ARFLAGS := ru
|
||||
OLI_STM32_H107: export OBJCOPYFLAGS := -O binary
|
||||
OLI_STM32_H107: export OBJDUMPFLAGS := -x --syms -S
|
||||
OLI_STM32_H107: export EXECUTABLE := hsb_mrts_OLI_STM32_H107.out
|
||||
OLI_STM32_H107: export BINFILE := hsb_mrts_OLI_STM32_H107.bin
|
||||
OLI_STM32_H107: export LIBRARY := libhsb_mrts_OLI_STM32_H107.a
|
||||
OLI_STM32_H107: export LISTFILE := hsb_mrts_OLI_STM32_H107.list
|
||||
OLI_STM32_H107: export EXECUTABLE := $(FILENAME).out
|
||||
OLI_STM32_H107: export BINFILE := $(FILENAME).bin
|
||||
OLI_STM32_H107: export LIBRARY := lib$(FILENAME).a
|
||||
OLI_STM32_H107: export LISTFILE := $(FILENAME).list
|
||||
OLI_STM32_H107: ;@$(MAKE)
|
||||
|
||||
|
||||
clean:
|
||||
rm -f hsb_mrts_OLI_STM32_H107.out hsb_mrts_OLI_STM32_H107.map hsb_mrts_OLI_STM32_H107.bin hsb_mrts_OLI_STM32_H107.list hsb_mrts_OLI_STM32_H107.map libhsb_mrts_OLI_STM32_H107.a
|
||||
rm -rf obj_release
|
||||
rm -f *.out *.map *.bin *.list *.a ../*.bin
|
||||
rm -rf $(OBJDIR_PREFIX)*
|
||||
|
||||
flash:
|
||||
st-flash write hsdb_mrts_OLI_STM32_H107.bin 0x8000000
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configIDLE_SHOULD_YIELD 1
|
||||
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
#define configGENERATE_RUN_TIME_STATS 1
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
||||
|
||||
@@ -55,6 +55,8 @@ typedef enum
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
///TODO TEMPORARY
|
||||
extern TaskHandle_t warningTaskHandle;
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* Warning_construct
|
||||
|
||||
@@ -71,7 +71,15 @@ void OS_logTaskInfo(xTaskHandle taskHandle)
|
||||
LOGGER_INFO(mainLog, text);
|
||||
|
||||
highWaterMark = uxTaskGetStackHighWaterMark(taskHandle);
|
||||
snprintf(text, sizeof(text), "***** Stack high water mark : %lu long words", highWaterMark);
|
||||
snprintf(text, sizeof(text), " Stack high water mark : %lu long words", highWaterMark);
|
||||
LOGGER_INFO(mainLog, text);
|
||||
|
||||
TaskStatus_t taskStatus;
|
||||
vTaskGetInfo(taskHandle, &taskStatus, pdFALSE, eRunning);
|
||||
snprintf(text, sizeof(text), " Number: %d \t Priority: %d \t BasePriority: %d \t runtime: %d\n", (int)taskStatus.xTaskNumber,
|
||||
(int)taskStatus.uxCurrentPriority,
|
||||
(int)taskStatus.uxBasePriority,
|
||||
(int)taskStatus.ulRunTimeCounter);
|
||||
LOGGER_INFO(mainLog, text);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,8 @@ struct WarningQueueItem
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static struct Observable observable;
|
||||
static TaskHandle_t warningTaskHandle;
|
||||
///TODO TEMPORARY
|
||||
TaskHandle_t warningTaskHandle;
|
||||
static QueueHandle_t warningQueue;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -70,7 +71,7 @@ ErrorStatus Warning_construct(void)
|
||||
Observable_construct(&observable);
|
||||
|
||||
warningQueue = xQueueCreate(WARNING_QUEUE_SIZE, sizeof(struct WarningQueueItem));
|
||||
xTaskCreate(WarningTask, "ErrorTask", 300, NULL, 1, &warningTaskHandle);
|
||||
xTaskCreate(WarningTask, "WarningTask", 300, NULL, 1, &warningTaskHandle);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -118,29 +118,29 @@ ErrorStatus hsb_enableSafetyWithError(void)
|
||||
CoverSolenoid_lock();
|
||||
}
|
||||
|
||||
// if (returnValue == SUCCESS)
|
||||
// {
|
||||
// // Check for INTERLOCK CLOSE
|
||||
// if (Interlock_isClosed(interlock))
|
||||
// {
|
||||
// // Enable Interrupt for interlock switch
|
||||
// Interlock_setEXTI(interlock, ENABLE);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Error_postError(INTERLOCK_COMMON_FAIL);
|
||||
// returnValue = ERROR;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (returnValue == SUCCESS)
|
||||
// {
|
||||
// // In case of a TESLA repair, release the teslaGunSafety
|
||||
// if (PCBA_getInstance()->pcba == PCBA_Tesla)
|
||||
// {
|
||||
// TeslaGunSafety_release();
|
||||
// }
|
||||
// }
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
// Check for INTERLOCK CLOSE
|
||||
if (Interlock_isClosed(interlock))
|
||||
{
|
||||
// Enable Interrupt for interlock switch
|
||||
Interlock_setEXTI(interlock, ENABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
Error_postError(INTERLOCK_COMMON_FAIL);
|
||||
returnValue = ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
// In case of a TESLA repair, release the teslaGunSafety
|
||||
if (PCBA_getInstance()->pcba == PCBA_Tesla)
|
||||
{
|
||||
TeslaGunSafety_release();
|
||||
}
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
@@ -164,29 +164,29 @@ ErrorStatus hsb_enableSafetyWithWarning(void)
|
||||
CoverSolenoid_lock();
|
||||
}
|
||||
|
||||
// if (returnValue == SUCCESS)
|
||||
// {
|
||||
// // Check for INTERLOCK CLOSE
|
||||
// if (Interlock_isClosed(interlock))
|
||||
// {
|
||||
// // Enable Interrupt for interlock switch
|
||||
// Interlock_setEXTI(interlock, ENABLE);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Warning_postWarning(WARNING_INTERLOCK_COMMON_FAIL);
|
||||
// returnValue = ERROR;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (returnValue == SUCCESS)
|
||||
// {
|
||||
// // In case of a TESLA repair, release the teslaGunSafety
|
||||
// if (PCBA_getInstance()->pcba == PCBA_Tesla)
|
||||
// {
|
||||
// TeslaGunSafety_release();
|
||||
// }
|
||||
// }
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
// Check for INTERLOCK CLOSE
|
||||
if (Interlock_isClosed(interlock))
|
||||
{
|
||||
// Enable Interrupt for interlock switch
|
||||
Interlock_setEXTI(interlock, ENABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning_postWarning(WARNING_INTERLOCK_COMMON_FAIL);
|
||||
returnValue = ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
// In case of a TESLA repair, release the teslaGunSafety
|
||||
if (PCBA_getInstance()->pcba == PCBA_Tesla)
|
||||
{
|
||||
TeslaGunSafety_release();
|
||||
}
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
|
||||
@@ -104,6 +104,7 @@ struct HwValidationMenu* hwValidation = &_hwValidation;
|
||||
static struct CachedStorage cs = {.initialized = false};
|
||||
static struct CachedStorage deviceParameters = {.initialized = false};
|
||||
|
||||
//static char taskList[600];
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -166,22 +167,44 @@ static ErrorStatus systeminfoCommandHandler(void)
|
||||
snprintf(text, sizeof(text), "Free heap memory: %d bytes", (int)freeMemory);
|
||||
LOGGER_INFO(mainLog, text);
|
||||
|
||||
vTaskDelay(10);
|
||||
UBaseType_t numberOfTasks;
|
||||
numberOfTasks = uxTaskGetNumberOfTasks();
|
||||
snprintf(text, sizeof(text), "Number of managed tasks: %d", (int)numberOfTasks);
|
||||
LOGGER_INFO(mainLog, text);
|
||||
|
||||
// vTaskList(taskList);
|
||||
// IODevice_write((struct IODevice*)uart1, taskList, 600);
|
||||
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(initTaskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(ledTaskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(sysTaskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(mainMenu->menuCore->taskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(rp->taskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(mainDisplay->taskHandle);
|
||||
vTaskDelay(10);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(errorTaskHandle);
|
||||
vTaskDelay(10);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(warningTaskHandle);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(interlock->taskHandle);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(mainLog->taskHandle);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(keypad->taskHandle);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(mainBuzzer->taskHandle);
|
||||
vTaskDelay(100);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(mainDisplay->taskHandle);
|
||||
#ifdef ENABLE_HW_VALIDATION
|
||||
OS_logTaskInfo(hwValidation->taskHandle);
|
||||
#endif
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(sysTaskHandle);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(ledTaskHandle);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(mainMenu->menuCore->taskHandle);
|
||||
vTaskDelay(100);
|
||||
OS_logTaskInfo(rp->taskHandle);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -277,15 +300,15 @@ static void initTask(void* parameters)
|
||||
hwTestItems.pcba = PCBA_getInstance();
|
||||
hwTestItems.keypad = keypad;
|
||||
// EEPROM TO BE DONE
|
||||
HwValidationMenu_construct(hwValidation, &uart3->device, &hwTestItems, 1, 1024);
|
||||
HwValidationMenu_construct(hwValidation, &uart3->device, &hwTestItems, 3, 1024);
|
||||
}
|
||||
#endif
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
// Create task that repeats to print out TASK information on the logger
|
||||
xTaskCreate(printSystemInfoTask, (const char* const)"SysInfoTask", 512, NULL, 0, &sysTaskHandle);
|
||||
xTaskCreate(printSystemInfoTask, (const char* const)"SysInfoTask", 512, NULL, 4, &sysTaskHandle);
|
||||
// Create a small task that only blinks a LED and flashes the identification letter on the display
|
||||
xTaskCreate(ledBlinkTask, (const char* const)"ledTask", 100, &ledTaskArguments, 0, &ledTaskHandle);
|
||||
xTaskCreate(ledBlinkTask, (const char* const)"ledTask", 100, &ledTaskArguments, 4, &ledTaskHandle);
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "MenuText.h"
|
||||
|
||||
#include "CoverSolenoid.h"
|
||||
#include "Leds.h"
|
||||
#include "Logger.h"
|
||||
#include "Interlock.h"
|
||||
#include "internalADC.h"
|
||||
|
||||
Reference in New Issue
Block a user