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

TDD with SoftDevice

I'm trying to use TDD for my development of a BLE peripheral application, but I'm running into some problems. I'm using Ceedling, CMock, and Unity for my TDD environment, but I'm running into issues mocking the SDK files. I'm using a standard x86 compiler because I want to run the unit tests locally, so it's unable to parse the inline assembly. Has anyone else tried to use these tools and if so, how did you get around this?

EDIT: Adding code example:

test_uart.c

#include "mock_ble.h"

#include "mock_ble_nus.h"

...

void test_init(void) {

ble_nus_t nus;

TEST_ASSERT_EQUAL_INT(0, uart_init(&nus));}

uart.c

uart_init(ble_nus_t* nus) {

g_nus = nus;

APP_UART_FIFO_INIT(...); ...}

Example error message:

ble.h: In Function 'sd_ble_opt_get': nrf_svc.h:66:5: error unknown register name 'r0' in 'asm'

ble.h:622:1: note: in expansion of macro 'SVCALL' SVCALL(SD_BLE_OPT_GET, uint32_t, sd_ble_opt_get(uint32_t opt_id, ble_opt_t *p_opt));

Related