Skip to content

Conversation

@ablaylock
Copy link

No description provided.

@Hadatko Hadatko self-requested a review October 5, 2017 11:25
@Hadatko Hadatko added the bug label Oct 5, 2017
Copy link
Member

@Hadatko Hadatko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change to compile under C++03 and remove application specific transport settings.


static volatile bool s_isTransferReceiveCompleted = false;
static volatile bool s_isTransferSendCompleted = false;
constexpr auto kStatus_Success = ARM_DRIVER_OK;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not use c++11 specific code.

m_uartDrv->Control(ARM_USART_CONTROL_TX, 1);
m_uartDrv->Control(ARM_USART_CONTROL_RX, 1);

return status != kStatus_Success ? kErpcStatus_InitFailed : kErpcStatus_Success;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ARM_DRIVER_OK here instead of kStatus_Success. kStatus_Success is redundant from older times.

I would also change status variable type from erpc_status_t to int32_t as in CMSIS driver is used.

erpc_status_t status = (*m_uartDrv).Initialize(TransferCallback);
(*m_uartDrv).PowerControl(ARM_POWER_FULL);

/*Configure the USART to 9600 Bits/sec */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These settings are application specific and should be set before calling constructor of this class.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that Control configuration has any guarantee of functioning before Initialize is called it seems to me that maybe the m_uartDrv should be initialized and then passed to the constructor removing the need for init.

@Hadatko
Copy link
Member

Hadatko commented Oct 9, 2017

We also need sign Contributor agreements from you. Could you contact me on [email protected]?

@Hadatko
Copy link
Member

Hadatko commented Dec 20, 2017

I updated code as i mentioned. Still need solve init function.

@Hadatko Hadatko force-pushed the develop branch 2 times, most recently from f92ea55 to f88e6e0 Compare June 13, 2018 08:08
@MichalPrincNXP
Copy link
Member

It seems this PR is already obsolete and could be closed. @ablaylock , @Hadatko , could you confirm, please? Thanks.

jcdr added a commit to jcdr/erpc that referenced this pull request Oct 9, 2020
…length

This was spotted on a SAML21 controller:
#0  usart_sync_read (io_descr=0x200006dc <USART_0>, buf=0x20000378 <s_msgFactory+8> , length=0) at ../hal/src/hal_usart_sync.c:271
EmbeddedRPC#1  0x000001e0 in io_read (io_descr=0x200006dc <USART_0>, buf=0x20000378 <s_msgFactory+8> , length=0) at ../hal/src/hal_io.c:62
EmbeddedRPC#2  0x0000e3da in erpc::UsartSyncTransport::underlyingReceive (this=0x20000578 <s_transport>, data=0x20000378 <s_msgFactory+8> , size=0) at ../erpc_usart_sync_transport.cpp:29
EmbeddedRPC#3  0x0000dd96 in erpc::FramedTransport::receive (this=0x20000578 <s_transport>, message=0x200026c4) at ../erpc_framed_transport.cpp:63
EmbeddedRPC#4  0x0000d7da in erpc::SimpleServer::runInternalBegin (this=0x20000340 <s_server>, codec=0x200026c0, buff=..., msgType=@0x200026bf: 32, serviceId=@0x200026b8: 536880832, methodId=@0x200026b4: 536871784, sequence=@0x200026b0: 536871784) at ../erpc_simple_server.cpp:64
EmbeddedRPC#5  0x0000d72a in erpc::SimpleServer::runInternal (this=0x20000340 <s_server>) at ../erpc_simple_server.cpp:42
EmbeddedRPC#6  0x0000d99e in erpc::SimpleServer::poll (this=0x20000340 <s_server>) at ../erpc_simple_server.cpp:223
EmbeddedRPC#7  0x0000d44e in erpc_server_poll () at ../erpc_server_setup.cpp:97
EmbeddedRPC#8  0x00006fa4 in main () at ../main.c:72

The UART need to be restarted to recover from a such error, for ex.:
    if (erpc_server_poll()) {
        usart_sync_disable(&USART_0);
        usart_sync_enable(&USART_0);
    }
@MichalPrincNXP
Copy link
Member

Closing as already being obsolete.

MichalPrincNXP added a commit that referenced this pull request Feb 2, 2022
- use ./build_all.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants