Ok narrowed down my problem with Tools
Posted: Wed Sep 25, 2019 5:44 pm
All,
Still struggling to get my project back on track. I know there is a lot of rambling on my part with this problem but I think I have narrowed it down.
So this is a UAC2 project XU208, I2S, I2C (single bit-working). I have customdefines.h included in the devicedefines.h at the top of the file. In customdefines.h I have the obvious following for UAC2
/* Audio class version to run in - Default is 2.0 */
#ifndef AUDIO_CLASS
#define AUDIO_CLASS (2)
#endif
#define U208_ONLY 1 // XU208
Problem is in main.xc the following happens Full Speed not High Speed is selected here and the U208_ONLY ifdef is also ignored. So basically the entire compile is for some reason falling back to the defaults in devicedefines.h which makes no sense to me.
So I did the following in main.xc
#define U208_ONLY
#define AUDIO_CLASS 2
#ifdef U208_ONLY
set_core_high_priority_on();
#endif
/* USB Interface Core */
#if (AUDIO_CLASS==2)
uac_check(2);
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_HS, XUD_PWR_CFG);
#else
uac_check(1);
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_FS, XUD_PWR_CFG);
#endif
~~~ of course that worked but really it's not going to work because the entire project needs to see the AUDIO_CLASS declaration. I know the U208_ONLY probably doesn't need to be there I am shooting in the dark now.
Anyway, when I do the above I get the following redeclarations after I make the project:
'AUDIO_CLASS' macro redefined app_usb_aud_xu208_xhra line 329, external location: /Users/gordonrankin/XMOS3x/X3UAC2/sc_usb_audio/module_usb_audio/main.xc C/C++ Problem
'U208_ONLY' macro redefined app_usb_aud_xu208_xhra line 328, external location: /Users/gordonrankin/XMOS3x/X3UAC2/sc_usb_audio/module_usb_audio/main.xc C/C++ Problem
Ok so I figure it must be picking up the devicedefines.h default stuff and not my customdefines for some reason so I just delete the 208_ONLY ref and place the following in main.xc instead for AUDIO_CLASS
/* Audio class version to run in - Default is 2.0 */
#ifndef AUDIO_CLASS
#define AUDIO_CLASS (2)
#endif
Figuring it would then default to UAC (Full Speed) instead of UAC2 (High Speed). Well it didn't.... it selected UAC2 High Speed.
Anyone know what is going on here? Obviously no answer from XMOS.
Thanks,
Gordon
Still struggling to get my project back on track. I know there is a lot of rambling on my part with this problem but I think I have narrowed it down.
So this is a UAC2 project XU208, I2S, I2C (single bit-working). I have customdefines.h included in the devicedefines.h at the top of the file. In customdefines.h I have the obvious following for UAC2
/* Audio class version to run in - Default is 2.0 */
#ifndef AUDIO_CLASS
#define AUDIO_CLASS (2)
#endif
#define U208_ONLY 1 // XU208
Problem is in main.xc the following happens Full Speed not High Speed is selected here and the U208_ONLY ifdef is also ignored. So basically the entire compile is for some reason falling back to the defaults in devicedefines.h which makes no sense to me.
So I did the following in main.xc
#define U208_ONLY
#define AUDIO_CLASS 2
#ifdef U208_ONLY
set_core_high_priority_on();
#endif
/* USB Interface Core */
#if (AUDIO_CLASS==2)
uac_check(2);
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_HS, XUD_PWR_CFG);
#else
uac_check(1);
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_FS, XUD_PWR_CFG);
#endif
~~~ of course that worked but really it's not going to work because the entire project needs to see the AUDIO_CLASS declaration. I know the U208_ONLY probably doesn't need to be there I am shooting in the dark now.
Anyway, when I do the above I get the following redeclarations after I make the project:
'AUDIO_CLASS' macro redefined app_usb_aud_xu208_xhra line 329, external location: /Users/gordonrankin/XMOS3x/X3UAC2/sc_usb_audio/module_usb_audio/main.xc C/C++ Problem
'U208_ONLY' macro redefined app_usb_aud_xu208_xhra line 328, external location: /Users/gordonrankin/XMOS3x/X3UAC2/sc_usb_audio/module_usb_audio/main.xc C/C++ Problem
Ok so I figure it must be picking up the devicedefines.h default stuff and not my customdefines for some reason so I just delete the 208_ONLY ref and place the following in main.xc instead for AUDIO_CLASS
/* Audio class version to run in - Default is 2.0 */
#ifndef AUDIO_CLASS
#define AUDIO_CLASS (2)
#endif
Figuring it would then default to UAC (Full Speed) instead of UAC2 (High Speed). Well it didn't.... it selected UAC2 High Speed.
Anyone know what is going on here? Obviously no answer from XMOS.
Thanks,
Gordon