Skip to content

Commit

Permalink
Add launch confirgurations + build first release binary
Browse files Browse the repository at this point in the history
  • Loading branch information
MckennaCisler committed Mar 17, 2018
1 parent f81d8c4 commit 3ac332e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 35 deletions.
8 changes: 3 additions & 5 deletions EQUiSatOS/EQUiSatOS/EQUiSatOs.cproj
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@
<ListValues>
<Value>NDEBUG</Value>
<Value>TEST_SUITE_DEFINE_ASSERT_MACRO</Value>
<Value>_ASSERT_ENABLE_</Value>
<Value>SYSTICK_MODE</Value>
<Value>I2C_MASTER_CALLBACK_MODE=false</Value>
<Value>USART_CALLBACK_MODE=false</Value>
Expand Down Expand Up @@ -475,10 +474,9 @@
</ListValues>
</armgcc.compiler.directories.IncludePaths>
<armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
<armgcc.compiler.optimization.OtherFlags>-fdata-sections</armgcc.compiler.optimization.OtherFlags>
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
<armgcc.compiler.optimization.EnableFastMath>True</armgcc.compiler.optimization.EnableFastMath>
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
<armgcc.compiler.miscellaneous.OtherFlags>-pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500</armgcc.compiler.miscellaneous.OtherFlags>
<armgcc.compiler.miscellaneous.OtherFlags>-pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500</armgcc.compiler.miscellaneous.OtherFlags>
<armgcc.linker.general.UseNewlibNano>True</armgcc.linker.general.UseNewlibNano>
<armgcc.linker.libraries.Libraries>
<ListValues>
Expand All @@ -492,6 +490,7 @@
</ListValues>
</armgcc.linker.libraries.LibrarySearchPaths>
<armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
<armgcc.linker.memorysettings.ExternalRAM />
<armgcc.linker.miscellaneous.LinkerFlags>-Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd21/gcc/samd21j18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
<armgcc.assembler.general.IncludePaths>
<ListValues>
Expand Down Expand Up @@ -663,7 +662,6 @@
<Value>../src/ASF/thirdparty/TraceRecorder/streamports/Jlink_RTT/include</Value>
</ListValues>
</armgcc.compiler.directories.IncludePaths>
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
<armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
<armgcc.compiler.miscellaneous.OtherFlags>-pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500</armgcc.compiler.miscellaneous.OtherFlags>
<armgcc.linker.general.UseNewlibNano>True</armgcc.linker.general.UseNewlibNano>
Expand Down
32 changes: 16 additions & 16 deletions EQUiSatOS/EQUiSatOS/src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* MAKE SURE to RE-BUILD solution to be double-sure they were disabled
*/
#define FLASH_ACTIVE // enable flashing
//#define ANTENNA_DEPLOY_ACTIVE // enable antenna deployment
#define ANTENNA_DEPLOY_ACTIVE // enable antenna deployment
#define TRANSMIT_ACTIVE // enable radio transmission (note PRINT_DEBUG must be 0)
#define BAT_CHARGING_ACTIVE // enable battery charging logic ACTUALLY changing battery actions
#define WATCHDOG_RESET_ACTIVE // enable watchdog actually rebooting satellite
Expand All @@ -31,48 +31,48 @@
// ***AT THE EXPENSE OF COMPLETELY NORMAL FUNCTIONALITY***
// ENUMERATION of changes when ON:
// - don't read data distributed around an orbit
#define TESTING_SPEEDUP
#define TESTING_SPEEDUP_LONG_OPS
//#define TESTING_SPEEDUP
//#define TESTING_SPEEDUP_LONG_OPS

// reduces the stack size of some tasks to a workable but risky level
//#define RISKY_STACK_SIZES

// use this flag to disable reed-solomon tables (frees up memory)
//#define USE_REED_SOLOMON
#define USE_REED_SOLOMON

// if defined, explicitly sets the initial SAT state (must set both)
#define OVERRIDE_INIT_SAT_STATE INITIAL
#define OVERRIDE_INIT_TASK_STATES INITIAL_TASK_STATES
//#define OVERRIDE_INIT_SAT_STATE INITIAL
//#define OVERRIDE_INIT_TASK_STATES INITIAL_TASK_STATES
// WDOG, STATE, (ant), BAT, TRANS, FLASH, IDLE, LOWP, ATTI, PERSIST
//#define OVERRIDE_INIT_TASK_STATES ((task_states){{true, true, false, true, false, false, false, false, true, true}})
#define OVERRIDE_STATE_HOLD_INIT 0 // whether to hold initial state (stop auto state changes)

// whether to start up misc. testing tasks (doing both at same time will likely run out of mem)
//#define ONLY_RUN_TESTING_TASKS // doesn't run normal EQUISAT tasks
#define RUN_RTOS_SYSTEM_TEST // ~800 bytes of memory
//#define RUN_RTOS_SYSTEM_TEST // ~800 bytes of memory
// less data
//#define RTOS_SYSTEM_TEST_SUMMARY
// whether to print all data every test or only one element per stack (with exception of error stack)
//#define RTOS_SYSTEM_TEST_ONLY_RECENT
#define SYSTEM_TEST_TASK_FREQ (43*1000) // ms
//#define SYSTEM_TEST_TASK_FREQ (43*1000) // ms
//#define RUN_TESTING_TASK // ~1024 bytes of memory
//#define RUN_TASK_STACK_TESTS

// whether to rewrite MRAM with "zero" values (done before launch)
#define WRITE_DEFAULT_MRAM_VALS
//#define WRITE_DEFAULT_MRAM_VALS

/** System Tests/Simulations **/
//#define EQUISIM_SIMULATE_BATTERIES // see config in equisim_simulated_data.h
#define EQUISIM_SIMULATE_DIRECT_STATE_CHANGES // must disable OVERRIDE_STATE_HOLD_INIT!
#define EQUISIM_IN_STATE_TIME_MS (1*60*1000)
//#define EQUISIM_SIMULATE_DIRECT_STATE_CHANGES // must disable OVERRIDE_STATE_HOLD_INIT!
// #define EQUISIM_IN_STATE_TIME_MS (1*60*1000)
//#define EQUISIM_WATCHDOG_RESET_TEST

/** Debug **/
// whether to include Tracelyzer tracing library
#define USE_TRACELYZER 1
#define USE_TRACELYZER 0

// whether to configASSERTs (and other asserts) should hang
#define USE_ASSERTIONS
//#define USE_ASSERTIONS

// add strict asserts to notify of events that we want to be rare
//#define USE_STRICT_ASSERTIONS
Expand All @@ -82,16 +82,16 @@
// 1 to print over USART
// 2 to print over Tracelyzer trace_print
// 3 to print over both
#define PRINT_DEBUG 1
#define PRINT_DEBUG 0
// whether to let normal transmissions print while print enabled
#define DONT_PRINT_RAW_TRANSMISSIONS
//#define DONT_PRINT_RAW_TRANSMISSIONS
// whether to use a mutex to avoid collisions with radio
// define for radio testing but turn off for timing/task testing
// (it slows down and alters the OS timings)
//#define SAFE_PRINT

// define to print errors as the come in
#define PRINT_NEW_ERRORS // note: probably will result in many stack overflows
//#define PRINT_NEW_ERRORS // note: probably will result in many stack overflows

/****************************************************************************************/
/* DO NOT EDIT BELOW THIS LINE UNLESS YOU ARE INTENTIONALLY MODIFYING CONFIGURATION */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ static void set_antenna_deploy_by_sat_state(sat_state_t prev_sat_state, sat_stat
/************************************************************************/

// helper to wait until a semaphore is at zero
bool wait_on_semaphore(SemaphoreHandle_t sem, TickType_t wait_time) {
static bool wait_on_semaphore(SemaphoreHandle_t sem, TickType_t wait_time) {
TickType_t start_ticks = xTaskGetTickCount();
while (uxSemaphoreGetCount(sem) < IR_POW_SEMAPHORE_MAX_COUNT) {
vTaskDelay(SEMAPHORE_EMPTY_POLL_TIME_TICKS);
Expand Down
10 changes: 3 additions & 7 deletions bootloader/bootloader/bootloader.cproj
Original file line number Diff line number Diff line change
Expand Up @@ -311,27 +311,25 @@
</ListValues>
</armgcc.compiler.directories.IncludePaths>
<armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
<armgcc.compiler.optimization.OtherFlags>-fdata-sections</armgcc.compiler.optimization.OtherFlags>
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
<armgcc.compiler.optimization.EnableFastMath>True</armgcc.compiler.optimization.EnableFastMath>
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
<armgcc.compiler.miscellaneous.OtherFlags>-pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500</armgcc.compiler.miscellaneous.OtherFlags>
<armgcc.linker.general.UseNewlibNano>True</armgcc.linker.general.UseNewlibNano>
<armgcc.linker.libraries.Libraries>
<ListValues>
<Value>libarm_cortexM0l_math</Value>
<Value>libm</Value>
<Value>MRAM_Commands.h</Value>
<Value>MRAM_Commands.c</Value>
</ListValues>
</armgcc.linker.libraries.Libraries>
<armgcc.linker.libraries.LibrarySearchPaths>
<ListValues>
<Value>../cmsis/linkerScripts</Value>
<Value>../src/ASF/thirdparty/CMSIS/Lib/GCC</Value>
<Value>C:\Users\mcken\Documents\projects\BSE\GitHub\EQUiSat_clone_aux\EQUiSatOS\EQUiSatOS\EQUiSatOS\src\processor_drivers</Value>
</ListValues>
</armgcc.linker.libraries.LibrarySearchPaths>
<armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
<armgcc.linker.optimization.EnableFastMath>True</armgcc.linker.optimization.EnableFastMath>
<armgcc.linker.memorysettings.ExternalRAM />
<armgcc.linker.miscellaneous.LinkerFlags>-Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd21/gcc/samd21j18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
<armgcc.assembler.general.IncludePaths>
<ListValues>
Expand Down Expand Up @@ -441,8 +439,6 @@
</ListValues>
</armgcc.compiler.directories.IncludePaths>
<armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
<armgcc.compiler.optimization.OtherFlags>-fdata-sections</armgcc.compiler.optimization.OtherFlags>
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
<armgcc.compiler.optimization.EnableFastMath>True</armgcc.compiler.optimization.EnableFastMath>
<armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
Expand Down
12 changes: 6 additions & 6 deletions bootloader/bootloader/src/main_bootloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

/* CONFIG */
//#define WRITE_PROG_MEM_TO_MRAM
#define DISABLE_REWRITE_FROM_MRAM
//#define DISABLE_REWRITE_FROM_MRAM
//#define RUN_TESTS

#ifdef WRITE_PROG_MEM_TO_MRAM
Expand Down Expand Up @@ -95,7 +95,7 @@ static void start_application(void)
}

// Returns the number of matching bytes in the two buffers up to len.
size_t num_similar(uint8_t* data1, uint8_t* data2, size_t len) {
static size_t num_similar(uint8_t* data1, uint8_t* data2, size_t len) {
size_t num_same = 0;
for (size_t i = 0; i < len; i++) {
if (data1[i] == data2[i]) {
Expand All @@ -110,13 +110,13 @@ size_t num_similar(uint8_t* data1, uint8_t* data2, size_t len) {
in the actual flash, and corrects any buffers that don't match.
Returns whether any were corrected
*/
int check_and_fix_prog_mem(struct spi_module* spi_master_instance,
static int check_and_fix_prog_mem(struct spi_module* spi_master_instance,
struct spi_slave_inst* mram_slave1, struct spi_slave_inst* mram_slave2) {

int num_copied = 0;
uint num_copied = 0;
uint32_t mram_addr = RAD_SAFE_FIELD_GET(mram_app_address);
uint32_t flash_addr = (uint32_t) RAD_SAFE_FIELD_GET(app_start_address);
int corrections_made = 0;
uint corrections_made = 0;

while (num_copied < RAD_SAFE_FIELD_GET(prog_mem_size)) {
size_t buf_size = min(RAD_SAFE_FIELD_GET(prog_mem_size) - num_copied, RAD_SAFE_FIELD_GET(mram_copy_buffer_size));
Expand Down Expand Up @@ -170,7 +170,7 @@ int check_and_fix_prog_mem(struct spi_module* spi_master_instance,
/*
Function to write to "program memory rewritten" field in MRAM.
*/
void set_prog_memory_rewritten(uint8_t was_rewritten, struct spi_module* spi_master_instance,
static void set_prog_memory_rewritten(uint8_t was_rewritten, struct spi_module* spi_master_instance,
struct spi_slave_inst* mram_slave1, struct spi_slave_inst* mram_slave2) {
// write duplicate fields to both mrams (no spacing)
uint8_t field_size = RAD_SAFE_FIELD_GET(mram_prog_mem_rewritten_size); // == 1
Expand Down

0 comments on commit 3ac332e

Please sign in to comment.