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

Building a new project using ANT+

Hi,

I'm trying to build a working example of an aplication that uses the ANT+ softdevice (either s210 or s212). I already found out that the PCA10028 and PCA10031 (my board) have the same chipset, so the examples for 28 should work for 31 assuming I change the board name in the compiler/linker settings (see this post: https://devzone.nordicsemi.com/f/nordic-q-a/8207/ble_peripheral-on-pca10031-dongle#post-id-45007). Is that correct?

The newest example of an application that uses ant+ that I could find is based on SDK10.0.0. I managed to compile it after some terrible problems but it doesn't seem to work and I cant fix the debug (again). The application is the HRM_RX. The main problem is, that it won't load with the soft device on 

ERROR: FLASH DOWNLOAD FAILED: CORTEX M0

When I delete the softdevice it won't run, it hangs searching for a softdevice, I think. The solution could be, shifting the start of the program memory above the softdevice, but it doesn't seem to work me either... duh (see here: https://devzone.nordicsemi.com/f/nordic-q-a/9/why-do-i-get-error-flash-download-failed-cortex-m0-when-downloading-a-project-from-keil)

questions:

1.Can you help me fix the above problems?

2. Is there a way to migrate an app for newer board, that uses a newer SDK to the older board (10031)?

3. Can you provide me with an example of a working app for ANT+ (hr-rx would be perfect) fot 10031 (NRF51 dongle) using the newest SDK?

Thanks

Parents
  • Addressing the part 1 - problems with the app from SDK10:

    1. I managed to find a way to load the code and run it on the device. You have to first load the soft device that is provided with the example selecting the target corresponding to it: flash_s20_nrf51422_5.0.0_softdevice and then build and load the application. It cannot be done the other way around, because loading the softdevice clear the whole memory. Also the softdevice cannot be loaded in another way, for example by loading it through NRF Connect Programmer. At least it didn't work for me.

    2. The UART doesn't work for me. Tried nrfjprog.exe --eraseall, but it doesn't do anything. The UART is set up in the exmaple, in the app_trace_init() function:

    void app_trace_init(void)
    {
    uint32_t err_code = NRF_SUCCESS;
    const app_uart_comm_params_t comm_params =
    {
    RX_PIN_NUMBER,
    TX_PIN_NUMBER,
    RTS_PIN_NUMBER,
    CTS_PIN_NUMBER,
    APP_UART_FLOW_CONTROL_DISABLED,
    false,
    UART_BAUDRATE_BAUDRATE_Baud38400
    };

    APP_UART_FIFO_INIT(&comm_params,
    UART_RX_BUF_SIZE,
    UART_TX_BUF_SIZE,
    uart_error_handle,
    APP_IRQ_PRIORITY_LOW,
    err_code);
    UNUSED_VARIABLE(err_code);
    }

    The connected Termite App configured to the above parameters doesn't show anything Disappointed

    3. I tried to debug the application by going through it line-by-line and it stops on this spot and goes into the hard_fault handler:

    softdevice_handler.c, line 253

    // Enable BLE event interrupt (interrupt priority has already been set by the stack).
    return sd_nvic_EnableIRQ(SOFTDEVICE_EVT_IRQ);

    SOFTDEVICE_EVT_IRQ is confugured as 21

    What's wrong? :/

    PS still hoping to get help with the topics 2 and from the original question Slight smile

    Thanks

Reply
  • Addressing the part 1 - problems with the app from SDK10:

    1. I managed to find a way to load the code and run it on the device. You have to first load the soft device that is provided with the example selecting the target corresponding to it: flash_s20_nrf51422_5.0.0_softdevice and then build and load the application. It cannot be done the other way around, because loading the softdevice clear the whole memory. Also the softdevice cannot be loaded in another way, for example by loading it through NRF Connect Programmer. At least it didn't work for me.

    2. The UART doesn't work for me. Tried nrfjprog.exe --eraseall, but it doesn't do anything. The UART is set up in the exmaple, in the app_trace_init() function:

    void app_trace_init(void)
    {
    uint32_t err_code = NRF_SUCCESS;
    const app_uart_comm_params_t comm_params =
    {
    RX_PIN_NUMBER,
    TX_PIN_NUMBER,
    RTS_PIN_NUMBER,
    CTS_PIN_NUMBER,
    APP_UART_FLOW_CONTROL_DISABLED,
    false,
    UART_BAUDRATE_BAUDRATE_Baud38400
    };

    APP_UART_FIFO_INIT(&comm_params,
    UART_RX_BUF_SIZE,
    UART_TX_BUF_SIZE,
    uart_error_handle,
    APP_IRQ_PRIORITY_LOW,
    err_code);
    UNUSED_VARIABLE(err_code);
    }

    The connected Termite App configured to the above parameters doesn't show anything Disappointed

    3. I tried to debug the application by going through it line-by-line and it stops on this spot and goes into the hard_fault handler:

    softdevice_handler.c, line 253

    // Enable BLE event interrupt (interrupt priority has already been set by the stack).
    return sd_nvic_EnableIRQ(SOFTDEVICE_EVT_IRQ);

    SOFTDEVICE_EVT_IRQ is confugured as 21

    What's wrong? :/

    PS still hoping to get help with the topics 2 and from the original question Slight smile

    Thanks

Children
No Data
Related