Skip to content

Commit 6a571ca

Browse files
eRPC updates 01/2021
-- Update/correct erpc README.md. -- Several MISRA C-2012 violations addressed. -- Add missing GPIO-less support into the erpc DSPI transport layer to be aligned with the SPI transport.
1 parent 99afd49 commit 6a571ca

38 files changed

+294
-121
lines changed

README.md

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Client side usage:
2626
void example_client(void) {
2727
// Initialize client running over UART.
2828
erpc_client_init(
29-
erpc_transport_cmsis_uart_init(Driver_USART0);
29+
erpc_transport_cmsis_uart_init(Driver_USART0),
30+
erpc_mbf_dynamic_init());
3031
3132
// Now we can call the remote function to turn on the green LED.
3233
set_led(kGreen, true);
@@ -43,7 +44,8 @@ void set_led(LEDName whichLed, bool onOrOff) {
4344
void example_server(void) {
4445
// Initialize server running over UART.
4546
erpc_server_init(
46-
erpc_transport_cmsis_uart_init(Driver_USART0);
47+
erpc_transport_cmsis_uart_init(Driver_USART0),
48+
erpc_mbf_dynamic_init());
4749
4850
// Add the IO service.
4951
erpc_add_service_to_server(create_IO_service());
@@ -61,20 +63,32 @@ Supported transports:
6163
* NXP Kinetis SPI and DSPI
6264
* POSIX and Windows serial port
6365
* TCP/IP (mostly for testing)
64-
* [NXP RPMsg-Lite](https://github.com/NXPmicro/rpmsg-lite)
66+
* [NXP RPMsg-Lite / RPMsg TTY](https://github.com/NXPmicro/rpmsg-lite)
67+
* SPIdev Linux
68+
* USB CDC
69+
* NXP Messaging Unit
6570

66-
eRPC is available with an unrestrictive BSD 3-clause license. See the LICENSE file for the full license text.
71+
eRPC is available with an unrestrictive BSD 3-clause license. See the [LICENSE file](https://github.com/EmbeddedRPC/erpc/blob/develop/LICENSE) for the full license text.
6772

6873
## Releases
6974

7075
[eRPC releases](https://github.com/EmbeddedRPC/erpc/releases)
7176

7277
## Documentation
7378

74-
[Documentation](https://github.com/EmbeddedRPC/erpc/wiki) is in the `wiki` section. Commit sha in wiki repository: 431cba8.
79+
[Documentation](https://github.com/EmbeddedRPC/erpc/wiki) is in the `wiki` section.
80+
81+
[eRPC Infrastructure documentation](https://embeddedrpc.github.io/)
82+
83+
## Examples
7584

7685
[Example IDL](examples/README.md) is available in the `examples/` folder.
7786

87+
Plenty of eRPC multicore and multiprocessor examples can be also found in NXP MCUXpressoSDK packages. Visit [https://mcuxpresso.nxp.com](https://mcuxpresso.nxp.com) to configure, build and download these packages.<br>
88+
To get the board list with multicore support (eRPC included) use filtering based on Middleware and search for 'multicore' string. Once the selected package with the multicore middleware is downloaded, see<br>
89+
<MCUXpressoSDK_install_dir>/boards/<board_name>/multicore_examples for eRPC multicore examples (RPMsg_Lite or Messaging Unit transports used) or<br>
90+
<MCUXpressoSDK_install_dir>/boards/<board_name>/multiprocessor_examples for eRPC multiprocessor examples (UART or SPI transports used).<br>
91+
eRPC examples use 'erpc_' name prefix.
7892

7993
## Directories
8094

@@ -88,12 +102,16 @@ eRPC is available with an unrestrictive BSD 3-clause license. See the LICENSE fi
88102

89103
`erpcgen` - Holds source code for erpcgen and makefiles or project files to build erpcgen on Windows, Linux, and OS X.
90104

105+
`erpcsniffer` - Holds source code for erpcsniffer application.
106+
91107
`examples` - Several example IDL files.
92108

93109
`mk` - Contains common makefiles for building eRPC components.
94110

95111
`test` - Client/server tests. These tests verify the entire communications path from client to server and back.
96112

113+
`utilities` - Holds utilities which bring additional benefit to eRPC apps developers.
114+
97115

98116
## Building and installing
99117

@@ -117,11 +135,11 @@ Steps are described in [`erpcgen/VisualStudio_v14/readme_erpcgen.txt`](erpcgen/V
117135
Install these packages:
118136
* bison: GNU yacc-compatible parser generator
119137
* flex: A fast lexical analyzer generator
120-
* libboost-dev, libboost-filesystem-dev, libboost-system-dev: Boost C++ libraries (Linux needs to use libboost version 1.67.0)
138+
* libboost-dev, libboost-filesystem-dev, libboost-system-dev: Boost C++ libraries (Linux needs to use libboost version 1.65.0)
121139
* make: the GNU version of the 'make' utility
122140
* python: Python language interpreter (either 2.7 or 3.5+ work)
123-
* gcc-core: GNU Compiler Collection (C, OpenMP)
124-
* gcc-g++: GNU Compiler Collection (C++)
141+
* gcc-7: GNU C compiler (recommended version)
142+
* g++-7: GNU C++ compiler (recommended version)
125143

126144
Mandatory for case, when build for different architecture is needed
127145
* gcc-multilib, g++-multilib
@@ -130,9 +148,9 @@ Mandatory for case, when build for different architecture is needed
130148
#### Mac OS X
131149

132150
Install these packages with [homebrew](http://brew.sh/):
133-
* bison: GNU yacc-compatible parser generator
134-
* flex: A fast lexical analyzer generator
135-
* boost: Boost C++ libraries
151+
* bison: GNU yacc-compatible parser generator (version 3.7.3 is recommended)
152+
* flex: A fast lexical analyzer generator (version 2.6.4 is recommended)
153+
* boost: Boost C++ libraries (version 1.74 is recommended)
136154

137155
### Building
138156

@@ -157,6 +175,8 @@ List of top level Makefile targets:
157175
- `all`: build all of the above
158176
- `install`: install liberpc.a, erpcgen, and include files
159177

178+
eRPC code is validated with respect to the C++ 11 standard.
179+
160180
### Installing for Python
161181

162182
To install the Python infrastructure for eRPC, first change to the `erpc_python/` directory. Then run the setup.py script like this:
@@ -165,7 +185,7 @@ To install the Python infrastructure for eRPC, first change to the `erpc_python/
165185

166186
After installation, the `erpc` package is available via normal import statements. See the [erpc_python folder readme](erpc_python/readme.md) for more.
167187

168-
## Code providing:
188+
## Code providing
169189

170190
Repository on Github contains two main branches. __Master__ and __develop__. Code is developed on __develop__ branch. Release version is created via merging __develop__ branch into __master__ branch.
171191

erpc_c/config/erpc_config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@
7171
//! Uncomment to change the size of buffers allocated by one of MessageBufferFactory.
7272
//! (@ref client_setup and @ref server_setup). The default size is set to 256.
7373
//! For RPMsg transport layer, ERPC_DEFAULT_BUFFER_SIZE must be 2^n - 16.
74-
//#define ERPC_DEFAULT_BUFFER_SIZE (256)
74+
//#define ERPC_DEFAULT_BUFFER_SIZE (256U)
7575

7676
//! @def ERPC_DEFAULT_BUFFERS_COUNT
7777
//!
7878
//! Uncomment to change the count of buffers allocated by one of statically allocated messages.
7979
//! Default value is set to 2.
80-
//#define ERPC_DEFAULT_BUFFERS_COUNT (2)
80+
//#define ERPC_DEFAULT_BUFFERS_COUNT (2U)
8181

8282
//! @def ERPC_NOEXCEPT
8383
//!

erpc_c/infra/erpc_client_manager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ class ClientManager : public ClientServerCommon
200200
Codec *createBufferAndCodec(void);
201201

202202
private:
203-
ClientManager(const ClientManager &); //!< Disable copy ctor.
204-
ClientManager &operator=(const ClientManager &); //!< Disable copy ctor.
203+
ClientManager(const ClientManager &other); //!< Disable copy ctor.
204+
ClientManager &operator=(const ClientManager &other); //!< Disable copy ctor.
205205
};
206206

207207
/*!

erpc_c/infra/erpc_client_server_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class ClientServerCommon
7979
#define ERPC_OTHER_INHERITANCE 1
8080
:
8181
#endif
82-
PrePostAction()
82+
PrePostAction(void)
8383
#endif
8484
{};
8585

erpc_c/infra/erpc_framed_transport.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2017 NXP
3+
* Copyright 2016-2020 NXP
44
* All rights reserved.
55
*
66
*
@@ -22,7 +22,7 @@ using namespace erpc;
2222
FramedTransport::FramedTransport(void)
2323
: Transport()
2424
, m_crcImpl(NULL)
25-
#if ERPC_THREADS
25+
#if !ERPC_THREADS_IS(NONE)
2626
, m_sendLock()
2727
, m_receiveLock()
2828
#endif
@@ -43,7 +43,7 @@ erpc_status_t FramedTransport::receive(MessageBuffer *message)
4343
Header h;
4444

4545
{
46-
#if ERPC_THREADS
46+
#if !ERPC_THREADS_IS(NONE)
4747
Mutex::Guard lock(m_receiveLock);
4848
#endif
4949

@@ -88,7 +88,7 @@ erpc_status_t FramedTransport::receive(MessageBuffer *message)
8888
erpc_status_t FramedTransport::send(MessageBuffer *message)
8989
{
9090
assert(m_crcImpl && "Uninitialized Crc16 object.");
91-
#if ERPC_THREADS
91+
#if !ERPC_THREADS_IS(NONE)
9292
Mutex::Guard lock(m_sendLock);
9393
#endif
9494

erpc_c/infra/erpc_framed_transport.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2017 NXP
3+
* Copyright 2016-2020 NXP
44
* All rights reserved.
55
*
66
*
@@ -16,7 +16,7 @@
1616

1717
#include <cstring>
1818

19-
#if ERPC_THREADS
19+
#if !ERPC_THREADS_IS(NONE)
2020
#include "erpc_threading.h"
2121
#endif
2222

@@ -111,7 +111,7 @@ class FramedTransport : public Transport
111111
protected:
112112
Crc16 *m_crcImpl; /*!< CRC object. */
113113

114-
#if ERPC_THREADS
114+
#if !ERPC_THREADS_IS(NONE)
115115
Mutex m_sendLock; //!< Mutex protecting send.
116116
Mutex m_receiveLock; //!< Mutex protecting receive.
117117
#endif

erpc_c/infra/erpc_pre_post_action.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PrePostAction
4242
/*!
4343
* @brief PrePostAction constructor.
4444
*/
45-
PrePostAction()
45+
PrePostAction(void)
4646
: m_preCB(NULL)
4747
, m_postCB(NULL){};
4848

@@ -67,14 +67,14 @@ class PrePostAction
6767
*
6868
* @return preCB Pointer for callback function.
6969
*/
70-
pre_post_action_cb getPreCB() { return m_preCB; }
70+
pre_post_action_cb getPreCB(void) { return m_preCB; }
7171

7272
/*!
7373
* @brief This function returns "after eRPC call finish" callback function.
7474
*
7575
* @return postCB Pointer for callback function.
7676
*/
77-
pre_post_action_cb getPostCB() { return m_postCB; }
77+
pre_post_action_cb getPostCB(void) { return m_postCB; }
7878

7979
/*!
8080
* @brief PrePostAction destructor

erpc_c/infra/erpc_server.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ using namespace erpc;
1818
////////////////////////////////////////////////////////////////////////////////
1919

2020
#if ERPC_NESTED_CALLS_DETECTION
21+
extern bool nestingDetection;
2122
bool nestingDetection = false;
2223
#endif
2324

erpc_c/infra/erpc_server.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ class Server : public ClientServerCommon
226226

227227
private:
228228
// Disable copy ctor.
229-
Server(const Server &); /*!< Disable copy ctor. */
230-
Server &operator=(const Server &); /*!< Disable copy ctor. */
229+
Server(const Server &other); /*!< Disable copy ctor. */
230+
Server &operator=(const Server &other); /*!< Disable copy ctor. */
231231
};
232232

233233
} // namespace erpc

erpc_c/infra/erpc_simple_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ erpc_status_t SimpleServer::runInternalBegin(Codec **codec, MessageBuffer &buff,
6464
erpc_status_t err = m_transport->receive(&buff);
6565

6666
#if ERPC_PRE_POST_ACTION
67-
pre_post_action_cb preCB = this->getPreCB();
67+
pre_post_action_cb preCB = this->getPreCB(void);
6868
if (preCB)
6969
{
7070
preCB();

0 commit comments

Comments
 (0)