Hi,
I'm new to MSP430 and IAR development and I want to port an EXP5438 project to EXP5529. I noticed there are two files: a .sfr and a .ddf file which seem to be specific to the processor along with various .h files specific to the board's peripherals. Where (or in what file) do I tell IAR to use the 5529 versions of these files?
BR,Leo
IMHO it's best to open a new project and copy just the plain source code into it.
Keep in mind that teh new processor doesn't have all the peripherals the 5438 had (especially not the USCI 2+3).
You'll need to change the included header file name in your source code to match these changes (and maybe have to sort out any compilaiton errors due to no longer existing or renamed registers).
The board-specific header files usually belong to board-specific code files (and won't work on a different board at all) or a board-specific library (which also won't work ona different board).
So depending on what MSP-internal and board-external features your original project used, this migration might be a larger project.And you're the only one who knows the details.
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.
My initialization code is quite simple for exp5438(see below). When I try to build the project for 5529, it complains about not having the definition of XT1LFOFFG. Should this code be the same for 5438 versus 5529? When I try to go to the declaration, CCS opens the msp5438a.h include file instead of msp5529.h - but there is no reference to including these files in any of my code - is this a CCS problem? How would I need to change below code to properly initialize the 5529?
/******************************************************************************** @brief Setup all the peripherals of the MSP. This is for TI sensorsThe DCO is set at 8MHz, the 32KHz is started and the WDT is at 1 sec.* (MSP430F5438 version)* @param none* * @return none*******************************************************************************/void MSP_Setup(void) { // Enable the interupts on port 2 to catch the user button (TRXEB) //P2DIR &= ~BIT3; // Set P2.7 to output direction //P2OUT = BIT3; // Set P2.7 to output direction //P2IE |= BIT3; // P2.7 interrupt enabled //P2IES |= BIT3; // P2.7 Hi/lo edge //P2REN |= BIT3; // P2.7 Pull up resistor //P2IFG &= ~BIT3; // P1.2 IFG cleared
// Enable the interupts on port 2 to catch the user button (Exp5438) P2DIR &= ~BIT7; // Set P2.7 to output direction P2OUT = BIT7; // Set P2.7 to output direction P2IE |= BIT7; // P2.7 interrupt enabled P2IES |= BIT7; // P2.7 Hi/lo edge P2REN |= BIT7; // P2.7 Pull up resistor P2IFG &= ~BIT7; // P1.2 IFG cleared
// Setup the XTAL ports to use the external 32K oscillilator P7SEL |= 0x03; // Select XT1 UCSCTL6 |= XCAP_3; // Internal load cap // Loop until XT1,XT2 & DCO stabilizes do { UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG); // Clear XT2,XT1,DCO fault flags SFRIFG1 &= ~OFIFG; // Clear fault flags } while (SFRIFG1&OFIFG); // Test oscillator fault flag UCSCTL6 &= ~(XT1DRIVE_3); // Xtal is now stable, reduce drive // Set up clock system on MCU to fit your system // Target specific implementation UCSCTL0 = 0x00; // Set lowest possible DCOx, MODx UCSCTL1 = DCORSEL_4; // Select suitable range UCSCTL2 = 244 ; // DCO = 244 * 32768Hz ~= 8MHz UCSCTL4 = SELA__XT1CLK | SELS__DCOCLK | SELM__DCOCLK ; // Setup Watch dog timer for 1 second tick using 32Khz XTAL on CC430 WDTCTL = WDT_ADLY_1000; // WDT 15.6ms, ACLK, interval timer SFRIE1 |= WDTIE; // Enable WDT interrupt}#endif
Hi Leonardo,
The compiler should be complaining about XT1HFOFFG instead of the LF flag, since the MSP430F5529 does not have HF support on XT1. You should remove the test for that flag for the part of your code which targets the F5529.
Tony
Hi Tony,
Yes - that's what I meant - I deleted it - but it didn't help - I need the 32K clock running - any suggestions or code on how to get it running for 5529?
Leonardo Estevez UCSCTL1 = DCORSEL_4; // Select suitable range
However,
Leonardo EstevezShould this code be the same for 5438 versus 5529? When I try to go to the declaration, CCS opens the msp5438a.h include file instead of msp5529.h
Hi Jens-Michael,
I copied and pasted the relevant code from the MSP430 example for LPM and it works now - it looks like an extra inline _nop is required for 5529. On another more important note. I am looking at porting Contiki to 5529 and found some blogs in 2010 about some students doing this but running into tool chain issues. Do you know if there is a port somewhere or if these gcc issues have been resolved? http://comments.gmane.org/gmane.os.contiki.devel/5247
Leonardo EstevezDo you know if there is a port somewhere or if these gcc issues have been resolved?
MSPGCC is a separate compiler based on GCC. To do its job, it has to know the target processor, whether it has a 32bit or 16 bit or no hardware multiplier, the memory layout etc. At the time they tried to port the project, the 5529 was unknown to MSPGCC and therefore the compiler didn't know what to do.There have been some rather generic commandline switches which would have allowed compiling for the 5529 anyway, provided that someone had written the required include files and linker scripts. Those guys just didn't know that in case of an unknown MSP (to the compiler version they used), defining 'target=MSP430F5529" wasn't enough.
However, the recent uniarch version of MSPGCC AFAIK supports the 5529 and almost all other MSPs (not the FR57xx and maybe a few others)