Sample port of SimpliciTI 1.0.6 to Code Composer Essentials for ez430-RF2500 application '2 simple End Devices with bi-di'. Port works for Code Composer Essentials 2 and 3. The implemented steps can be downloaded from http://www.zgus.com/rf/simpliciTI_for_CCE as a set of project files. Can be easily adapted for other applications and to build a library These steps and notes made by John Heenan on 30 September 2008 and are an adaptation of notes made on 15 and 16 May 2008. Careful. The applications also need editing! See steps 25 and 26 for example. The reason is that CCE does not initialise globals to 0 by default. To build applications for the two eZ430-RF2500T boards it is only necessary to build one with #define LINKLISTEN commented in and the other with #define LINKLISTEN commented out in file global.h. A complete rebuild when changing is required to ensure the address is compiled into flash. An alternative is to select various .C files from build exclusion or not. This would enable various distince applications to be maintained in the same application directory completely independently. Steps 1 to 16 below will enable a build to be made without any errors and warnings Steps 17 and beyond are still required 1. Make a new directory, say simpliciTI-1.0.6_to_CCE_port 2. Copy Components directory over Delete unused board directories from bsp\boards if desired (all except EZ430RF deleted) Schematics directory of EZ430RF directory deleted to save space family2, family3 and family4 directories of Components\mrfi\radios\ can be deleted All direcories of Components\mrfi\smartrf\ deleted except CC2500 There is no point in retaining Components\simpliciti\nwk libraries (deleted) 3. Make a new Configuration directory for files smpl_config.dat and smpl_nwk_config.dat in C:\Texas Instruments\SimpliciTI-1.0.6\Projects\Examples\Peer applications\eZ430RF\2 simple End Devices with bi-di\Configuration\ converted over to header files smpl_config.h and smpl_nwk_config.h. and Some additions made to cater for different device addresses such as in smpl_config.h //quotes not used in a header file #define ADDRESS_LINKTO {0x7C, 0x56, 0x34, 0x12} #define ADDRESS_LINKLISTEN {0x7D, 0x56, 0x34, 0x12} #ifdef LINKLISTEN #define THIS_DEVICE_ADDRESS ADDRESS_LINKLISTEN #else #define THIS_DEVICE_ADDRESS ADDRESS_LINKTO #endif Ensure the conversion replaces all '=' with ' ' 4. Make a new Applications directory and copy over main_LinkListen.c, Main_LinkTo.c and app_remap_led.h Add in some defines to cater for different address as documented below 5. Create a new CCE 'Managed Make C Project' with project directory set to the new simpliciTI-1.0.6_to_CCE_port directory and with project name simpliciTI-1.0.6_to_CCE_port. Choose all defaults except for device variant. Choose MSP430F2274 as the device variant. 6. Modify project properties to add in addiitonal include directories Right click on project name in the projects side bar Click on properties, C/C++ Build, General Options In the 'Add dir to #include search path' section, click onm the '+' symbol and add in one by one the following directories ..\Configuration ..\Components\bsp ..\Components\bsp\boards\EZ430RF ..\Components\bsp\drivers ..\Components\mrfi ..\Components\simpliciti\Network Applications ..\Components\simpliciti\nwk 7. Crate a new file calle global.h in the Configuration directory add in the following lines #define LINKLISTEN #include #define MRFI_CC2500 #define __no_init #define __root #include "smpl_nwk_config.h" //common among all devices of a network #include "smpl_config.h" //can be different for each device of a network 8. In main_LinkListen.c after line #include "bsp.h" add in #ifdef LINKLISTEN and add to the end of the file #endif 9. Add into main_LinkTo.c before any other includes after line #include "bsp.h" add in #ifndef LINKLISTEN and add to the end of the file #endif 10. Exclude from building all .C files that are at a directory depth greated than 2, as the necessary .C files will be included by other .C files 11. In file bsp_msp_430_defs.h, before line #define BSP_MCU_MSP430 add in #include "global.h" 12 In file bsp_msp_430_defs.h, replace everything between /* ---------------------- Code Composer ---------------------- */ and between /* ------------------ Unrecognized Compiler ------------------ */ with #elif (defined __TI_COMPILER_VERSION__) && (defined __MSP430__) #define BSP_COMPILER_CODE_COMPOSER #define __bsp_ENABLE_INTERRUPTS__() _enable_interrupts() #define __bsp_DISABLE_INTERRUPTS__() _disable_interrupts() #define __bsp_INTERRUPTS_ARE_ENABLED__() (_get_SR_register() & GIE) #define __bsp_ISTATE_T__ unsigned short #define __bsp_GET_ISTATE__() (_get_SR_register() & GIE) #define __bsp_RESTORE_ISTATE__(x) _bis_SR_register(x) #if (__TI_COMPILER_VERSION__>=3000000) #define __bsp_QUOTED_PRAGMA__(x) _Pragma(#x) #define __bsp_ISR_FUNCTION__(f,v) __bsp_QUOTED_PRAGMA__(vector=v) __interrupt void f(void) #else #define PORT2_VECTOR PORT2_ISR #define __bsp_ISR_FUNCTION__(f,v) __interrupt void f(void); \ v(f) \ __interrupt void f(void) #endif 13. Has been included in step 12 14. Has been included in step 12 15. In file mrfi_radio.c in the family 1 directory change for(uint8_t i=0; i<16; i++) { mrfiRndSeed = (mrfiRndSeed << 1) | (mrfiSpiReadReg(RSSI) & 0x01); } to { uint8_t i; for(i=0; i<16; i++) { mrfiRndSeed = (mrfiRndSeed << 1) | (mrfiSpiReadReg(RSSI) & 0x01); } } 16. In file bsp.h remove the trailing ';' from the line with #define BSP_STATIC_ASSERT(expr) void bspDummyPrototype( char dummy[1/((expr)!=0)] ); This is purely cosmetic, to avoid warnings. 17. In file nwk_QMgmt.h add in void nwk_QInit(); 18 In file nwk_QMgmt.c add in void nwk_QInit() { #if SIZE_INFRAME_Q > 0 memset(sInFrameQ, 0, sizeof(sInFrameQ)); #endif // SIZE_INFRAME_Q > 0 memset(sOutFrameQ, 0, sizeof(sOutFrameQ)); } 19. In file nwk.c, in function nwk_nwkInit add in memset(sConTable.connStruct, 0, sizeof(sConTable.connStruct)); nwk_QInit(); 20. In nwk_api.c edit static uint8_t sInit_done; to static uint8_t sInit_done=0; 21. In nwk_frame.c edit static uint8_t (*spCallback)(linkID_t); to static uint8_t (*spCallback)(linkID_t)=0; 22. In file nwk_globals.c edit static uint8_t sRAMAddressIsSet; to static uint8_t sRAMAddressIsSet=0; 23. In file nwk_link.c edit static uint32_t sLinkToken; static volatile uint8_t sListenActive; static volatile linkID_t sServiceLinkID; static volatile uint8_t sTid; to static uint32_t sLinkToken=0; static volatile uint8_t sListenActive=0; static volatile linkID_t sServiceLinkID=0; static volatile uint8_t sTid=0; 24. In file nwk_join.c edit static uint32_t sJoinToken; static uint8_t (*spCallback)(linkID_t); static uint8_t sCurNumSandFClients; static uint8_t sJoinOK; static uint8_t sNumJoined; to static uint32_t sJoinToken=0; static uint8_t (*spCallback)(linkID_t)=0; static uint8_t sCurNumSandFClients=0; static uint8_t sJoinOK=0; static uint8_t sNumJoined=0; 25. In file main_LinkTo.c edit static uint8_t sTxTid, sRxTid; to static uint8_t sTxTid=0, sRxTid=0; 26. In file main_LinkListen.c edit static uint8_t sRxTid; static volatile uint8_t sSemaphore; to static uint8_t sRxTid=0; static volatile uint8_t sSemaphore=0;