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

nRF52832 - How to merge ANT and Peripheral examples?

Hello, I'm developing firmware for a custom PCB with an nRF52832 chip. I've implemented almost all of the peripheral functionality I need (including TWI, GPIO, GPIOTE, delay, power, and SAADC) via the "template_project" example.

I've also implemented the functionality I need from the "ant_broadcast/tx" example in order to connect to an external device via the S212 softdevice.

The issue I'm having now is I need to merge the two projects, and when I try to start to move stuff over I run into all sorts of issues with the nRF_Drivers, nRF_Libraries, and compiling. I've had more luck trying to move the peripheral drivers/libraries into the ANT project, however after a few hours of trying to add in the proper files and adjust the sdk_config I'm left with a project that I can compile with no errors, but it hangs when I try to interact with peripherals. An example: first function call is to initialize GPIO pins. Once initialized, I immediately try and set an LED high, it goes into the nrf_gpio_pin_set() function and gets stuck.

Any suggestions on how to move forward?

EDIT: So I've loaded the 212 softdevice and uploaded the "ant_broadcast/tx" example. I am able to see the data I would expect it to broadcast. If I add an init_gpio() function as the first line of my main, it is supposed to set a pin as an output and set it high (which should turn on my LED). If I set a breakpoint after the function (or even within the function), it never gets there. It's like the program is completely ignoring the main?

EDIT2: If I place my init_gpio() in front of the utils_setup(), softdevice_setup(), and ant_channel_tx_broadcast_setup() it just gets skipped. If I place it after, I am able to enter the function with a breakpoint. Upon my first "nrf_gpio_cfg_output(LED_INDICATOR)" it throws an error and kicks me into "app_error_fault_handler()" Any suggestions?

Parents Reply Children
No Data
Related