diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f92da7..1195011 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ if(${CMAKE_CROSSCOMPILING}) projCOVERAGE_TEST=0) target_include_directories( freertos_config INTERFACE bsp_z7/ps7_cortexa9_0/include) - + set(CMAKE_SYSTEM_PROCESSOR armv7a-none-eabihf) if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL armv7a-none-eabihf) # our compiler options, will trickle down through the project target_compile_options(freertos_config INTERFACE -c -fmessage-length=0 -g -O0 -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -ffunction-sections -fdata-sections) diff --git a/bsp_z7/coraZ7-10/xparameters.h b/bsp_z7/coraZ7-10/xparameters.h index a768cab..acd5272 100644 --- a/bsp_z7/coraZ7-10/xparameters.h +++ b/bsp_z7/coraZ7-10/xparameters.h @@ -414,12 +414,21 @@ /******************************************************************/ /* Canonical definitions for peripheral UARTLITE */ -#define XUARTLITE_BASEADDRESS 0x42c00000 -#define XPAR_UARTLITE_0_DEVICE_ID 111 + +#define XPAR_XUARTLITE_NUM_INSTANCES 1 /* Number of instances */ +#define XPAR_UARTLITE_0_DEVICE_ID 30 /* Device ID for instance */ +#define XPAR_UARTLITE_0_BASEADDR 0xA0020000 /* Device base address */ +#define XPAR_UARTLITE_0_BAUDRATE 19200 /* Baud rate */ +#define XPAR_UARTLITE_0_USE_PARITY FALSE /* Parity generator enabled */ +#define XPAR_UARTLITE_0_ODD_PARITY FALSE /* Type of parity generated */ +#define XPAR_UARTLITE_0_DATA_BITS 8 /* Data bits */ + /* Definitions for driver UARTPS */ #define XPAR_XUARTPS_NUM_INSTANCES 1 + + /* Definitions for peripheral PS7_UART_1 */ #define XPAR_PS7_UART_1_DEVICE_ID 0 #define XPAR_PS7_UART_1_BASEADDR 0xE0001000 diff --git a/bsp_z7/ps7_cortexa9_0/CMakeLists.txt b/bsp_z7/ps7_cortexa9_0/CMakeLists.txt index 1e30556..947473d 100644 --- a/bsp_z7/ps7_cortexa9_0/CMakeLists.txt +++ b/bsp_z7/ps7_cortexa9_0/CMakeLists.txt @@ -10,5 +10,6 @@ add_subdirectory(libsrc/scugic) add_subdirectory(libsrc/scutimer) add_subdirectory(libsrc/scuwdt) add_subdirectory(libsrc/standalone) +add_subdirectory(libsrc/uartlite) diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/CMakeLists.txt b/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/CMakeLists.txt new file mode 100644 index 0000000..25065b2 --- /dev/null +++ b/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${TARGET_NAME} PUBLIC + src/xuartlite_g.c + src/xuartlite_intr.c + src/xuartlite_l.c + src/xuartlite_selftest.c + src/xuartlite_sinit.c + src/xuartlite_stats.c + src/xuartlite.c +) \ No newline at end of file diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/src/xuartlite_g.c b/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/src/xuartlite_g.c index 92534e8..81f460d 100644 --- a/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/src/xuartlite_g.c +++ b/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/src/xuartlite_g.c @@ -29,8 +29,16 @@ /***************************** Include Files *********************************/ #include "xuartlite.h" -#include "xparameters.h" +//#include "xparameters.h" // TODO: Why does this include not work?! +#define XPAR_XUARTLITE_NUM_INSTANCES 1 /* Number of instances */ + +#define XPAR_UARTLITE_0_DEVICE_ID 30 /* Device ID for instance */ +#define XPAR_UARTLITE_0_BASEADDR 0xA0020000 /* Device base address */ +#define XPAR_UARTLITE_0_BAUDRATE 19200 /* Baud rate */ +#define XPAR_UARTLITE_0_USE_PARITY FALSE /* Parity generator enabled */ +#define XPAR_UARTLITE_0_ODD_PARITY FALSE /* Type of parity generated */ +#define XPAR_UARTLITE_0_DATA_BITS 8 /* Data bits */ /************************** Constant Definitions *****************************/ diff --git a/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/src/xuartlite_sinit.c b/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/src/xuartlite_sinit.c index 6bd5ae9..56055b7 100644 --- a/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/src/xuartlite_sinit.c +++ b/bsp_z7/ps7_cortexa9_0/libsrc/uartlite/src/xuartlite_sinit.c @@ -59,6 +59,17 @@ * @note None. * ******************************************************************************/ +#define XPAR_XUARTLITE_NUM_INSTANCES 1 /* Number of instances */ + +#define XUARTLITE_BASEADDRESS 0x42c00000 +#define XPAR_UARTLITE_0_BAUDRATE 1115200 +#define XPAR_UARTLITE_0_BASEADDRESS 0x42c00000 /* TODO: Why are there two Base address variables?*/ +#define XPAR_UARTLITE_0_DEVICE_ID 1113 +#define XPAR_UARTLITE_0_USE_PARITY 1 /* TODO: What does this mean?*/ +#define XPAR_UARTLITE_0_ODD_PARITY 0 /* TODO: What does this mean?*/ +#define XPAR_UARTLITE_0_DATA_BITS 8 // EIGHT is always a good guess... + + #ifndef SDT XUartLite_Config *XUartLite_LookupConfig(u16 DeviceId) { diff --git a/docker/compile_obsw/Dockerfile b/docker/compile_obsw/Dockerfile index 0da1195..d63d75d 100644 --- a/docker/compile_obsw/Dockerfile +++ b/docker/compile_obsw/Dockerfile @@ -21,9 +21,11 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --de # Add the Rust toolchain binaries to PATH ENV PATH="/root/.cargo/bin:${PATH}" + # Install the nightly Rust toolchain, the rust-src component, and set the override RUN rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu + WORKDIR /obsw/ # ENV DOT_PATH=/usr/local/bin # Works without this in debian @paul \ No newline at end of file diff --git a/mission_rust/src/lib.rs b/mission_rust/src/lib.rs index 9737506..cdc8cfd 100644 --- a/mission_rust/src/lib.rs +++ b/mission_rust/src/lib.rs @@ -81,6 +81,13 @@ struct Handler { data: datasets::OwnedDataset, } + +struct TmtcHandler { + id: objectmanager::ObjectId, + command_queue: queues::MessageQueue<10>, + data: datasets::OwnedDataset, +} + struct HandlerSender { id: objectmanager::ObjectId, other_handler: objectmanager::ObjectId, @@ -218,6 +225,15 @@ fn mission() { command_queue: queues::MessageQueue::new(), data: datasets::OwnedDataset::new(), }; + + + + let mut tmtc_handler = TmtcHandler { + id: 3, + command_queue: queues::MessageQueue::new(), + data: datasets::OwnedDataset::new(), + }; + let mut h2 = HandlerSender { id: 2, other_handler: 3,