Hi.
I use nrf52840.
sdk nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_hrs_freertos.
Error calling xQueueReceive for the second time.
Here is the code and log:
if (pdPASS != xTaskCreate(lte_thread, "LTE", 768, NULL, 3, &m_uart_thread))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
void lte_thread(void * arg) { int8_t ret_code; lte_msg_t pxRxdMessage; UNUSED_PARAMETER(arg); LTE_QueueHandle = xQueueCreate( QUEUE_MSG_LENGTH, sizeof( struct message *) ); if( LTE_QueueHandle == 0 ) { NRF_LOG_ERROR("Create LTE Queue fail"); } nrf_gpio_cfg_output( LTE_KEY_PIN); lte_PowerOn(); lte_evt = LTE_POWER_ON; lte_timer_count = 7; while (1) { NRF_LOG_INFO("lte thread."); NRF_LOG_FLUSH(); if( pdTRUE == xQueueReceive( LTE_QueueHandle, (void*)&pxRxdMessage, portMAX_DELAY ) ) { switch( pxRxdMessage.evt ) { case LTE_CMD_GET_AT: lte_cmd_AT(); lte_cmd_GSN(); lte_cmd_CCID(); break; case LTE_CMD_GET_NETWORK: lte_cmd_Get_Network(); break; } memset(&pxRxdMessage,0,sizeof(lte_msg_t)); } } }
<info> app: lte thread.
<info> app: ----RES OK [OK
]
<info> app: AT 1
<info> app: ----RES data:
<info> app: 38 36 34 34 37 35 30 34|86447504
<info> app: 39 39 39 39 39 35 35 |9999955
<info> app: IMEI 1
<info> app: ----RES data:
<info> app: 2B 43 43 49 44 3A 20 38|+CCID: 8
<info> app: 39 38 36 30 36 32 30 32|98606202
<info> app: 32 30 30 32 30 35 39 34|20020594
<info> app: 39 38 37 |987
<info> app: ICCID 1
<info> app: lte thread.
<error> hardfault: HARD FAULT at 0x20009834
<error> hardfault: R0: 0x2000A818 R1: 0x20008BEC R2: 0x2000A7EC R3: 0x00000000
<error> hardfault: R12: 0xA5A5A5A5 LR: 0x0002EE8F PSR: 0x2000A82C
<error> hardfault: Cause: The processor has attempted an illegal load of EXC_RETURN to the PC, as a result of an invalid context, or an invalid EXC_RETURN value.