Skip to content

Commit

Permalink
eRPC updates 05/2019
Browse files Browse the repository at this point in the history
-- added missing doxygen comments for transports
-- documentation update for v1.7.2
-- unit tests minor modifications
  • Loading branch information
MichalPrincNXP committed May 15, 2019
1 parent 49d768a commit f1f01f5
Show file tree
Hide file tree
Showing 21 changed files with 142 additions and 37 deletions.
2 changes: 1 addition & 1 deletion doxygen/Doxyfile.erpc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC API Reference"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "Rev. 1.7.1"
PROJECT_NUMBER = "Rev. 1.7.2"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion doxygen/Doxyfile.erpcgen
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC Generator (erpcgen)"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "Rev. 1.7.1"
PROJECT_NUMBER = "Rev. 1.7.2"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions erpc_c/infra/erpc_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
////////////////////////////////////////////////////////////////////////////////

//! @brief String version of eRPC.
#define ERPC_VERSION "1.7.1"
#define ERPC_VERSION "1.7.2"
//! @brief Integer version of eRPC.
#define ERPC_VERSION_NUMBER 10701
#define ERPC_VERSION_NUMBER 10702

/*! @} */

Expand Down
8 changes: 4 additions & 4 deletions erpc_c/port/erpc_threading_freertos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ void Thread::start(void *arg)
// which will scan the linked list.
taskENTER_CRITICAL();

xTaskCreate(threadEntryPointStub, (m_name ? m_name : "task"),
((m_stackSize + sizeof(uint32_t) - 1) / sizeof(uint32_t)), // Round up number of words.
this, m_priority, &m_task);
(void)xTaskCreate(threadEntryPointStub, (m_name ? m_name : "task"),
((m_stackSize + sizeof(uint32_t) - 1) / sizeof(uint32_t)), // Round up number of words.
this, m_priority, &m_task);

// Link in this thread to the list.
if (s_first)
Expand Down Expand Up @@ -234,7 +234,7 @@ bool Semaphore::get(uint32_t timeout)
timeout = portMAX_DELAY - 1;
}
#endif
xSemaphoreTake(m_sem, timeout / 1000 / portTICK_PERIOD_MS);
(void)xSemaphoreTake(m_sem, timeout / 1000 / portTICK_PERIOD_MS);
return true;
}

Expand Down
87 changes: 84 additions & 3 deletions erpc_c/setup/erpc_transport_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,112 @@ extern "C" {
//! @name Transport setup
//@{

//! @name CMSIS UART transport setup
//@{

/*!
* @brief Create a CMSIS UART transport.
*
* Create a CMSIS UART transport instance, to be used on both the server
* and the client side.
*
* @param[in] uartDrv CMSIS USART driver structure address (Driver Control Block).
*
* @return Return NULL or erpc_transport_t instance pointer.
*/
erpc_transport_t erpc_transport_cmsis_uart_init(void *uartDrv);
//@}

//! @name Host PC serial port transport setup
//@{

/*!
* @brief Create a host PC serial port transport.
*
* Create a host PC serial port transport instance.
*
* @param[in] portName Port name.
* @param[in] baudRate Baud rate.
*
* @return Return NULL or erpc_transport_t instance pointer.
*/
erpc_transport_t erpc_transport_serial_init(const char *portName, long baudRate);
//@}

//! @name SPI transport setup
//@{

/*!
* @brief Create a SPI master transport.
*
* Create SPI master transport instance, to be used at master core.
*
* @param[in] baseAddr Base address of SPI peripheral used in this transport layer.
* @param[in] baudRate SPI baud rate.
* @param[in] srcClock_Hz SPI source clock in Hz.
*
* @return Return NULL or erpc_transport_t instance pointer.
*/
erpc_transport_t erpc_transport_spi_master_init(void *baseAddr, uint32_t baudRate, uint32_t srcClock_Hz);

/*!
* @brief Create a SPI slave transport.
*
* Create SPI slave transport instance, to be used at slave core.
*
* @param[in] baseAddr Base address of SPI peripheral used in this transport layer.
* @param[in] baudRate SPI baud rate.
* @param[in] srcClock_Hz SPI source clock in Hz.
*
* @return Return NULL or erpc_transport_t instance pointer.
*/
erpc_transport_t erpc_transport_spi_slave_init(void *baseAddr, uint32_t baudRate, uint32_t srcClock_Hz);
//@}

//! @name DSPI transport setup
//@{

/*!
* @brief Create a DSPI master transport.
*
* Create DSPI master transport instance, to be used at master core.
*
* @param[in] baseAddr Base address of DSPI peripheral used in this transport layer.
* @param[in] baudRate DSPI baud rate.
* @param[in] srcClock_Hz DSPI source clock in Hz.
*
* @return Return NULL or erpc_transport_t instance pointer.
*/
erpc_transport_t erpc_transport_dspi_master_init(void *baseAddr, uint32_t baudRate, uint32_t srcClock_Hz);

/*!
* @brief Create a DSPI slave transport.
*
* Create DSPI slave transport instance, to be used at slave core.
*
* @param[in] baseAddr Base address of DSPI peripheral used in this transport layer.
* @param[in] baudRate DSPI baud rate.
* @param[in] srcClock_Hz DSPI source clock in Hz.
*
* @return Return NULL or erpc_transport_t instance pointer.
*/
erpc_transport_t erpc_transport_dspi_slave_init(void *baseAddr, uint32_t baudRate, uint32_t srcClock_Hz);
//@}

//! @name MU transport setup
//@{

/*!
* @brief Create an MU transport.
*
* Create Messaging Unit (MU) transport instance, to be used on both the server
* and the client side. Base address of the MU peripheral needs to be passed.
*
* @param[in] baseAddr Base address of MU peripheral.
*
* @return Return NULL or erpc_transport_t instance pointer.
*/
erpc_transport_t erpc_transport_mu_init(void *baseAddr);

//@}

//! @name RPMsg-Lite transport setup
Expand Down Expand Up @@ -175,6 +246,10 @@ erpc_transport_t erpc_transport_rpmsg_lite_rtos_remote_init(unsigned long src_ad
erpc_transport_t erpc_transport_rpmsg_lite_tty_rtos_remote_init(unsigned long src_addr, unsigned long dst_addr,
void *start_address, int rpmsg_link_id,
rpmsg_ready_cb ready, char *nameservice_name);
//@}

//! @name Linux RPMSG endpoint setup
//@{

/*!
* @brief Create an Linux RPMSG endpoint transport.
Expand All @@ -186,16 +261,22 @@ erpc_transport_t erpc_transport_rpmsg_lite_tty_rtos_remote_init(unsigned long sr
* When type is set to '0', then Datagram model will be used, else Stream.
*
* @param[in] local_addr Local endpoint address.
* @param[in] type Datagram or Stream.
* @param[in] type Datagram (0) or Stream (1).
* @param[in] remote_addr Remote endpoint address.
*
* @return Return NULL or erpc_transport_t instance pointer.
*/
erpc_transport_t erpc_transport_rpmsg_linux_init(int16_t local_addr, int8_t type, int16_t remote_addr);
//@}

/*!
* @brief Deinitialize an Linux RPMSG endpoint transport.
*
* This function deinitializes the Linux RPMSG endpoint transport.
*/
void erpc_transport_rpmsg_linux_deinit(void);
//@}

//@}

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_dspi_master_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DspiMasterTransport : public FramedTransport
/*!
* @brief Constructor.
*
* @param[in] spiBaseAddr Spi driver.
* @param[in] spiBaseAddr DSPI peripheral base address.
* @param[in] baudRate Baudrate.
* @param[in] srcClock_Hz Source clock.
*/
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_dspi_slave_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DspiSlaveTransport : public FramedTransport
/*!
* @brief Constructor.
*
* @param[in] spiBaseAddr Spi driver.
* @param[in] spiBaseAddr DSPI peripheral base address.
* @param[in] baudRate Baudrate.
* @param[in] srcClock_Hz Source clock.
*/
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_spi_master_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SpiMasterTransport : public FramedTransport
/*!
* @brief Constructor.
*
* @param[in] spiBaseAddr Spi driver.
* @param[in] spiBaseAddr DSPI peripheral base address.
* @param[in] baudRate Baudrate.
* @param[in] srcClock_Hz Source clock.
*/
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_spi_slave_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SpiSlaveTransport : public FramedTransport
/*!
* @brief Constructor.
*
* @param[in] spiBaseAddr Spi driver.
* @param[in] spiBaseAddr DSPI peripheral base address.
* @param[in] baudRate Baudrate.
* @param[in] srcClock_Hz Source clock.
*/
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_tcp_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace erpc;

// Set this to 1 to enable debug logging.
// TODO fix issue with the transport not working on Linux if debug logging is disabled.
#define TCP_TRANSPORT_DEBUG_LOG (1)
//#define TCP_TRANSPORT_DEBUG_LOG (1)

#if TCP_TRANSPORT_DEBUG_LOG
#define TCP_DEBUG_PRINT(_fmt_, ...) printf(_fmt_, ##__VA_ARGS__)
Expand Down
2 changes: 1 addition & 1 deletion erpc_python/erpc/erpc_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# SPDX-License-Identifier: BSD-3-Clause

#Should be same as in erpc_version.h
ERPC_VERSION = "1.7.1"
ERPC_VERSION = "1.7.2"
2 changes: 1 addition & 1 deletion examples/matrix_multiply_tcp_python/service/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: BSD-3-Clause

#
# Generated by erpcgen 1.7.1 on Tue Sep 18 11:22:39 2018.
# Generated by erpcgen 1.7.2 on Fri Mar 15 10:14:52 2019.
#
# AUTOGENERATED - DO NOT EDIT
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: BSD-3-Clause

#
# Generated by erpcgen 1.7.1 on Tue Sep 18 11:22:39 2018.
# Generated by erpcgen 1.7.2 on Fri Mar 15 10:14:52 2019.
#
# AUTOGENERATED - DO NOT EDIT
#
Expand All @@ -15,8 +15,8 @@
version = erpc_version.ERPC_VERSION
except ImportError:
version = "unknown"
if version != "1.7.1":
raise ValueError("The generated shim code version (1.7.1) is different to the rest of eRPC code (%s). \
if version != "1.7.2":
raise ValueError("The generated shim code version (1.7.2) is different to the rest of eRPC code (%s). \
Install newer version by running \"python setup.py install\" in folder erpc/erpc_python/." % repr(version))

from . import common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: BSD-3-Clause

#
# Generated by erpcgen 1.7.1 on Tue Sep 18 11:22:39 2018.
# Generated by erpcgen 1.7.2 on Fri Mar 15 10:14:52 2019.
#
# AUTOGENERATED - DO NOT EDIT
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: BSD-3-Clause

#
# Generated by erpcgen 1.7.1 on Tue Sep 18 11:22:39 2018.
# Generated by erpcgen 1.7.2 on Fri Mar 15 10:14:52 2019.
#
# AUTOGENERATED - DO NOT EDIT
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: BSD-3-Clause

#
# Generated by erpcgen 1.7.1 on Tue Sep 18 11:22:39 2018.
# Generated by erpcgen 1.7.2 on Fri Mar 15 10:14:52 2019.
#
# AUTOGENERATED - DO NOT EDIT
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: BSD-3-Clause

#
# Generated by erpcgen 1.7.1 on Tue Sep 18 11:22:39 2018.
# Generated by erpcgen 1.7.2 on Fri Mar 15 10:14:52 2019.
#
# AUTOGENERATED - DO NOT EDIT
#
Expand Down
20 changes: 13 additions & 7 deletions test/common/unit_test_arbitrator_app0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void runServer(void *arg)

if (err != kErpcStatus_Success)
{
PRINTF("Server error: %d\n", err);
PRINTF("Server error: %d\r\n", err);
}
vTaskSuspend(NULL);
}
Expand Down Expand Up @@ -140,7 +140,7 @@ void runInit(void *arg)
if (transportClient == NULL)
{
// error in initialization of transport layer
PRINTF("Transport layer initialization failed\n");
PRINTF("Transport layer initialization failed\r\n");
while (1)
{
}
Expand Down Expand Up @@ -193,29 +193,32 @@ class MinimalistPrinter : public ::testing::EmptyTestEventListener
// Called before a test starts.
virtual void OnTestStart(const ::testing::TestInfo &test_info)
{
PRINTF("*** Test %s.%s starting.\n", test_info.test_case_name(), test_info.name());
PRINTF("*** Test %s.%s starting.\r\n", test_info.test_case_name(), test_info.name());
}

// Called after a failed assertion or a SUCCEED() invocation.
virtual void OnTestPartResult(const ::testing::TestPartResult &test_part_result)
{
PRINTF("%s in %s:%d\n%s\n", test_part_result.failed() ? "*** Failure" : "Success", test_part_result.file_name(),
PRINTF("%s in %s:%d\r\n%s\r\n", test_part_result.failed() ? "*** Failure" : "Success", test_part_result.file_name(),
test_part_result.line_number(), test_part_result.summary());
}

// Called after a test ends.
virtual void OnTestEnd(const ::testing::TestInfo &test_info)
{
PRINTF("*** Test %s.%s ending.\n", test_info.test_case_name(), test_info.name());
PRINTF("*** Test %s.%s ending.\r\n", test_info.test_case_name(), test_info.name());
}

virtual void OnTestCaseEnd(const ::testing::TestCase &test_case)
{
PRINTF("*** Total tests passed: %d, failed: %d.\n", test_case.successful_test_count(),
PRINTF("*** Total tests passed: %d, failed: %d.\r\n", test_case.successful_test_count(),
test_case.failed_test_count());
}
};

#ifdef __cplusplus
extern "C" {
#endif
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
Expand All @@ -232,7 +235,7 @@ int main(int argc, char **argv)
// Calculate size of the image
uint32_t core1_image_size;
core1_image_size = get_core1_image_size();
PRINTF("Copy CORE1 image to address: 0x%x, size: %d\n", CORE1_BOOT_ADDRESS, core1_image_size);
PRINTF("Copy CORE1 image to address: 0x%x, size: %d\r\n", CORE1_BOOT_ADDRESS, core1_image_size);

// Copy application from FLASH to RAM
memcpy(CORE1_BOOT_ADDRESS, (void *)CORE1_IMAGE_START, core1_image_size);
Expand All @@ -249,6 +252,9 @@ int main(int argc, char **argv)
{
}
}
#ifdef __cplusplus
}
#endif

void quitSecondInterfaceServer()
{
Expand Down
Loading

0 comments on commit f1f01f5

Please sign in to comment.