Skip to content

Commit 97271a1

Browse files
committed
Merge commit '6d011e9960445cf457f80b43fcf0e8d6ec167c2d' into feature/parameter_by_reference
Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
2 parents add89f4 + 6d011e9 commit 97271a1

32 files changed

+188
-120
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Copyright 2014-2016 Freescale Semiconductor, Inc.
2-
Copyright 2016-2022 NXP
2+
Copyright 2016-2023 NXP
33
All rights reserved.
44

55
The BSD 3 Clause License

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Supported transports:
7171
* NXP Kinetis SPI and DSPI
7272
* POSIX and Windows serial port
7373
* TCP/IP (mostly for testing)
74-
* [NXP RPMsg-Lite / RPMsg TTY](https://github.com/NXPmicro/rpmsg-lite)
74+
* [NXP RPMsg-Lite / RPMsg TTY](https://github.com/nxp-mcuxpresso/rpmsg-lite)
7575
* SPIdev Linux
7676
* USB CDC
7777
* NXP Messaging Unit
@@ -102,8 +102,8 @@ To get the board list with multicore support (eRPC included) use filtering based
102102

103103
eRPC examples use the 'erpc_' name prefix.
104104

105-
Another way of getting NXP MCUXpressoSDK eRPC multicore and multiprocessor examples is using the [mcux-sdk](https://github.com/NXPmicro/mcux-sdk) Github repo. Follow the description how to use the West tool
106-
to clone and update the mcuxsdk repo in [readme Overview section](https://github.com/NXPmicro/mcux-sdk#overview). Once done the armgcc eRPC examples can be found in
105+
Another way of getting NXP MCUXpressoSDK eRPC multicore and multiprocessor examples is using the [mcux-sdk](https://github.com/nxp-mcuxpresso/mcux-sdk) Github repo. Follow the description how to use the West tool
106+
to clone and update the mcuxsdk repo in [readme Overview section](https://github.com/nxp-mcuxpresso/mcux-sdk#overview). Once done the armgcc eRPC examples can be found in
107107

108108
mcuxsdk/examples/<board_name>/multicore_examples or in
109109

@@ -230,4 +230,4 @@ Repository on Github contains two main branches. __Master__ and __develop__. Cod
230230
---
231231
Copyright 2014-2016 Freescale Semiconductor, Inc.
232232

233-
Copyright 2016-2021 NXP
233+
Copyright 2016-2023 NXP

doxygen/Doxyfile.erpc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC API Reference"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "Rev. 1.9.1"
41+
PROJECT_NUMBER = "Rev. 1.10.0"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

doxygen/Doxyfile.erpcgen

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC Generator (erpcgen)"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "Rev. 1.9.1"
41+
PROJECT_NUMBER = "Rev. 1.10.0"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

erpc_c/infra/erpc_message_buffer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,16 @@ void MessageBuffer::Cursor::set(MessageBuffer *buffer)
113113

114114
uint8_t &MessageBuffer::Cursor::operator[](int index)
115115
{
116-
erpc_assert(((m_pos + index) >= m_buffer->get()) && ((uint16_t)(m_pos - m_buffer->get()) + index <= m_buffer->getLength()));
116+
erpc_assert(((m_pos + index) >= m_buffer->get()) &&
117+
((uint16_t)(m_pos - m_buffer->get()) + index <= m_buffer->getLength()));
117118

118119
return m_pos[index];
119120
}
120121

121122
const uint8_t &MessageBuffer::Cursor::operator[](int index) const
122123
{
123-
erpc_assert(((m_pos + index) >= m_buffer->get()) && ((uint16_t)(m_pos - m_buffer->get()) + index <= m_buffer->getLength()));
124+
erpc_assert(((m_pos + index) >= m_buffer->get()) &&
125+
((uint16_t)(m_pos - m_buffer->get()) + index <= m_buffer->getLength()));
124126

125127
return m_pos[index];
126128
}

erpc_c/infra/erpc_transport.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Transport
9191
*
9292
* @return Crc16* Pointer to CRC-16 object containing crc-16 compute function.
9393
*/
94-
virtual Crc16 *getCrc16() { return NULL; }
94+
virtual Crc16 *getCrc16(void) { return NULL; }
9595
};
9696

9797
/*!

erpc_c/infra/erpc_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
////////////////////////////////////////////////////////////////////////////////
2121

2222
//! @brief String version of eRPC.
23-
#define ERPC_VERSION "1.9.1"
23+
#define ERPC_VERSION "1.10.0"
2424
//! @brief Integer version of eRPC.
25-
#define ERPC_VERSION_NUMBER 10901
25+
#define ERPC_VERSION_NUMBER 11000
2626

2727
/*! @} */
2828

erpc_c/setup/erpc_transport_setup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ void erpc_transport_rpmsg_lite_tty_rtos_deinit(void);
279279
* @brief Create an Linux RPMSG endpoint transport.
280280
*
281281
* This function is using RPMSG endpoints based on this implementation:
282-
* github.com/NXPmicro/rpmsg-sysfs/tree/0aa1817545a765c200b1b2f9b6680a420dcf9171 .
282+
* github.com/nxp-mcuxpresso/rpmsg-sysfs/tree/0aa1817545a765c200b1b2f9b6680a420dcf9171 .
283283
*
284284
* When local/remote address is set to '-1', then default addresses will be used.
285285
* When type is set to '0', then Datagram model will be used, else Stream.

erpc_c/transports/erpc_mu_transport.cpp

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2021 NXP
2+
* Copyright 2017-2022 NXP
33
* Copyright 2021 ACRIOS Systems s.r.o.
44
* All rights reserved.
55
*
@@ -39,8 +39,7 @@ static MUTransport *s_mu_instance = NULL;
3939
void MUTransport::mu_tx_empty_irq_callback(void)
4040
{
4141
MUTransport *transport = s_mu_instance;
42-
if ((transport != NULL) &&
43-
(0U != (transport->m_muBase->CR & (1UL << (MU_CR_TIEn_SHIFT + MU_TR_COUNT - MU_REG_COUNT)))))
42+
if ((transport != NULL) && MU_IS_TX_EMPTY_FLAG_SET)
4443
{
4544
transport->tx_cb();
4645
}
@@ -49,8 +48,7 @@ void MUTransport::mu_tx_empty_irq_callback(void)
4948
void MUTransport::mu_rx_full_irq_callback(void)
5049
{
5150
MUTransport *transport = s_mu_instance;
52-
if ((transport != NULL) &&
53-
(0U != (transport->m_muBase->CR & (1UL << (MU_CR_RIEn_SHIFT + MU_RR_COUNT - MU_REG_COUNT)))))
51+
if ((transport != NULL) && MU_IS_RX_FULL_FLAG_SET)
5452
{
5553
transport->rx_cb();
5654
}
@@ -60,27 +58,17 @@ void MUTransport::mu_irq_callback(void)
6058
{
6159
MUTransport *transport = s_mu_instance;
6260
uint32_t flags;
63-
uint32_t rxFlags;
64-
uint32_t txFlags;
6561

6662
flags = MU_GetStatusFlags(transport->m_muBase);
6763

68-
// parse flags of full rx registers
69-
rxFlags = ((flags & MU_SR_RFn_MASK) >> MU_SR_RFn_SHIFT);
70-
rxFlags = (rxFlags >> (MU_RR_COUNT - MU_REG_COUNT));
71-
72-
// parse flags of empty tx registers
73-
txFlags = ((flags & MU_SR_TEn_MASK) >> MU_SR_TEn_SHIFT);
74-
txFlags = (txFlags >> (MU_TR_COUNT - MU_REG_COUNT));
75-
7664
// RECEIVING - rx full flag and rx full irq enabled
77-
if ((rxFlags & 0x1U) && (transport->m_muBase->CR & (1UL << (MU_CR_RIEn_SHIFT + MU_RR_COUNT - MU_REG_COUNT))))
65+
if ((flags & MU_SR_RX_MASK) && MU_IS_RX_FULL_FLAG_SET)
7866
{
7967
transport->rx_cb();
8068
}
8169

8270
// TRANSMITTING - tx empty flag and tx empty irq enabled
83-
if ((txFlags & 0x1U) && (transport->m_muBase->CR & (1UL << (MU_CR_TIEn_SHIFT + MU_TR_COUNT - MU_REG_COUNT))))
71+
if ((flags & MU_SR_TX_MASK) && MU_IS_TX_EMPTY_FLAG_SET)
8472
{
8573
transport->tx_cb();
8674
}
@@ -118,7 +106,7 @@ erpc_status_t MUTransport::init(MU_Type *muBase)
118106

119107
#if !ERPC_THREADS
120108
// enabling the MU rx full irq is necessary only for BM app
121-
MU_EnableInterrupts(m_muBase, (1UL << (MU_CR_RIEn_SHIFT + MU_RR_COUNT - MU_REG_COUNT)));
109+
MU_EnableInterrupts(m_muBase, MU_RX_INTR_MASK);
122110
#endif
123111

124112
NVIC_SetPriority(MU_IRQ, MU_IRQ_PRIORITY);
@@ -135,7 +123,7 @@ void MUTransport::rx_cb(void)
135123
{
136124
// the receive function has not been called yet
137125
// disable MU rx full interrupt
138-
MU_DisableInterrupts(m_muBase, (1UL << (MU_CR_RIEn_SHIFT + MU_RR_COUNT - MU_REG_COUNT)));
126+
MU_DisableInterrupts(m_muBase, MU_RX_INTR_MASK);
139127
m_newMessage = true;
140128
}
141129
else
@@ -166,7 +154,7 @@ void MUTransport::rx_cb(void)
166154
m_rxBuffer = NULL;
167155
#if !ERPC_THREADS_IS(NONE)
168156
// disable MU rx full interrupt in rtos-based blocking implementation
169-
MU_DisableInterrupts(m_muBase, (1UL << (MU_CR_RIEn_SHIFT + MU_RR_COUNT - MU_REG_COUNT)));
157+
MU_DisableInterrupts(m_muBase, MU_RX_INTR_MASK);
170158
m_rxSemaphore.putFromISR();
171159
#endif
172160
}
@@ -195,7 +183,7 @@ void MUTransport::tx_cb(void)
195183
if (m_txCntBytes >= m_txMsgSize)
196184
{
197185
// disable MU tx empty irq from the last tx reg
198-
MU_DisableInterrupts(m_muBase, (1UL << (MU_CR_TIEn_SHIFT + MU_TR_COUNT - MU_REG_COUNT)));
186+
MU_DisableInterrupts(m_muBase, MU_TX_INTR_MASK);
199187

200188
// unblock caller of the send function
201189
m_txBuffer = NULL;
@@ -224,7 +212,7 @@ erpc_status_t MUTransport::receive(MessageBuffer *message)
224212
m_rxBuffer = (uint32_t *)message->get();
225213

226214
// enable the MU rx full irq
227-
MU_EnableInterrupts(m_muBase, (1UL << (MU_CR_RIEn_SHIFT + MU_RR_COUNT - MU_REG_COUNT)));
215+
MU_EnableInterrupts(m_muBase, MU_RX_INTR_MASK);
228216

229217
// wait until the receiving is not complete
230218
#if !ERPC_THREADS_IS(NONE)
@@ -282,7 +270,7 @@ erpc_status_t MUTransport::send(MessageBuffer *message)
282270
if (m_txCntBytes < m_txMsgSize)
283271
{
284272
// enable MU tx empty irq from the last mu tx reg
285-
MU_EnableInterrupts(m_muBase, (1UL << (MU_CR_TIEn_SHIFT + MU_TR_COUNT - MU_REG_COUNT)));
273+
MU_EnableInterrupts(m_muBase, MU_TX_INTR_MASK);
286274
// wait until the sending is not complete
287275
#if !ERPC_THREADS_IS(NONE)
288276
(void)m_txSemaphore.get();

erpc_c/transports/erpc_mu_transport.hpp

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2020 NXP
2+
* Copyright 2017-2022 NXP
33
* All rights reserved.
44
*
55
*
@@ -47,6 +47,27 @@ extern "C" {
4747
#else
4848
#define MU_REG_COUNT (MU_RR_COUNT) /*!< Count of MU tx/rx registers to be used by this transport layer */
4949
#endif /* ERPC_TRANSPORT_MU_USE_MCMGR */
50+
51+
#if (defined(CPU_MIMXRT1189AVM8A_cm7) || defined(CPU_MIMXRT1189CVM8A_cm7) || defined(CPU_MIMXRT1189CVM8A_cm7) || \
52+
defined(CPU_MIMXRT1189AVM8A_cm33) || defined(CPU_MIMXRT1189CVM8A_cm33) || defined(CPU_MIMXRT1189CVM8A_cm33))
53+
#define MU_TX_SHIFT (1UL << (MU_REG_COUNT - 1U))
54+
#define MU_RX_SHIFT (1UL << (MU_REG_COUNT - 1U))
55+
#define MU_RX_INTR_MASK (MU_RX_INTR(MU_RX_SHIFT))
56+
#define MU_TX_INTR_MASK (MU_TX_INTR(MU_TX_SHIFT))
57+
#define MU_IS_TX_EMPTY_FLAG_SET (0U != (transport->m_muBase->TCR & MU_TX_SHIFT))
58+
#define MU_IS_RX_FULL_FLAG_SET (0U != (transport->m_muBase->RCR & MU_RX_SHIFT))
59+
#define MU_SR_TX_MASK (1UL << (20U + (MU_REG_COUNT - 1U)))
60+
#define MU_SR_RX_MASK (1UL << (24U + (MU_REG_COUNT - 1U)))
61+
#else
62+
#define MU_TX_SHIFT (1UL << (MU_CR_TIEn_SHIFT + MU_TR_COUNT - MU_REG_COUNT))
63+
#define MU_RX_SHIFT (1UL << (MU_CR_RIEn_SHIFT + MU_RR_COUNT - MU_REG_COUNT))
64+
#define MU_RX_INTR_MASK (MU_RX_SHIFT)
65+
#define MU_TX_INTR_MASK (MU_TX_SHIFT)
66+
#define MU_IS_TX_EMPTY_FLAG_SET (0U != (transport->m_muBase->CR & MU_TX_SHIFT))
67+
#define MU_IS_RX_FULL_FLAG_SET (0U != (transport->m_muBase->CR & MU_RX_SHIFT))
68+
#define MU_SR_TX_MASK (1UL << (MU_SR_TEn_SHIFT + MU_TR_COUNT - MU_REG_COUNT))
69+
#define MU_SR_RX_MASK (1UL << (MU_SR_RFn_SHIFT + MU_RR_COUNT - MU_REG_COUNT))
70+
#endif
5071
////////////////////////////////////////////////////////////////////////////////
5172
// Classes
5273
////////////////////////////////////////////////////////////////////////////////
@@ -176,15 +197,15 @@ class MUTransport : public Transport
176197
*/
177198
void tx_cb(void);
178199

179-
volatile bool m_newMessage; /*!< Flag used in function hasMessage() to inform server by polling function that
180-
message is ready for receiving */
181-
uint32_t m_rxMsgSize; /*!< Size of received message - count of bytes to must be received to complete currently
182-
received message */
183-
uint32_t m_rxCntBytes; /*!< Count of currently received bytes of message */
200+
volatile bool m_newMessage; /*!< Flag used in function hasMessage() to inform server by polling function that
201+
message is ready for receiving */
202+
volatile uint32_t m_rxMsgSize; /*!< Size of received message - count of bytes to must be received to complete
203+
currently received message */
204+
uint32_t m_rxCntBytes; /*!< Count of currently received bytes of message */
184205
uint32_t *volatile m_rxBuffer; /*!< Pointer to buffer to which is copied data from MU registers during receiving */
185-
uint32_t m_txMsgSize; /*!< Size of transmitted message - count of bytes to must be transmitted to send complete
186-
message */
187-
uint32_t m_txCntBytes; /*!< Count of currently received bytes of message */
206+
volatile uint32_t m_txMsgSize; /*!< Size of transmitted message - count of bytes to must be transmitted to send
207+
complete message */
208+
uint32_t m_txCntBytes; /*!< Count of currently received bytes of message */
188209
uint32_t *volatile m_txBuffer; /*!< Pointer to buffer from which is copied data to MU registers during sending */
189210

190211
#if !ERPC_THREADS_IS(NONE)

0 commit comments

Comments
 (0)