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.

MSP430FR2433: Write FRAM problem using SLAU320 based code

Part Number: MSP430FR2433

Hello to everyone, I'm working on a code for a Jiga Test device, this device will burn an MSP430FR2433 microcontroller.

I have implemented the code on a CC2652 to burn the code, read the device ID correctly, and read registers, but..

I can't write data on FRAM (detail, I can write on a register like the WDT controller, and the SBW functions work correctly. 

I'm reading the SYSCFG0 and getting the 0x9603 info, indicating the FRAM is protected, but I can't clear the PFWP bit, using the value 0xA500, but when I read again, the bit is still set.

And I do this after the GetDeviceID, the calls, in order: GetCoreID, IsLockKeyProrammed, GetCoreIpIdXv2, SyncJtag_AssertPor, ReadMemQuick_430Xv2 (to read the TLV) and DisableWDT.

The strange thing is that I can write on another register, but the SYSCFG0 doesn't, and I am stuck, and I cannot write data on FRAM Disappointed

If someone can help me, I would appreciate too much.

  • Hi Pablo,

    Are you writing the 0xA500 PW and clearing the PFWP bit all in one write operation to SYSCFG0?

    Something like this ->  #define DISABLE_PF_WRITE_PROTECT        SYSCFG0 = FRWPPW | DFWP

  • This is my working example in assembler. It is done after COREIP_ID shift out and sync. Registers are 32-bit, write memory input R0 is in format adr << 16 | val

            // Disable Watchdog

            LOG ' WDC '

            ldr R0, =((WDTCTL98 << 16) | (WDTPW + WDTHOLD))
            bl BWriteMem

            // Remove FRAM write protection
            // mov.w #0, &SYSCFG0

            LOG ' SYS '

            ldr R0, =((0160h << 16) | 0)
            bl BWriteMem

  • Yes, I'm doing all in one operation, but no success :( 

  • First I call the GetDevice_430Xv2, with the following code:

    word GetDevice_430Xv2(sbw_t *obj){
        uint32_t pDeviceID;
    
        obj->info.Cpu = CPU_UNKNOWN_STATE;
        if (GetCoreID(obj) != STATUS_OK){
            return STATUS_ERROR;
        }
        if (IsLockKeyProgrammed(obj->link)){
            // my fuse is blown :(
            obj->info.Efuse = MSP430_FUSE_BLOWN;
            return STATUS_FUSEBLOWN;
        }
        obj->info.Cpu = CPU_RELEASED;
        obj->info.Efuse = MSP430_FUSE_OK;
        pDeviceID = GetCoreipIdXv2(obj);
        if (pDeviceID == STATUS_ERROR){
            return STATUS_ERROR;
        }
    
        if (SyncJtag_AssertPor(obj) != STATUS_OK){
            return STATUS_ERROR;
        }
    
        ReadMemQuick_430Xv2(obj, pDeviceID, sizeof(tlv_t)/sizeof(uint16_t), obj->TLV._raw);
        obj->info.Device = (msp430_ids_e)obj->TLV.information.deviceID;
    
        DisableWDT_MSP430Xv2(obj);
    
        return STATUS_OK;
    }

    And, The following function is called is DisableMpu_430Xv2

    word DisableMpu_430Xv2(sbw_t* sbw)
    {
        word FR2433_SYSCFG0 = 0x160;
        word val;
        unsigned short newRegisterVal;
    
        if(IR_Shift(sbw->link, IR_CNTRL_SIG_CAPTURE) == JTAG_ID98)
        {
            newRegisterVal = ReadMem_430Xv2(sbw, F_WORD, FR2433_SYSCFG0);
            newRegisterVal = 0x2; // disable PFWP
            newRegisterVal |= 0xA500; // write the password
            // unlock MPU for FR4xx/FR2xx
            WriteMem_430Xv2(sbw, F_WORD, FR2433_SYSCFG0, newRegisterVal);
            val = ReadMem_430Xv2(sbw, F_WORD, FR2433_SYSCFG0);
            if((val & 0x3) == 0x0)
            {
                return STATUS_OK;
            }
            return STATUS_ERROR;
        }
    }

    With debugging session, I have the following values on the debugger:

  • I am not now into this, but for FR4133 that is similar device to yours I am writing zero (not A502h) @ 160h for unlocking FRAM for write and it is working fine. By using SBW interface.

  • I have clicked on resolved wrong, sorry.

    I have tried the 0x0000 too, but the same behavior. I can't find any reason for this. The SBW logic is fine, I can write and read other registers, but this one, making me insane hehe

  • i have tested too with PMMCTL0, which has a Password too, and the write on this register works perfectly, on SYSCFG0 is doing this.

  • Can you write to RAM (not FRAM)?

  • Not too, when I try to write on RAM, when I read, all values turn to 0. 

  • Maybe the problem is somewhere else, because if I remember right RAM is not protected. I hope that your device / setup is working on voltage higher than 2.0V, because on lower SBW / JTAG with FRAM can't work.

  • I will make some checks, but I think that the voltage is correctly set. supplied by a 3.3V line from the host microcontroller.

    But stills very strange.

  • Checked everything, the functions of GetDevice, minor changes on the ExecutePOR, but no effect, I can't write on RAM and registers like P1OUT, P1DIR. When trying to write, the JTAG status returns the value 0xC301.

    Double checked the flow of getdevice and erase/write. The flow is the same.

  • You should resolve simple things first, like writing to target device RAM or blink LED at  P1.0 for example. Before P1.0 blink you should do this first...

            // Disable GPIO power-on default high-impedance mode
            // bic.w #LOCKLPM5, &PM5CTL0

            LOG 'PIO '

            mov.w #PM5CTL0, &MemAdr
            mov.w #0, &MemData
            call #BWriteMem1

    Than you can continue with FRAM operations. Maybe something is wrong with clock or shifting functions.

    You can download simple program to target device by any FET, to fill up RAM to 1, 2, 3... values, and than you can start with memory read until result is correct. Reading also FRAM and compare it with memory values download with FET.

  • Even the GPIO I can't write, I think that the target microcontroller is in a state where this register is blocked because his values do not change. In other registers like Watchdog, RTC, I write a value and when a read the value I have defined is there.

    SYSCFG0, P1OUT, P1DIR are registers that I can't work :( 

    I have tried to call SyncJtag, HaltCPU, ReleaseCPU before the read, but no result. I have checked the Write operation, following all the MSP430 Programming With the JTAG Interface documentation, but, still the same behavior.

**Attention** This is a public forum