Hi,
I am trying to run logging and SMP over a single UART interface, which should be supported with CONFIG_UART_CONSOLE_MCUMGR.
However, the responses seem to be disturbed by logging functions (maybe when logging is taking place while the SMP request is coming in).
I use an uBlox Nora-B126 incorporating an nRF5340 and VS Code with nRF Connect SDK 2.3.0. To reproduce, I use these prj.conf options:
CONFIG_LOG=y CONFIG_LOG_BACKEND_UART=y CONFIG_UART_CONSOLE_MCUMGR=y CONFIG_MCUMGR=y CONFIG_MCUMGR_SMP_UART=y CONFIG_MCUMGR_CMD_OS_MGMT=y CONFIG_OS_MGMT_ECHO=y
with a simple main like this:
int main(void) { while(1) { LOG_INF("test logging output"); k_sleep(K_MSEC(100)); } }
To test the SMP client, I use mcumgr with a simple "echo hello". Usually I receive the answer and when montoring the traffic I can see both the request and response going over the serial interface:
Request:
06 09 41 42 4D 43 41 41 41 4A 41 41 42 44 41 4B 46 68 5A 47 56 6F 5A 57 78 73 62 78 6C 41 0A |
..ABMCAAAJAABDAK FhZGVoZWxsbxlA. |
Response:
06 09 41 42 51 44 41 41 41 4B 41 41 42 44 41 4C 39 68 63 6D 56 6F 5A 57 78 73 62 2F 2F 65 34 51 3D 3D 0A |
..ABQDAAAKAABDAL 9hcmVoZWxsb//e4Q ==. |
Sometimes however, the response is incomplete (first few bytes are missing) as this:
41 41 41 4B 41 41 43 65 41 4C 39 68 63 6D 56 6F 5A 57 78 73 62 2F 2B 4C 57 51 3D 3D 0A 5B 30 30 3A 30 39 3A 35 32 2E 39 31 37 2C 38 31 36 5D 20 1B 5B 30 6D 3C 69 6E 66 3E 20 6D 61 69 6E 3A 20 74 65 73 74 20 6C 6F 67 1B 5B 30 6D 0D 0A 5B 30 30 3A 30 39 3A 35 33 2E 30 31 37 2C 39 31 33 5D 20 1B 5B 30 6D 3C 69 6E 66 3E 20 6D 61 69 6E 3A 20 74 65 73 74 20 6C 6F 67 1B 5B 30 6D 0D 0A 5B 30 30 3A 30 39 3A 35 33 2E 31 31 37 2C 39 38 30 5D 20 1B 5B 30 6D 3C 69 6E 66 3E 20 6D 61 69 6E 3A 20 74 65 73 74 20 6C 6F 67 1B 5B 30 6D 0D 0A 5B 30 30 3A 30 39 3A 35 33 2E 32 31 38 2C 30 34 38 5D 20 1B 5B 30 6D 3C 69 6E 66 3E 20 6D 61 69 6E 3A 20 74 65 73 74 20 6C 6F 67 1B 5B 30 6D 0D 0A 5B 30 30 3A 30 39 3A 35 33 2E 33 31 38 2C 31 |
AAAKAACeAL9hcmVo ZWxsb/+LWQ==.[00 :09:52.917,816] .[0m<inf> main: test log.[0m..[0 0:09:53.017,913] .[0m<inf> main: test log.[0m..[ 00:09:53.117,980 ] .[0m<inf> main : test log.[0m.. [00:09:53.218,04 8] .[0m<inf> mai n: test log.[0m. .[00:09:53.318,1 |
Is this a known problem or is there something wrong with the configuration?
Best regards,
Lars