-
Notifications
You must be signed in to change notification settings - Fork 241
Improved CMSIS USART compatibility #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hadatko
left a comment
There was a problem hiding this 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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
We also need sign Contributor agreements from you. Could you contact me on [email protected]? |
|
I updated code as i mentioned. Still need solve init function. |
f92ea55 to
f88e6e0
Compare
|
It seems this PR is already obsolete and could be closed. @ablaylock , @Hadatko , could you confirm, please? Thanks. |
…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); }
|
Closing as already being obsolete. |
No description provided.