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.

Compiler/MSP430G2544: Flash MSP430 using SBW using AM57xx

Part Number: MSP430G2544
Other Parts Discussed in Thread: AM5726

Tool/software: TI C/C++ Compiler

Hello,

I have connected MSP430 with AM57xx using SBW interface. Is there any methods/utility present to flash MSP430 from AM57xx?

Regards,

Prerak

  • Hi, Patel, 

    We have the board MSP430 REP430F and the example code for another MCU to program MSP430 devices through JTAG, SBW, and BSL. For programming with SBW interface, please refer to following document and example code: 

    Regards, 

    Lixin 

  • Hello,

    I have read thread you have suggested. Ii is flashing msp430 using some host board. I have connected my msp430g2544 with am5726.

    Does any one programmed MSP430 from sitara series processors ?

    Regards,

    Prerak

  • Hi, Prerak, 

    I don't know if there is reference code for sitara series processor to program MPS430 devices. Maybe Sitara processor team can help. I will check with team and feedback to you. 

    Thanks, 

    Lixin 

  • Hi, Prerak, 

    We have not the example code for sitara series processor to program MPS430 devices by SBW interface. But we have application report document to refer: 

    1. Slaa765 (http://www.ti.com/lit/an/slaa755/slaa755.pdf

  • Hi, Prerak, 

    We have not the example code for sitara series processor to program MPS430 devices by SBW interface. But we have application report document to refer: 

    1. Slaa765 (http://www.ti.com/lit/an/slaa755/slaa755.pdf
    2. If you can turn to use BSL interface to program MSP430, we have 2 application reports for your refrence (both are using Sitara process to program MSP430 devices): 
      1. APPLICATION NOTE: Host BSL Driver for Sitara Embedded Linux Host
      2. APPLICATION NOTE: MSP430 ™ Firmware Updates Over I2C Using Linux ®

    Regards, 

    Lixin

  • Hi, Prerak, 

    If you think my recommendation help to resolve your questions, please click on the This resolved my issue  button to close this thread.  

    Regards, 

    Lixin 

  • Hello Lixin,

    Thanks for your valuable suggestion.

    I am working on your resolution. I have taken your suggestion as reference and prepared one code, but not able to get DeviceID.

    Regards,

    Prerak

  • Hi, Prerak, 

    You can get the device ID from address 0FF0h to 0FFFh. 

    Please see document http://www.ti.com/lit/pdf/slau319  for details. 

    Best Regards, 

    Lixin 

  • Hello Lixin,

    Right now I am not even able to enable the JTAG communication.

    I have checked "Entry sequence" and verified it with CRO. Seems like each and every sequence is correct.

    Below are the entry sequence, I follow.

    GPIO_IF_setAsOutputPin(RESET_PIN);
    GPIO_IF_setAsOutputPin(TEST_PIN);

    GPIO_IF_setOutputHighOnPin(TEST_PIN);
    GPIO_IF_setOutputHighOnPin(RESET_PIN);
    MsDelay(200);

    GPIO_IF_setOutputLowOnPin(TEST_PIN);
    usDelay(800);
    GPIO_IF_setOutputLowOnPin(RESET_PIN);
    usDelay(20);

    GPIO_IF_setOutputHighOnPin(TEST_PIN);
    usDelay(20);
    GPIO_IF_setOutputLowOnPin(TEST_PIN);
    usDelay(20);

    GPIO_IF_setOutputHighOnPin(TEST_PIN);
    usDelay(20);
    GPIO_IF_setOutputHighOnPin(RESET_PIN);
    usDelay(20);
    GPIO_IF_setOutputLowOnPin(TEST_PIN);
    usDelay(20);

    ResetTAP(); // reset TAP state machine -> Run-Test/Idle
    //TRIGGER;
    uint16_t JtagId = (uint16_t)IR_Shift(IR_BYPASS);
    usDelay(500);
    printf("JtagId: %X \n",JtagId);

    when I passed 0xFF value to IR shift reg, as output I dont get valid JTAG ID. it returns 0 as output.

    Any comments on this?

    Regards,

    Prerak

  • Hi, Prerak, 

    What timing diagram you are referring for your coding? Is it in slau320? 

    Regards, 

    Lixin 

  • Hello,

    Referring "1.3.1.1 MSP430 Devices With Shared JTAG Pins"(Figure 2) from slau319.

    Attached my signal for your referance.

    Regards,

    Prerak

  • Hi,

    1. Please make sure which communication you want to use, JTAG or SBW?

    2.The entrance sequence you choose seems belong to BSL. Here is the picture you can refer to:

    3. For the related code, you can refer to Project:Replicator430, in http://www.ti.com/lit/zip/slau320.

    Eason

  • Hi,

    Thanks for your input.

    I want to use SBW.

    In slau320 there are multiple projects.

    I am using msp430g2544. which project shouls i take as the referance ?

    Regards,

    Prerak

  • Hi,

    As msp430g2544 has a CPU with 16bit address space, You can refer to Project:Replicator430, in http://www.ti.com/lit/zip/slau320.

    About the software description, you can refer to chapter 3 in UG: http://www.ti.com/lit/ug/slau320ag/slau320ag.pdf

    Eason

  • Thanks Eason for helping us.

    I have refereed software as per your suggestion.

    I am not able to get JTAGID after entry sequence. I have verified entry seq. on DSO. and it seems like correct.

    Attached DSO image for your ref.

    Any suggestion for this ?

    Regards,

    Prerak

  • Hi,

    1. You must do fuse check before JTAG access is granted. See from your wave you haven't done that. Please see the code in Replicator430 as reference:

    //----------------------------------------------------------------------------
    //! \brief Function to start the JTAG communication
    static word StartJtag(void)
    {
        // drive JTAG/TEST signals
        DrvSignals();
        MsDelay(10);             // delay 10ms
        
        if(INTERFACE == SPYBIWIRE_IF)
        {
            EntrySequences_RstHigh_SBW();
        }
        else if(INTERFACE == SPYBIWIREJTAG_IF)
        {
            EntrySequences_RstHigh_JTAG();
        }
        else // JTAG_IF
        {
            SetRST();
            SetTST();
        }
        
        ResetTAP();  // reset TAP state machine -> Run-Test/Idle
        
        if(INTERFACE == SPYBIWIRE_IF)
        {
            CheckJtagFuse_SBW();
        }
        else
        {     
            CheckJtagFuse_JTAG();
        }    
        return IR_Shift(IR_BYPASS);
    }

    2. There is still a long way before you can use AM57xx to program MSP430. You need to move all the necessary low level code from Replicator430 to yours. 

    Eason

  • Hi,

    DrvSignals();
    MsDelay(10); // delay 10ms

    ClrTST();
    usDelay(800); // delay min 800us - clr SBW controller
    SetTST();
    usDelay(50);

    // SpyBiWire entry sequence
    // Reset Test logic
    ClrSBWTDIO(); // put device in normal operation: Reset = 0
    ClrSBWTCK(); // TEST pin = 0
    MsDelay(1);
    // wait 1ms (minimum: 100us)
    // SpyBiWire entry sequence
    SetSBWTDIO(); // Reset = 1
    SetSBWTCK(); // TEST pin = 1
    MsDelay(20);
    // initial 1 SBWCLKs to enter sbw-mode
    SetSBWTDIO(); // Reset = 1
    usDelay(60);
    ClrSBWTCK();
    usDelay(1);
    SetSBWTCK();
    MsDelay(5);

    ResetTAP(); // reset TAP state machine -> Run-Test/Idle
    //TRIGGER;
    JtagId = IR_Shift(IR_BYPASS);

    Above is my entry seq. In which i have done the fuse checking.

    Regards,

    Prerak

  • Prerak Patel said:

    I am not able to get JTAGID after entry sequence. I have verified entry seq. on DSO. and it seems like correct.

    And what is JTAGID value? Something or nothing? Check on DSO value when RESET line (SBW_DIO) is changing direction, master input / target output.

    This is my SBW flasher entry (get device) sequence...

            ; Default value

            TCK1CLR               ; TEST = 0

            TD1SET                ; RESET = 1

            ; Change TCK / TD direction to output

            TD1OUT                ; RESET = 1

            TCK1OUT               ; TEST = 0

            ; SBW mode enter

            TCK1SET                ; TEST = 1

            mov.w #2, R15          ; Delay 200 us
            call #Delay100us

            TCK1CLR                ; TEST = 0

            TCK1SET                ; TEST = 1

            ; SBW mode is active now

            ; Reset JTAG FSM

            mov.w #7, R15

    SbwEnt2 cmp.w #1, R15
            jne SbwEnt4
            
            TD1CLR
    SbwEnt4 TCK1CLR
            TCK1SET

            TD1SET
            TCK1CLR
            TCK1SET
            TDO1SBW

            sub.w #1, R15
            jnz SbwEnt2

            ; JTAG FSM is in Run-Test/IDLE

            IHS_BYPASS

            ; Fuse check

    ...

    Log...

    -------- GetDevice --------
    #0 00000001 0000000000010000 89
    Fuse 0581 0581 0581 0581 0581 0581 0581 0581 Sync 2691 Reset

    JTAGID from device should be correct also before fuse check.

  • Hello,

    I am getting JTAG ID as 0.

    I have verified your sequence. and observed one thing,

    while passing 0xff to shift register i am getting clock low for more then 100 us. Because I am unable to provide delay of less then 60us in am5726.

    Is this observation will affect on my output?

    Regards,

    Prerak

  • Hi,

    Yes, you are right. Please see the note.

    Eason

  • Hi 

    Can you give me the manual from where you have suggested the note. Because I am using the manual in which lower limit is 100 us.

    slau320ag.pfd   Page 20.

    Regards,

    Prerak.

  • Hi guy,

    I use the same document with you. I found that on page 11. Also you can see that description on page 10, figure 8.

    You may misunderstand about 100 us. It says if you want to exit the JTAG and SBW mode, hold the clock for more than 100us. It doesn't say the maxim SBW clock low time is 100us.

    Eason

  • Prerak Patel said:

    while passing 0xff to shift register i am getting clock low for more then 100 us. Because I am unable to provide delay of less then 60us in am5726.

    There is no need for any delay because SBW support up to 20MHz signal, and I guess that your master can't change port output that fast. For delay on Cortex-M0+ I am using NOP's, there must be something similar on Cortex A15?

  • Hello folks,

    Thanks for your valuable suggestion.

    I am implementing same task in kernel space to give the delay in microseconds.

    Any one suggest me, How to use GPIO_OE register in kernel space. I am getting some random condition while switching data line to output/input.

    Regards,

    Prerak

  • Hi Prerak,

    I think you will get more help, if you ask a new question under Sitara topic.

    I will close this thread.

    Eason

  • Prerak Patel said:

    I am implementing same task in kernel space to give the delay in microseconds.

    As I already noted relating to SBW shifting functions, there is no need for precise SBW_TCK signal. Yes, it is nicer to see SBW_TCK signal with constant frequency on scope, but SBW interface will work just fine without it. Just take care to give enough time for charging / discharging cap on reset pin of target device.

    However, there must be provided precise clock during flash operations (erase / write) on target device, in 257 - 476 kHz range, but I guess that your master can handle this without problems.

  • Hi, Prerak, 

    I think we have resolved your MSP430 related questions. Please click on the This resolved my issue  button to close this thread. 

    If you have further questions about how to create accurate timing in Sitara environment, please have a new post in forum of [Processors]Sitara Process. There will be many experts to answer Sitara related questions. 

    Thanks, 
    Lixin 

**Attention** This is a public forum