PSoC 63 error: 'CTBM0' undeclared

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

cross mob
ScottKerstein
Employee
Employee
5 solutions authored 10 likes received 25 sign-ins

I am using the Device Configurator tool in ModusToolbox to add a CTDAC to my application.  It is a simple PSoC63 application where I start with the ADC_basic code example and a CTDAC so I can measure the CTDAC at the single-ended basic ADC. 

After saving the configuration, a "cycfg_routing.c" file is generated which causes an error during the build.

bsps/TARGET_APP_CY8CPROTO-063-BLE/config/GeneratedSource/cycfg_routing.c: In function 'init_cycfg_routing':
bsps/TARGET_APP_CY8CPROTO-063-BLE/config/GeneratedSource/cycfg_routing.c:33:5: error: 'CTBM0' undeclared (first use in this function)
33 | CTBM0->CTB_CTRL |= CTBM_CTB_CTRL_ENABLED_Msk;
|        ^~~~~
bsps/TARGET_APP_CY8CPROTO-063-BLE/config/GeneratedSource/cycfg_routing.c:33:5: note: each undeclared identifier is reported only once for each function it appears in
bsps/TARGET_APP_CY8CPROTO-063-BLE/config/GeneratedSource/cycfg_routing.c:33:24: error: 'CTBM_CTB_CTRL_ENABLED_Msk' undeclared (first use in this function)
33 | CTBM0->CTB_CTRL |= CTBM_CTB_CTRL_ENABLED_Msk;
|                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~

I can get the application to build with zero errors if I comment out the line below.

   #include "cycfg_routing.h"

   void init_cycfg_routing(void)
   {
   //  CTBM0->CTB_CTRL |= CTBM_CTB_CTRL_ENABLED_Msk;
   }

With this line commented out, the CTDAC still drives the desired voltage, and I can measure it using ADC.

What did I miss in the configuration which requires this statement and under what conditions is this needed?

0 Likes
1 Solution
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi 

I have recreated the issue from my end. You can rectify the issue by adding the header file "cyble_416045_02_device.h" in the file cyconfig_routing.c as shown below.

LeoMathews_0-1673613957554.png

 

Thanks and Regards,
Leo

 

View solution in original post

0 Likes
4 Replies
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ScottKerstein 

Can you please share your project so that I can reproduce the issue from my end?  

Thanks and Regards,
Leo

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Leo,

Sure.  It is attached.  It is repeatable if you create a new "ADC_basic" application and just add a DAC using the Device Configurator and build.  You will see the error.  You do not need to add the DAC calls to main.c as I did in the attached. 

I used these values in the configurator to generate the DAC configuration.

Screenshot 2023-01-12 150629.png

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi 

I have recreated the issue from my end. You can rectify the issue by adding the header file "cyble_416045_02_device.h" in the file cyconfig_routing.c as shown below.

LeoMathews_0-1673613957554.png

 

Thanks and Regards,
Leo

 

0 Likes

Thank you, Leo.

0 Likes