If UART is enabled, it does not work.

HI

I basically define uart_init(); in Main.

And use DEBUG below to decide whether to use UART.

#ifndef DEBUG

NRF_UART0->TASKS_STOPRX= 1;
NRF_UART0->ENABLE = 0;
//NRF_UARTE0->TASKS_STOPTX = 1;

NRF_UART0->TASKS_STOPRX= 1;
NRF_UART0->ENABLE = 0;

#endif

After using the above method normally,

If you suddenly #define DEBUG, nothing happens.
Of course, if you delete #define DEBUG again, it will operate normally.

If you connect J-LINK and run it, it will operate normally.

Even if you declare #define DEBUG...

If you remove JLink in that state, it will not operate properly again.

Why is this like this?

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

We analyzed an additional phenomenon that occurred today.

Movements can be divided into two types.

1) If J-Link is not connected => does not operate 100%

2) Debugging by connecting J-Link

It operates normally until the key is entered, but when the key is entered, it stops at the point captured below.

*lint -save -e14 */
/**
* Function is implemented as weak so that it can be overwritten by custom application error handler
* when needed.
*/
__WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
{
__disable_irq();
NRF_LOG_FINAL_FLUSH();

printf("Fatal error ");
#ifndef DEBUG
NRF_LOG_ERROR("Fatal error");
#else
switch (id)
{
#if defined(SOFTDEVICE_PRESENT) && SOFTDEVICE_PRESENT
case NRF_FAULT_ID_SD_ASSERT:
printf("SOFTDEVICE: ASSERTION FAILED");
//NRF_LOG_ERROR("SOFTDEVICE: ASSERTION FAILED");
break;
case NRF_FAULT_ID_APP_MEMACC:
printf("SOFTDEVICE: INVALID MEMORY ACCESS");
//NRF_LOG_ERROR("SOFTDEVICE: INVALID MEMORY ACCESS");
break;
#endif
case NRF_FAULT_ID_SDK_ASSERT:
{
assert_info_t * p_info = (assert_info_t *)info;
printf("ASSERTION FAILED at %s:%u", p_info->p_file_name, p_info->line_num);


break;
}
case NRF_FAULT_ID_SDK_ERROR:
{
error_info_t * p_info = (error_info_t *)info;

printf("ERROR %u [%s] at %s:%u\r\nPC at: 0x%08x",
p_info->err_code,
nrf_strerror_get(p_info->err_code),
p_info->p_file_name,
p_info->line_num,
pc);
/* NRF_LOG_ERROR("ERROR %u [%s] at %s:%u\r\nPC at: 0x%08x",
p_info->err_code,
nrf_strerror_get(p_info->err_code),
p_info->p_file_name,
p_info->line_num,
pc);
*/
printf("End of error report");
// NRF_LOG_ERROR("End of error report");
break;
}
default:
printf("UNKNOWN FAULT at 0x%08X", pc);
//NRF_LOG_ERROR("UNKNOWN FAULT at 0x%08X", pc);
break;
}
#endif

NRF_BREAKPOINT_COND;
// On assert, the system can only recover with a reset.

#ifndef DEBUG
printf("System reset");
//NRF_LOG_WARNING("System reset");
NVIC_SystemReset();
#else
app_error_save_and_stop(id, pc, info);
#endif // DEBUG
}
/*lint -restore */

When searching for UART NRF_FAULT_ID_SDK_ERROR error 0x0c, the following information appears.

: https://devzone.nordicsemi.com/f/nordic-q-a/88709/sdk-17-1-uart-example-exit-with-error_code-0x0c-or-0x4001/371560

The voltage of the UART's RX pin is not at high level, so I took a picture and found that the board with the problem currently has the RX pin at low level.

Since RX was low, I removed the RX connection between CP2102 and nRf52832 and measured it on CP2102.

If you remove the RX connection connected to nRF52832 and take TX at CP2102 standard, it is normally at High level.

Additionally, I checked to see if the UART-related port level was set in the port settings section, but it was not there.

=> In conclusion, the cause was that the wire of the RX pin was boiled, as shown in the last picture.

However, other MCUs do not have an operation definition for the high level of the RX pin, but nRF52 has an operation definition for rx... This is where there was confusion.

Parents Reply Children
No Data
Related