oPossum 1,083 Posted December 7, 2012 Share Posted December 7, 2012 http://processors.wiki.ti.com/index.php/Creating_MSP430_FRAM_Variables_Using_CCS Read the section "Using the linker command file" use #pragma SET_CODE_SECTION() for code I think that will work. simpleavr 1 Quote Link to post Share on other sites
simpleavr 399 Posted December 7, 2012 Author Share Posted December 7, 2012 thanks oPossum, that got thru compile. on to all the linker flags, etc, etc. Quote Link to post Share on other sites
simpleavr 399 Posted December 7, 2012 Author Share Posted December 7, 2012 @oPossum how there should be a way for CCS inline to access variables defined in 'C', i suppose? when i tried, union u_data r12_val; uint16_t data16; #ifdef MSP430 asm(" mov r12,%[res]": [res] "=r" (r12_val.w); asm(" mov r13,%[res]": [res] "=r" (data16); #else asm(" mov r12,r12_val.w"); asm(" mov r13,data16"); #endif CCS complain it can find the variables "r12_val" and "data16". i google a bit and was told inline assembly cannot access variables on the 'C' side. any easy way? hints? Quote Link to post Share on other sites
oPossum 1,083 Posted December 7, 2012 Share Posted December 7, 2012 You can access global variables, but not local. You must also specify addressing mode. asm(" mov r12, &r12_val.w"); asm(" mov r13, &data16"); Really best to write functions completely in assembly (in a .asm file) rather than use inline. Quote Link to post Share on other sites
simpleavr 399 Posted December 7, 2012 Author Share Posted December 7, 2012 Really best to write functions completely in assembly (in a .asm file) rather than use inline. right. one step at a time for me. 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.