Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Running ANT examples on PCA10056

Hello everyone,

I would like to run the ANT examples "ant continuous scanning controller" and "ant scan and forward" on my nRF52840DK(PCA10056) boards however it only supports the older PCA10040 board.

How would I go about changing these to support the newer PCA10056?

I have already downloaded softdevice S340 since this is used by the "ant shared channel" example that does support pca10056.

Best regards,

Sam

  • Hello,

    PCA10040 means the example project is setup to be used with the nRF52-DK, which is using an nRF52832.

    PCA10056 means the example project is setup to be used with the nRF52840-DK, which is using an nRF52840.

    There are different flash, ram, and peripherals between the two different MCU's, so (as you experience) you can't run an pca10040 project directly on a pca10056.

    My suggestion is take ant project made for the pca10056 (e.g. examples\ant\ant_message_types\master\pca10056), and replace the main.c and sdk_config.h file from the pca10040 project (e.g. \examples\ant\ant_continuous_scanning_controller).

    In addition you will need to include all the files and paths from the pca10040 project to the pca10056 project. Presuming you are using SES as IDE in this case, then it may be easiest to open the two .emProject in a text editor and simply copy the various <folder Name="nnn"> and file names from the pca10040 to the pca10056 project.

    Hope that helps,
    Kenneth

  • Hi Kenneth,

    Thank you for helping me.

    I am using Segger and have followed your steps. 

    It has builded successfully, however the converted application doesn't work yet. (I'm working to port "ant_continuous_scanning_controller" first).

     

    When I debug I run into the folllowing issues before jumping into the "int main(void)" loop:

    "Unknown function at 0xFFFFFFFE"

    Unknown function at 0xFFFFFFFE

    Output window:

    Preparing target for download
    Executing Reset script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ‘ant_msg_types_master_pca10056_s340.elf’ to J-Link
    Programming 20.2 KB of addresses 00031000 — 00036109
    Programming 0.0 KB of addresses 0003610c — 0003614b
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    Download successful
    Stopped by vector catch

     

    Do you have any idea what this unknown function could be or how I can find out what it is? This one's a bit tricky to debug.

    EDIT:

    Fixed it.

    Forgot to load in the SoftDevice S340

    Cheers,

    Sam

  • Maybe double check that the original PCA10056 example work as intended first?

    Kenneth

  • Hi Kenneth,

    I found the issue to the unknown function.

    I'd erased S340 from the board in my debugging process and therefore needed to write it back on my DK

    Understandably so the program didn't know what to do.

     

    The "ant_continuous_scanning_controller" has been ported successfully to my PCA10056 and is working as intended.

    Cheers,

    Sam

  • -- UPDATE --

    I have ported over "ant_scan_and_forward" as well, by using the "ant_message_types" example as a base

     

    So when porting over the scan and forward example I ran into an issue that after sending my on/off command the board's LEDs would turn on very shortly and then instantly off again.

    The default state would always be: LED1 flickers on/off very fast while LED2,3,4 would be off.

     

    This was because old code from my base project "ant_message_types" runs even though it looks to never be called in my main.c

    The file "ant_message_types_master.c" has an NRF_SDH_ANT_OBSERVER present that is initialized on startup and commenting this one out seems to fix the bug. Removing ant_message_types_master.c would cause errors in my file structure, but commenting the entire class works as well.

    Cheers,

    Sam

Related