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

ble_ant_app_hrm - How to start?

Keil uVision 5. SDK 7, SD310 Version 2, PCA10028 board

I'm NEW to ANT. I have running ble_ant_app_hrm example. The code compiles with no errors or warnings, loads, and runs (I'm using the debug mode of Keil with the on board Seggar Chip). I can connect through the master control panel to the BLE side of this example. It's the ANT side that I'm having problems with.

1- I have ANTware II open with a USB ANT+ dongle. Antware finds the USB dongle, but I have no idea how to get the dongle and my board to connect and talk. I do not see me show up in ANTware.

2- I can put breakpoints in the code, but any variable I add to the watch window gives me a "cannot evaluate" in the value window. Why can I not see the values? I have not had this problem when working in SDK 6 and S110 stack.

3- The function on_ant_evt(...). I can put a break point on the switch line. However p_ant_event, shows as "cannot evaluate" in the Keil watch window. The code in the switch brackets is non-reachable. When in debug mode, Keil darkens the left margin of the code window, that shows which lines of code can be executed. Everything after the switch statement is not showing as being executable. What's going on?

Going through the ble_ant_app_hrm example, it non of my ANT calls are being included in the compile - If it has to do with ANT it's not called.

static void on_ant_evt(ant_evt_t * p_ant_evt)
{
    if (p_ant_evt->channel == ANT_HRMRX_ANT_CHANNEL)
    {
        switch (p_ant_evt->event)      //after this line no code is executable until the last bracket
        {
            case EVENT_RX:
                on_ant_evt_rx(p_ant_evt);
                break;

            case EVENT_CHANNEL_CLOSED:
                on_ant_evt_channel_closed();
                break;

            default:
                // No implementation needed.
                break;
        }
    }
}                               //Code execution resumes here.
Parents
  • Hi

    There are number of parameters that have to match in the ble_ant_app_hrm example and the ANTWareII GUI. The parameters in question are shown below

    image description

    So you must define the following hash defines in the main file in the ble_ant_app_hrm accordingly, e.g.:

    #define ANT_HRMRX_DEVICE_TYPE           1
    #define ANT_HRMRX_DEVICE_NUMBER         33
    #define ANT_HRMRX_TRANS_TYPE            1
    #define ANTPLUS_RF_FREQ                 0x42
    #define ANT_HRMRX_NETWORK_KEY           {0,0,0,0,0,0,0,0}
    

    If you now connect on the BLE side with MCP and enable services, you should see the ANT+ data appear in MCP

Reply
  • Hi

    There are number of parameters that have to match in the ble_ant_app_hrm example and the ANTWareII GUI. The parameters in question are shown below

    image description

    So you must define the following hash defines in the main file in the ble_ant_app_hrm accordingly, e.g.:

    #define ANT_HRMRX_DEVICE_TYPE           1
    #define ANT_HRMRX_DEVICE_NUMBER         33
    #define ANT_HRMRX_TRANS_TYPE            1
    #define ANTPLUS_RF_FREQ                 0x42
    #define ANT_HRMRX_NETWORK_KEY           {0,0,0,0,0,0,0,0}
    

    If you now connect on the BLE side with MCP and enable services, you should see the ANT+ data appear in MCP

Children
No Data
Related