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.

Reg MSP432 SRAM memory access while using JTAG emulator for programming the MSP432 Launchpad

Hai,

Now I am working with MSP432 Launchpad. I am trying to write some text in SRAM memory region. While using Launchpad Emulator, I successfully wrote my text in SRAM memory. But When I used JTAG emulator instead of MSP432 emulator, I am not able access SRAM memory. After googling through th web pages, I came to know that this is because of BSL protection of memory regions. How can I unprotect the SRAM memory regions using BSL. Please let me know the steps for unprotect the SRAM as soon as possible.

  • Hi Keerthana,

    Which JTAG emulator are you referring to?? Could you please share your project?? Also which IDE are you using??

    Thanks,

    David
  • Hello David,

    Thank you. I am using Code Composer Studio v 6.1.1 and  JTAG emulator  xds100v2 TI DSP emulator. I can get the output for normal LED blinking codes.I attached my project file. I am trying to import example project.

    #include "msp432.h"
    #include "driverlib.h"
    #include "string.h"
    void TestSRAMBankEnable(void);
    int main(void)
    {
        MAP_WDT_A_holdTimer();
        MAP_Interrupt_disableMaster();
        MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
        MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48);
        while(1)
        {
        TestSRAMBankEnable();
        __delay_cycles(1000000);
        __delay_cycles(1000000);
        __delay_cycles(1000000);
        __delay_cycles(1000000);
        __delay_cycles(1000000);
        __delay_cycles(1000000);
        }
    }
    void TestSRAMBankEnable(void)
    {
        uint32_t i;
        while (!(SYSCTL_SRAM_BANKEN & SYSCTL_SRAM_BANKEN_SRAM_RDY));
        SysCtl_enableSRAMBank(SYSCTL_SRAM_BANK7);
        while (!(SYSCTL_SRAM_BANKEN & SYSCTL_SRAM_BANKEN_SRAM_RDY));
        * ( (uint32_t*) 0x2000EFFC) = 0x01;
        i = * ( (uint32_t*) 0x2000EFFC);
        if (i== 0x01)
        {
            P1DIR |= BIT0;
            P1OUT |= BIT0;
            for (i=0;i<100000;i++);
        }
        else
            while(1);
    }
       This code is working for me while I am using MSP432 emulator in launchpad. But It is not working for me while using JTAG emulator. 
  • Hello David,

    Initially I used flash memory to store the text. But Now I want to store that string into SRAM memory region. Following code is fash memory access code. Also I did not check the flash memory access by programming the launchpad using external JTAG emulator.

    #include "msp432.h"
    #include "driverlib.h"
    #include "string.h"
    #define BUFFER_MEMORY_START 0x000200000 // Starting Flash Address to Read/Write Operation

    uint8_t buffer[55] = {"STEPS Knowledge Services Private Ltd, Coimbatore-16"};
    uint8_t i=0,ReadFlashData[50];
    uint32_t add_ptr = 0x200000;

    void EraseAndProgramFlash(void);
    void ReadFlash(void);

    int main(void)
    {
    MAP_WDT_A_holdTimer();
    MAP_Interrupt_disableMaster();
    MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
    MAP_FlashCtl_setWaitState(FLASH_BANK0, 2);
    MAP_FlashCtl_setWaitState(FLASH_BANK1, 2);
    EraseAndProgramFlash();
    __delay_cycles(100000);
    ReadFlash();
    while(1);
    }

    void EraseAndProgramFlash(void)
    {
    MAP_FlashCtl_unprotectSector(FLASH_INFO_MEMORY_SPACE_BANK0,FLASH_SECTOR0);
    while(!MAP_FlashCtl_eraseSector(BUFFER_MEMORY_START)); // Erase Sector Value
    __no_operation(); //set breakpoint here to view memory
    while (!MAP_FlashCtl_programMemory(buffer,(void*) BUFFER_MEMORY_START, 52)); // databuffer, starting address, datalength
    MAP_FlashCtl_protectSector(FLASH_INFO_MEMORY_SPACE_BANK0,FLASH_SECTOR0);
    __no_operation(); //set breakpoint here to view memory
    }

    void ReadFlash(void)
    {
    MAP_FlashCtl_unprotectSector(FLASH_INFO_MEMORY_SPACE_BANK0,FLASH_SECTOR0);
    MAP_FlashCtl_setReadMode(FLASH_BANK0,FLASH_MARGIN0_READ_MODE); // Enable Read Operation
    MAP_FlashCtl_enableReadBuffering (FLASH_BANK0,FLASH_DATA_READ); // Select Data Read Option
    for(i=0;i<=50;i++)
    {ReadFlashData[i] = * ((uint32_t*) add_ptr++);} // Read value From the Corresponding Memory Location
    __no_operation(); //set breakpoint here to view ReadFlashData buffer
    MAP_FlashCtl_protectSector(FLASH_INFO_MEMORY_SPACE_BANK0,FLASH_SECTOR0);
    }

     

      For testing purpose I wrote 0x01 in SRAM memory location (I attached this code in previous post)

  • Dear Keerthana,

    Is this what you are expecting to see?

    I am using a later version of CCS (Version: 6.1.2.00015) and driverLib.

    Chris

  • Hello chris,

          Thank you. Actually I am able to view the above output while programming MSP432 launchpad using on-board emulator. But when I am trying to use external JTAG emulator, program never exit from while loop (line no 37). This is because of protected memory access. How can I unprotect the memory access.

  • Hello Keerthana S.,

    I wanted to show you that with the XDS100v2 external debugger that it does work.  If you look in the Debug window of the screen capture you will see that I am using the external debugger and not the internal XDS110.  Are you in a position to update your CCS?

    Chris

  • Hai Chris,
    Thank you. I didnt notice the emulator used by you. Now Its working when using CCS 6.1.2.
  • Hello Chris,
    May i know what version of driverLib you have used ?
  • In this particular example I am using v3_21_00_05.

    Regards,
    Chris
  • hello chris,

    I couldn't find the driverlib v3_21_00_05 online. 

    can you send us the link for the driver lib v3_21_00_05 .

  • hello chris,

    I couldn't find the driverlib v3_21_00_05 online.

    can you send us the link for the driver lib v3_21_00_05 .
  • I do not believe this is publicly available. Are you able to find 3_10_00_09? For this example the differences are not relevant as verified by an earlier post.

    Regards,
    Chris
  • hi chris

       i am not getting an error while dumping the code using xds100v2 jtag emulator . but while trying to access the sram space its getting suspended. flash memory access program is working fine. 

  • Thank you. Can you confirm that you are seeing this issue with the latest version of CCS (6.1.2) and driver lib (3_10_xx_xx)?

    Regards,
    Chris

**Attention** This is a public forum