Component DS_ADC_DEMOD with XMC_ASSERT_ENABLE cannot be compiled

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

cross mob
Karl
Level 1
Level 1
10 sign-ins 5 sign-ins First solution authored
Hi,

if I add the component DS_ADC_DEMOD and XMC_ASSERT_ENABLE is defined (in menu
Active Project Properties / Tool Settings / ARM-GCC C Compiler / Preprocessor), then the compilation aborts with the following error:

../Dave/Generated/DS_ADC_DEMOD/ds_adc_demod.h: In function 'DS_ADC_DEMOD_CH_GetResult_AUX':
../Dave/Generated/DS_ADC_DEMOD/ds_adc_demod.h:417:67: error: 'HandlePtr' undeclared (first use in this function)
XMC_ASSERT("Invalid channel pointer", XMC_DSD_CHECK_CHANNEL_PTR(HandlePtr->dsd_ch_ptr[id]));


This bug is independent of the Dave version.

Regards
Karl
0 Likes
1 Solution
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi Karl,

Thanks for reporting the issue. You can modify the XMC_ASSERT  condition on the generated file after all modification being done as the workaround.

Best regards,
Vasanth

View solution in original post

0 Likes
2 Replies
Karl
Level 1
Level 1
10 sign-ins 5 sign-ins First solution authored
Hi,

I propose the following solution:

1. In the file D_LibraryStore_4.4\resources\4.0.6\app\DS_ADC_DEMOD\0\Templates\ds_adc_demod.h
remove line 417
XMC_ASSERT ("Invalid channel pointer", XMC_DSD_CHECK_CHANNEL_PTR (HandlePtr-> dsd_ch_ptr [id]));
because the used argument in condition is wrong.
Better is a check in the function XMC_DSD_CH_GetResult_AUX () in file D_LibraryStore_4.4\DeviceFeatures\pack\2.2.12\Libraries\XMCLib\XMC4\inc\xmc_dsd.h

2. In the file D_LibraryStore_4.4\DeviceFeatures\pack\2.2.12\Libraries\XMCLib\XMC4\inc\xmc_dsd.h
2.1. In the function
__STATIC_INLINE void XMC_DSD_CH_GetResult(XMC_DSD_CH_t *const channel, int16_t *dsd_Result)
at line 785 inserted
XMC_ASSERT("XMC_DSD_CH_GetResult:Invalid module pointer", XMC_DSD_CHECK_CHANNEL_PTR(channel));
XMC_ASSERT("XMC_DSD_CH_GetResult:NULL Result Pointer", (dsd_Result != (int16_t *)NULL) );


2.2. In the function
__STATIC_INLINE void XMC_DSD_CH_GetResult_AUX(XMC_DSD_CH_t *const channel, int16_t *dsd_Result)
at line 839 inserted
XMC_ASSERT("XMC_DSD_CH_GetResult_AUX:Invalid module pointer", XMC_DSD_CHECK_CHANNEL_PTR(channel));
XMC_ASSERT("XMC_DSD_CH_GetResult_AUX:NULL Result Pointer", (dsd_Result != (int16_t *)NULL) );


Regards,
Karl
0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi Karl,

Thanks for reporting the issue. You can modify the XMC_ASSERT  condition on the generated file after all modification being done as the workaround.

Best regards,
Vasanth

0 Likes