CE215119 BLE Battery Level example won't build on CM0P only

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

cross mob
GeIo_1586191
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

I wanted to use the CE215119 BLE Battery Level example on CM0P only but it throws up errors on build, despite following the documentation.

The default for the CE215119 BLE Battery Level example is having the BLE component set to dual core (controller on CM0+, host & profiles on CM4).

I can switch this to single core for CM4 and the structure of the code accepts this option too when building (with a tweak on interrupt settings).

When I switch to single core for CM0+ an error is generated in the error log: "undefined reference to HostMain", which is strange as host_main.c is within a shared folder and main_cm0p.c also references "common.h".

Also, within host_main.c file, other errors are highlighted. It is telling me that it does not recognise "Cy_BLE_GAPP_StartAdvertisement", for example, which should be something that is generated automatically.

I have tried deleting the "Generated Source" folder and generating the application again but this has not worked.

Please, could someone advise on how to resolve?

Thanks

0 Likes
1 Solution
ajays_86
Employee
Employee
First like received

Hi GerrikIoT,

In order to build your project in CM0p only, do the following modifications:

  • Change the CPU core to "Single Core (Complete Core on CM0+).

pastedImage_0.png

  • Change the file property for bas.h/.c, common.h, user_interface.h/.c, debug.c, and  host_main.c to build for CM0+.

pastedImage_1.png

After doing this you will be able to build your project successfully.

Thanks,

Ajay

View solution in original post

2 Replies
ajays_86
Employee
Employee
First like received

Hi GerrikIoT,

In order to build your project in CM0p only, do the following modifications:

  • Change the CPU core to "Single Core (Complete Core on CM0+).

pastedImage_0.png

  • Change the file property for bas.h/.c, common.h, user_interface.h/.c, debug.c, and  host_main.c to build for CM0+.

pastedImage_1.png

After doing this you will be able to build your project successfully.

Thanks,

Ajay

GeIo_1586191
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Thanks for that feedback. It was very helpful.

I did not realise you could or had to change the build filters.

I found that I if I just changed this property on the "Host Files" folder (from CortexM4 to CortexM0p) then this worked too:

pastedImage_0.png

Changing this property to "All", which is what I would have assumed to be the more flexible option, failed.

0 Likes