Build Error - conflicting types for cy_ble_stackMemoryRam

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
SuMa_296631
Level 5
Level 5
50 replies posted 25 replies posted 10 replies posted

My first attempt at adding BLE to my PSoC6 board. I'm following the instructions in CE215119 "BLE Battery Level with PSoC 6 MCU with BLE Connectivity' (plus an ADC and UART that I want to use later but were the starting point for my development). The BLE version is V2.10; PSoC Creator is the latest with al of the modules updated to the latest available versions. This is on a Windows 10 64-bit computer (a VM but I don't think that would matter in this case).

When I compile I get:

prj.M0120:Build error: conflicting types for 'cy_ble_stackmemoryRam'

with a reference to cy_ble.c, lin e38,column 46. That line reads (in context):

#if (CY_BLE_SHARING_MODE_EXPORT)

uint8_t *cy_ble_stackMemoryRam = NULL;

#else

CY_ALIGN(sizeof(uint32_t)) CY_NOINIT uint8_t cy_ble_stackMemoryRam[CY_BLE_STACK_RAM_SIZE];

#endif  /* CY_BLE_SHARING_MODE_EXPORT */

and is the 'else' code line.

In 'cy_ble.h there is also the code:

#if (CY_BLE_SHARING_MODE_EXPORT)

    extern uint8_t *cy_ble_stackMemoryRam;

#else

    extern uint8_t cy_ble_stackMemoryRam[CY_BLE_STACK_RAM_SIZE];

#endif  /* CY_BLE_SHARING_MODE_EXPORT */

but there it appears as though the first code line is the one that is active (although this could be the IDE leading me astray and not what the compiler sees as hovering over the CY_BLE_SHARING_MODE_EXPORT gives the same expansion of 'CY_BLE_SHARING_MODE == CY_BLE_SHARING_EXPORT).

CAn someone tell me where I'm going wrong?

0 Likes
1 Solution

There are two cy_ble_config.h variants generated for BLE and non-BLE projects. This file is used to redefine BLESS Clock macros in a non-BLE PSoC Creator project. Whereas, in a BLE project the configuration #define(s) generated by the BLE customizer are redefined.

pastedImage_0.png

Once the non-BLE project is built, the non-BLE cy_ble_config.h variant will be generated. Later, when you add BLE component in the PSoC Creator schematic, the cy_ble_config.h will not be re-generated as per PSoC Creator/pdsc flow. Hence, you can either add defines in the non-BLE specific cy_ble_config.h file or manually delete and re-generate the file for BLE configuration.

  • Add following defines in the cy_ble_config.h file and build the project to support BLE functionality.

#include "ble/cy_ble_defines.h"

#include "BLE_config.h"

  • Regenerate cy_ble_config.h manually after adding BLE component in the schematic;
    • Right click on cy_ble_config.h > Delete.
    • Clean and Build the project; Go to Build > Clean and Build Project

New It will be documented under Cypress BLE Middleware Library section in the next PDL revision.

View solution in original post

0 Likes
10 Replies