This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bootloader / NVIC_EnableIRQ(UART0_IRQn) halts when porting from nrf6310 to pca10001

Hi,

Can anybody help me, thanks in advance.

What is wrong with NVIC_EnableIRQ(UART0_IRQn) - the execution halts when calling this macro ?

I'm working with Keil.

I Copied bootloader project from C:\Keil_v5\ARM\Device\Nordic\nrf51822\Board\nrf6310\device_firmware_updates\bootloader under pca10001: C:\Keil_v5\ARM\Device\Nordic\nrf51822\Board\pca10001\device_firmware_updates\bootloader In C/C++ tab I replaced in Preprocessor Symbols/Define: BOARD_6310 to BOARD_PCA1001. (All definitions: NRF51, BOARD_PCA10001,NRF51,DEBUG_NRF_USER, BOOTLOADER_BANKED BLE_STACK_SUPPORT_REQD).

I replaced nrf6310 defines to be suitable for pca10001 - leds nad button etc.

I changed Target: IROM1: Start : from 0x3C800 to 0x14000 and Size: from 0x3400 to 0x2B000.

Everything went ok to NVIC_SetPriority function in app_uart_init but the execution halts in NVIC_EnableIRQ(UART0_IRQn):

uint32_t app_uart_init(const app_uart_comm_params_t * p_comm_params, app_uart_buffers_t * p_buffers, app_uart_event_handler_t event_handler, app_irq_priority_t irq_priority, uint16_t * p_app_uart_uid) {

... NVIC_SetPriority(UART0_IRQn, irq_priority);

    simple_uart_putstring("\n\r app_uart_init,NVIC_SetPriority done");   
   
    sprintf(str,"%lu", UART0_IRQn);
    simple_uart_putstring("\n\r app_uart_init,UART0_IRQn:");   
    simple_uart_putstring(str);

    sprintf(str,"%lu", irq_priority);
    simple_uart_putstring("\n\r app_uart_init,irq_priority:");   
    simple_uart_putstring(str);
   
    NVIC_EnableIRQ(UART0_IRQn);

    simple_uart_putstring("\n\r app_uart_init,NVIC_EnableIRQ done");
   
return NRF_SUCCESS;

}

app_uart_init,NVIC_SetPriority

The whole log print is here:

Start: -------- main(void) started --------- test: nrf_gpio_pin_read(EVAL_BOARD_BUTTON_0) == 0 bootloader_is_pushed = true nrf_gpio_pin_set bootloader_dfu_start, storage_params.block_size:12 bootloader_dfu_start, PSTORAGE_MIN_BLOCK_SIZE:16 bootloader_dfu_start, PSTORAGE_MAX_BLOCK_SIZE:1024 bootloader_dfu_start:pstorage_init done, error_code:0 pstorage_register, begin pstorage_register, VERIFY_MODULE_INITIALIZED done pstorage_register, NULL_PARAM_CHECK(p_module_param) done pstorage_register, NULL_PARAM_CHECK(p_block_id) done pstorage_register, NULL_PARAM_CHECK(p_module_param->cb) done pstorage_register, p_module_param->block_size:12 pstorage_register, BLOCK_SIZE_CHECK(p_module_param->block_size) SKIPPED !!! pstorage_register: BLOCK_COUNT_CHECK(p_module_param->block_count, p_module_param->block_size), done pstorage_register: after if (!((p_module_param->block_size % sizeof(uint32_t)) == 0)) pstorage_register: arter if (m_next_app_instance == PSTORAGE_MAX_APPLICATIONS) pstorage_register: do while (total_size >= PSTORAGE_FLASH_PAGE_SIZE) done pstorage_register, end bootloader_dfu_start:pstorage_register done, error_code:0 bootloader_dfu_start:dfu_init done, error_code:0 dfu_transport_update_start, begin dfu_transport_update_start, data_queue_init done dfu_transport_update_start, dfu_register_callback done hci_transport_open:app_timer_create done, error_code:0 hci_transport_open:hci_mem_pool_open done, error_code:0 hci_slip_open,m_current_state:0 slip_uart_open,begin slip_uart_open,comm_params.baud_rate:10309632 slip_uart_open,comm_params.cts_pin_no:10 slip_uart_open,comm_params.rts_pin_no:8 slip_uart_open,comm_params.rx_pin_no:12 slip_uart_open,comm_params.tx_pin_no:9 slip_uart_open,comm_params.flow_control:1 app_uart_init,begin app_uart_init,p_comm_params->use_parity:0 app_uart_init, else if (p_comm_params->flow_control == APP_UART_FLOW_CONTROL_ENABLED) uart_standard_flow_control_init, begin uart_standard_flow_control_init,NRF_UART0->ENABLE:4 uart_standard_flow_control_init,NRF_UART0->CONFIG :1 uart_standard_flow_control_init,p_comm_params->cts_pin_no:10 uart_standard_flow_control_init,NRF_UART0->PSELCTS:10 uart_standard_flow_control_init,NRF_UART0->PSELRTS:8 uart_standard_flow_control_init,NRF_UART0->TASKS_STARTTX:0 uart_standard_flow_control_init, end app_uart_init,before: Enable UART interrupt app_uart_init,NVIC_ClearPendingIRQ done app_uart_init,NVIC_SetPriority done app_uart_init,UART0_IRQn:2 app_uart_init,irq_priority:3

Best regards, Devtim

Related