We are developing an application on the nRF52840 kit with SDK 15.2. We are using Keil as compiler. I have started developmet my application with the example ble_app_cscs. In this example I added the libraries for use the serial, I2C, timer and GPIO. After that, when I start the application and I connecting the nRF52840 device with app and I receiveng data from UART, after a random time the serial stops to work, while the I2C, GPIO and timer works correctly.The firmare is running and it communicate with the App but the function that receive from the Uart return always no data. The data continue to come from Uart, I can see them with oscylloscope, but the receive function say always no data. This happen after a random time, it can be immediatly or after some minutes.When te uart stops to receive data, the error that it return is the numer 13 : timeout.If I use the BLE or the UART separatly they work fine. I attached all project.Do you have any idea about this problem?
Which function is returning timeout error? What device are you receiving UART data from?
The nrf_serial_read function returns the timeout error . I receiving UART data from RFID reader.
It seems that you do not check the error code returned from nrf_serial_read function calls. Are you sure there is no other error codes returned earlier in application execution that can explain the timeout error? You should always check errors returned from functions and perform appropriate actions if the error code is not success.
I have checked error with the debugger, there is another way to check it ?
How can you check the error code from every call using the debugger? The error code is not static, it can change from call to call, depending on the state of library/driver/peripheral/etc. Normal procedure is to assign the return code to a variable, err_code, and pass this err_code to APP_ERROR_CHECK() macro. When an error occurs, the application will jump to error handler, app_error_handler. You can then set a breakpoint in the error handler and you will catch every error code.