Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
68 changes: 53 additions & 15 deletions radsat-sk/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
<listOptionValue builtIn="false" value="'BASE_REVISION_NUMBER=$(REV)'"/>
<listOptionValue builtIn="false" value="'BASE_REVISION_HASH_SHORT=$(REVHASH_SHORT)'"/>
<listOptionValue builtIn="false" value="'BASE_REVISION_HASH=$(REVHASH)'"/>
<listOptionValue builtIn="false" value="PB_C99_STATIC_ASSERT=1"/>
<listOptionValue builtIn="false" value="PB_ENABLE_MALLOC=1"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.asmlisting.121433134" name="Generate assembler listing (-Wa,-adhlns=&quot;[email protected]&quot;)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.asmlisting" value="false" valueType="boolean"/>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.1441447076" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
Expand All @@ -81,23 +83,24 @@
<listOptionValue builtIn="false" value="../framework/serial"/>
<listOptionValue builtIn="false" value="../operation"/>
<listOptionValue builtIn="false" value="../operation/message"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf/types"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf/nanopb"/>
<listOptionValue builtIn="false" value="../operation/message/types"/>
<listOptionValue builtIn="false" value="../operation/message/crypt"/>
<listOptionValue builtIn="false" value="../operation/services"/>
<listOptionValue builtIn="false" value="../operation/subsystems"/>
<listOptionValue builtIn="false" value="../operation/subsystems/camera"/>
<listOptionValue builtIn="false" value="../operation/utility"/>
<listOptionValue builtIn="false" value="../src/tasks"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.663972223" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="sdram"/>
<listOptionValue builtIn="false" value="PB_ENABLE_MALLOC=1"/>
<listOptionValue builtIn="false" value="at91sam9g20"/>
<listOptionValue builtIn="false" value="TRACE_LEVEL=0"/>
<listOptionValue builtIn="false" value="DEBUG=1"/>
<listOptionValue builtIn="false" value="'BASE_REVISION_NUMBER=$(REV)'"/>
<listOptionValue builtIn="false" value="'BASE_REVISION_HASH_SHORT=$(REVHASH_SHORT)'"/>
<listOptionValue builtIn="false" value="'BASE_REVISION_HASH=$(REVHASH)'"/>
<listOptionValue builtIn="false" value="PB_C99_STATIC_ASSERT=1"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.534234401" name="Language standard" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.gnu99" valueType="enumerated"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings.46945318" name="Other warning flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings" useByScannerDiscovery="true" value="-Wno-missing-braces -Wno-missing-field-initializers" valueType="string"/>
Expand Down Expand Up @@ -153,7 +156,7 @@
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="framework"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="operation"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="testing"/>
<entry excluding="*|**" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="testing"/>
</sourceEntries>
</configuration>
</storageModule>
Expand Down Expand Up @@ -229,12 +232,11 @@
<listOptionValue builtIn="false" value="../framework/serial"/>
<listOptionValue builtIn="false" value="../operation"/>
<listOptionValue builtIn="false" value="../operation/message"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf/types"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf/nanopb"/>
<listOptionValue builtIn="false" value="../operation/message/types"/>
<listOptionValue builtIn="false" value="../operation/message/crypt"/>
<listOptionValue builtIn="false" value="../operation/services"/>
<listOptionValue builtIn="false" value="../operation/subsystems"/>
<listOptionValue builtIn="false" value="../operation/subsystems/camera"/>
<listOptionValue builtIn="false" value="../operation/utility"/>
<listOptionValue builtIn="false" value="../src/tasks"/>
</option>
Expand Down Expand Up @@ -302,7 +304,7 @@
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="framework"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="operation"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="testing"/>
<entry excluding="**" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="testing"/>
</sourceEntries>
</configuration>
</storageModule>
Expand Down Expand Up @@ -390,16 +392,13 @@
<listOptionValue builtIn="false" value="../framework/serial"/>
<listOptionValue builtIn="false" value="../operation"/>
<listOptionValue builtIn="false" value="../operation/message"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf/types"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf/nanopb"/>
<listOptionValue builtIn="false" value="../operation/message/types"/>
<listOptionValue builtIn="false" value="../operation/message/crypt"/>
<listOptionValue builtIn="false" value="../operation/services"/>
<listOptionValue builtIn="false" value="../operation/subsystems"/>
<listOptionValue builtIn="false" value="../operation/subsystems/camera"/>
<listOptionValue builtIn="false" value="../operation/utility"/>
<listOptionValue builtIn="false" value="../src/tasks"/>
<listOptionValue builtIn="false" value="../testing"/>
<listOptionValue builtIn="false" value="../testing/unit"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.1971370393" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="sdram"/>
Expand All @@ -411,7 +410,7 @@
<listOptionValue builtIn="false" value="'BASE_REVISION_HASH=$(REVHASH)'"/>
<listOptionValue builtIn="false" value="TEST=1"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings.1632846580" name="Other warning flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings" useByScannerDiscovery="true" value="-Wno-missing-braces -Wno-missing-field-initializers" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings.1632846580" name="Other warning flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings" useByScannerDiscovery="true" value="-Wno-missing-braces -Wno-missing-field-initializers -Wno-unused-function" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.437875250" name="Language standard" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.gnu99" valueType="enumerated"/>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1887967793" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
</tool>
Expand Down Expand Up @@ -461,11 +460,49 @@
</tool>
</toolChain>
</folderInfo>
<fileInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.853133139.1724570827.555085295" name="RTestSuite.c" rcbsApplicability="disable" resourcePath="testing/RTestSuite.c" toolsToInvoke="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.926867254.1416169741">
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.926867254.1416169741" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.926867254">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.846178328" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" valueType="definedSymbols">
<listOptionValue builtIn="false" value="sdram"/>
<listOptionValue builtIn="false" value="at91sam9g20"/>
<listOptionValue builtIn="false" value="TRACE_LEVEL=5"/>
<listOptionValue builtIn="false" value="DEBUG=1"/>
<listOptionValue builtIn="false" value="'BASE_REVISION_NUMBER=$(REV)'"/>
<listOptionValue builtIn="false" value="'BASE_REVISION_HASH_SHORT=$(REVHASH_SHORT)'"/>
<listOptionValue builtIn="false" value="'BASE_REVISION_HASH=$(REVHASH)'"/>
<listOptionValue builtIn="false" value="TEST=1"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.33493194" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/radsat-sk/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${external-dependencies}/hal/freertos/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${external-dependencies}/hal/at91/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${external-dependencies}/hal/hal/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${external-dependencies}/hal/hcc/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${external-dependencies}/satellite-subsystems/satellite-subsystems/include&quot;"/>
<listOptionValue builtIn="false" value="../framework"/>
<listOptionValue builtIn="false" value="../framework/fileio"/>
<listOptionValue builtIn="false" value="../framework/serial"/>
<listOptionValue builtIn="false" value="../operation"/>
<listOptionValue builtIn="false" value="../operation/message"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf/types"/>
<listOptionValue builtIn="false" value="../operation/message/protobuf/nanopb"/>
<listOptionValue builtIn="false" value="../operation/message/crypt"/>
<listOptionValue builtIn="false" value="../operation/services"/>
<listOptionValue builtIn="false" value="../operation/subsystems"/>
<listOptionValue builtIn="false" value="../operation/utility"/>
<listOptionValue builtIn="false" value="../testing"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/radsat-sk/testing/unit}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/radsat-sk/src/tasks}&quot;"/>
</option>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.602697520" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
</tool>
</fileInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="framework"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="operation"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="testing"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="testing"/>
</sourceEntries>
</configuration>
</storageModule>
Expand All @@ -480,6 +517,7 @@
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/${ProjName}"/>
</configuration>
<configuration configurationName="Test"/>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/${ProjName}"/>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion radsat-sk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/Release
/docs
/.settings
/Test
/Test
16 changes: 16 additions & 0 deletions radsat-sk/framework/fileio/RFram.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ int framInit(void) {
if (initialized)
return E_IS_INITIALIZED;

infoPrint("Fram max address = %d", FRAM_getMaxAddress());

int error = FRAM_start();

if (error == SUCCESS)
initialized = 1;

// TODO: record errors (if present) to System Manager

return error;
Expand Down Expand Up @@ -84,3 +89,14 @@ int framWrite(uint8_t* data, uint32_t address, uint32_t size) {

return error;
}

void framPrint(void){
uint8_t data[32] = { 0 };

for (int i = 0; i < 32; i++){
framRead(data, i*32, 32);
debugPrintHex(data, 32);
printf("\n\r");
}

}
16 changes: 16 additions & 0 deletions radsat-sk/framework/fileio/RFram.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@

#include <stdint.h>

/***************************************************************************************************
DEFINITIONS
***************************************************************************************************/

/** FRAM address of the write cursor (2 bytes allocated). */
#define FRAM_WRITE_CURSOR_ADDR (0x00)

/** FRAM address of the read cursor (2 bytes allocated). */
#define FRAM_READ_CURSOR_ADDR (0x02)

/** FRAM start address of the data. */
#define FRAM_DATA_START_ADDR (0x04)

/** Size of each data block in FRAM (in bytes). */
#define FRAM_DATA_FRAME_SIZE (TRANCEIVER_TX_MAX_FRAME_SIZE + 1)


/***************************************************************************************************
PUBLIC API
Expand Down
35 changes: 31 additions & 4 deletions radsat-sk/framework/serial/RI2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,30 @@ int i2cInit(void) {
}



/*!
* Blocks the bus, preventing any further transmissions on it until released. If there is a transmission
* ongoing, it will wait until *timeout* or the bus is released
* @param timeout Length of time to wait for current transmission to finish (portMAX_DELAY to wait forever)
* @return 0 on success, 1 if there was a timeout
*/
int i2cWait(void){
int error = I2C_blockBus(250);
if (error){
errorPrint("I2C Read FAILEd!!!!!!!");
}
return error;
}

/*!
* Release back the bus.
*/
void i2cRelease(void){
I2C_releaseBus();
return;
}


/**
* Writes data to a slave component over I2C
*
Expand All @@ -69,7 +93,9 @@ int i2cTransmit(uint16_t slaveAddress, const uint8_t* data, uint16_t size) {
if (!initialized)
return E_NOT_INITIALIZED;

//if(i2cWait()) return -1;
int error = I2C_write(slaveAddress, data, size);
//i2cRelease();

// TODO: record errors (if present) to System Manager

Expand All @@ -93,15 +119,14 @@ int i2cRecieve(uint16_t slaveAddress, uint8_t* data, uint16_t size) {
// I2C driver must be initialized
if (!initialized)
return E_NOT_INITIALIZED;
debugPrint("before\n");

debugPrint("before I2C read\n");
int error = I2C_read(slaveAddress, data, size);
debugPrint("after\n");
debugPrint("after I2C read\n");
// TODO: record errors (if present) to System Manager

return error;
}


/**
* Writes to the slave, then reads a response
*
Expand Down Expand Up @@ -132,7 +157,9 @@ int i2cTalk(uint16_t slaveAddress, uint16_t writeSize, uint16_t readSize, uint8_
transfer.readData = readData;
transfer.writeReadDelay = delay;

//if(i2cWait()) return -1;
int error = I2C_writeRead(&transfer);
//i2cRelease();

// TODO: record errors (if present) to System Manager

Expand Down
Loading