jsolarski-backup 22 Posted October 22, 2012 Share Posted October 22, 2012 I am having errors compiling some USB code on mspgcc, the code that I am having issues with is #ifdef __REGISTER_MODEL__ /* for IAR */ # if __REGISTER_MODEL__ == __REGISTER_MODEL_REG20__ # define __DMA_ACCESS_REG__ (void __data20 *) # else # define __DMA_ACCESS_REG__ (unsigned short) # endif #else /* for CCS */ # define __DMA_ACCESS_REG__ (__SFR_FARPTR)(unsigned long) #endif It affects how DMA0DA = __DMA_ACCESS_REG__ dest; //set destination for DMAx DMA0SA = __DMA_ACCESS_REG__ source; //set source for DMAx is there a suitable replacement for gcc that I can use? no amount of googling has helped. All I know is that SFR__FARPTR is a builtin but not sure what it does, or how it affects the code. If need be I can post the errors from compiling later today Quote Link to post Share on other sites
jsolarski-backup 22 Posted October 23, 2012 Author Share Posted October 23, 2012 From IRC -- Rickta __SFR_FARPTR is not jsut a function pointer. It' sprimary purpose is to represent a monolithic 20 bit value, as opposed to a long int value that is represented as 2*16 bit on assembly level. When stored to 'normal' memory, both are 4 byte size. But a normal long int will be put into 2*16 bit registers while an __SFR_FARPTR will be stored in a single register in a special 20 bit mode. Only this way, a 20 bit address can be properly SirPatrick 1 Quote Link to post Share on other sites
pabigot 355 Posted October 23, 2012 Share Posted October 23, 2012 FWIW, DMA0DA and DMA0SA are declared so that the compiler knows they're 20-bit values (at least if you're using the mspgcc that's 20-bit aware). No particular cast should be necessary for mspgcc. In fact passing the value through (unsigned long) might result in an unnecessary (and very expensive) up-cast to a 32-bit value before truncating back down to the 20-bit value that will be stored. See also http://sourceforge.net/apps/mediawiki/m ... te___a20__ gordon 1 Quote Link to post Share on other sites
jsolarski-backup 22 Posted October 23, 2012 Author Share Posted October 23, 2012 Thanks pabigot for the info! is the f5510 a 20 bit msp? pabigot, is mspgcc-20120406, 20bit aware? Quote Link to post Share on other sites
jsolarski-backup 22 Posted October 23, 2012 Author Share Posted October 23, 2012 one step closer...it now compiles but still won't enumerate on the host. i still have descriptors to edit and a bunch of debugging to do. Quote Link to post Share on other sites
pabigot 355 Posted October 23, 2012 Share Posted October 23, 2012 Thanks pabigot for the info! You're welcome. is the f5510 a 20 bit msp? All 5xx/6xx/FR5xx MCUs are CPUX architecture, meaning they support the 20-bit aware instructions. However, the 5510 has only 32kiB of flash, so there is no far memory for which 20-bit pointers would be useful. The 5529, on the other hand, has 81kiB of flash above the 64 kiB boundary (48 kiB below it). pabigot, is mspgcc-20120406, 20bit aware? No. The 4.7 development series, currently 20120911, is the only one that supports 20-bit code and data. 20120406 will, however, use CPUX instructions for other things (such as multi-register push/pop, enhanced bit rotate, etc.) If you're targeting the 5510, there's no particular value in updating. jsolarski-backup 1 Quote Link to post Share on other sites
jsolarski-backup 22 Posted October 24, 2012 Author Share Posted October 24, 2012 Excellent! This will make things a bit easier. I will in the future work with the 20bit msp430s, but for now I will stick with the 5510 port of the code Quote Link to post Share on other sites
jsolarski-backup 22 Posted October 25, 2012 Author Share Posted October 25, 2012 I just recieved Rickta's usb code he was working on and it works!!! Now to incorporate it into the newer usb dev api. full project to be posted after this weekend Quote Link to post Share on other sites
jsolarski-backup 22 Posted October 25, 2012 Author Share Posted October 25, 2012 success ... Rickta' s code works with the 5510.....lol I am so happy right now!!! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.