This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR2355: code jumping into isr_trap.asm

Part Number: MSP430FR2355


Can someone tell me why my code (see below) is causing me to break in isr_trap.asm???  I have narrowed it down to a function I have created.  If I comment out the function and put dummy characters in code works just fine....The function is nothing more than a rearrangement of an array....

here is a small piece of main.  The function systemIdentification is causing the grief.  p_Seq is an unsigned int*.  Function is declared properly.

            if (!swInfo.err && (swInfo.twoSec & 0x0080)) {
                if (!flag)
                    p_Seq = systemIdentification(pSysID);
                switch (i) {
                case 0:
                    mssg[4] = (0xC0);
                    mssg[5] =  (char)(*p_Seq);
                    break;
                case 1:
                    mssg[4] = (0xA0);
                    mssg[5] = 0xA0;//(char)(*(p_Seq + 1));
                    break;

Here is the function :

unsigned int* systemIdentification (volatile char *p) {
    unsigned int j, zero;
    unsigned int realign[6] = {0};
    static unsigned int result[4];

    for (j = 0; j < 6; j++) {
        if (*(p+j) == 0xFE)
            zero = j;
    }
    for (j=zero; j < 6; j++)
        realign[j-zero] = *(p+j);

    for (j = 0; j < zero; j++)
        realign[j + (6-zero)] = *(p+j);

    for (j = 0; j < 4; j++) {
        result[j] = realign[j+1]^realign[j+2];
    }
    return result;
}

Code keeps jumping to :

   	.sect	".text:_isr:__TI_ISR_TRAP"
	.align	2
	.global	__TI_ISR_TRAP
__TI_ISR_TRAP:
        BIS.W     #(0x0010),SR
        JMP __TI_ISR_TRAP

        NOP                     ; CPU40 Compatibility NOP

  • What is the value in variable "zero" if 0xFE is not found?

    I generally use the option "-Wall" with gcc and that results in warnings for this sort of problem.

  • Ok....

    The array being passed in looks like the following:

    [0] = 0x08

    [1] = 0x0C

    [2] = 0x1C

    [3] = 0x3C

    [4] = 0xFE

    [5] = 0x00

    A break point right after zero = j yields

    zero = 0x2FE0

    j = 0x0006

    ideas??....

    I think you hit on something...if I change zero to an char things begin to look better...

  • Still getting the problem....

    Changed everything to unsigned char

    unsigned char* systemIdentification (volatile char *p) {
        unsigned char j, zero;
        unsigned char realign[6] = {0};
        static unsigned char result[4];
    

    zero looks better....

    but still getting into the trap

  • That seems you miss some ISR for some interrupt.

    Which interrupt have you enabled in your code? Have you add all ISR for the interrupt?

  • Gary....

    I created a bunch of "dummy" placeholders for ISRs....seems it is jumping into SYSNMI_VECTOR....VMAIFG flag is setting....the so called zero variable above is giving me 0x2FE0??  very strange....I changed the "volatile" qualifier on the parameter pointer and then started jumping into UNMI VECTOR....now the bigger issue is I cannot even load code

    ....My one demo board is not loading code anymore....I created a sandbox prj and moved source files into there figuring the linker and gel files are messed up but to no avail...Repowering board/CCS does not fix it either....I tried a second demo board and it downloads code....Any ideas?  My board isn't dead is it?

    1462.CCSError.docx

  • Hi Steve

    How about download a TI's code example into your first demo board? What's your demo board looks like? Dose it design by yourself or a launchpad you buy from TI?

  • Hi Gary.....

    Please see the link below with respect to this issue and feel free to comment....I have two demo boards....One board is taking the code using full verification and one board I must set to no verification....These are BOTH TI evm for the 2355....I have verified that the board that I must turn off verification to has different values in the 0x8000 space (prior to 0x8044 where main resides)

    MSP430FR2355: Help --- getting VMAIFG and jumping into isr_trap

    Thanks

    Steve

  • Hi Steve

    I saw Bruce have solved your problem in the other thread. That's great. 

    Best regards

    Gary

**Attention** This is a public forum