CMake Update

- Project name is now romeo-obsw
- ZYNQ_UART selects which Zynq PS UART is used for stdio
This commit is contained in:
2023-12-01 13:44:42 +01:00
parent 10c38b4ac9
commit 96091b97af
3 changed files with 17 additions and 5 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
# Project Name # Project Name
project(freeRTOS C CXX ASM) project(romeo-obsw C CXX ASM)
# ############################################################################## # ##############################################################################
@ -30,7 +30,12 @@ set (LWIP_DIR contrib/lwip)
# Configuration # Configuration
# ############################################################################## # ##############################################################################
set(ZYNQ_UART UART1 CACHE STRING "Which PS UART to use for stdout")
set_property(CACHE ZYNQ_UART PROPERTY STRINGS UART0 UART1)
if(${ZYNQ_UART} STREQUAL UART0)
add_compile_definitions(ZYNQ_USE_UART0)
endif()
# ############################################################################## # ##############################################################################

View File

@ -23,9 +23,16 @@
#include "xparameters_ps.h" #include "xparameters_ps.h"
// Default is for Zedboard
#ifndef ZYNQ_USE_UART0
#define STDIN_BASEADDRESS XPS_UART1_BASEADDR
#define STDIN_INT_NR XPAR_XUARTPS_1_INTR
#define STDOUT_BASEADDRESS XPS_UART1_BASEADDR
#else
#define STDIN_BASEADDRESS XPS_UART0_BASEADDR #define STDIN_BASEADDRESS XPS_UART0_BASEADDR
#define STDIN_INT_NR XPAR_XUARTPS_0_INTR
#define STDOUT_BASEADDRESS XPS_UART0_BASEADDR #define STDOUT_BASEADDRESS XPS_UART0_BASEADDR
#endif
/******************************************************************/ /******************************************************************/

View File

@ -17,7 +17,7 @@
#define XUARTPS_IXR_RXOVR 0x00000020U /**< Rx Overrun error interrupt */ #define XUARTPS_IXR_RXOVR 0x00000020U /**< Rx Overrun error interrupt */
#define XUARTPS_IXR_RTRIG 0x00000001U /**< RX FIFO trigger interrupt. */ #define XUARTPS_IXR_RTRIG 0x00000001U /**< RX FIFO trigger interrupt. */
#define UART_INT_NR XPAR_XUARTPS_0_INTR
// #include <lwip/apps/tftp_server.h> // #include <lwip/apps/tftp_server.h>
@ -195,7 +195,7 @@ void testIp() {
/* Install the UART Interrupt handler. */ /* Install the UART Interrupt handler. */
BaseType_t xStatus = BaseType_t xStatus =
XScuGic_Connect(&xInterruptController, UART_INT_NR, XScuGic_Connect(&xInterruptController, STDIN_INT_NR,
(Xil_ExceptionHandler)handleUARTInt, NULL); (Xil_ExceptionHandler)handleUARTInt, NULL);
configASSERT(xStatus == XST_SUCCESS); configASSERT(xStatus == XST_SUCCESS);
(void)xStatus; /* Remove compiler warning if configASSERT() is not defined. */ (void)xStatus; /* Remove compiler warning if configASSERT() is not defined. */
@ -215,7 +215,7 @@ void testIp() {
XUartPs_WriteReg(STDIN_BASEADDRESS, XUARTPS_IDR_OFFSET, (~mask)); XUartPs_WriteReg(STDIN_BASEADDRESS, XUARTPS_IDR_OFFSET, (~mask));
/* Enable the interrupt for the UART1 in the interrupt controller. */ /* Enable the interrupt for the UART1 in the interrupt controller. */
XScuGic_Enable(&xInterruptController, UART_INT_NR); XScuGic_Enable(&xInterruptController, STDIN_INT_NR);
// Start lwip task // Start lwip task
xTaskCreateStatic( xTaskCreateStatic(