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.

TMS320C5517: Issue about host access C5517 through UHPI.

Part Number: TMS320C5517

Hi,

We use STM32F101 as the host to access C5517's  SARAM through the UHPI. We can write data to the SARAM(address >= 0x10000), but when read, only the  2nd halfword is corect, the 1st halfword is always 0.

Host accessses using /UHPI_HAS,  the Host and C5517 UHPI interface connect is :

         C5517                        HOST(STM32F101)

UHPI_HD[15..0]           D[15..0]

UHPI_HCNTL0             D[5]

UHPI_HCNTL1             D[6]

UHPI_HR_NW             D[7]

UHPI_HHWIL               D[8]

UHPI_HRDY               /READY  ( Bus Ready )

        UHPI_HDS1                /WR & /RD ( Write and Read )

        UHPI_HDS2               1

        UHPI_HCS                 CS  (chip select)

       UHPI_HAS                 /ALE  (address enable )

       UHPI_HBE0                0

      UHPI_HBE1                 0

we use Dual UHPIA mode(DUAL_UHPIA = 1 ) and First half-word is least significant( HWOB = 1).

The C code  host  accessing the UHPI is:

void HPIC( uint8_t RW_SEL ) //RW_SEL is read(1) or write(0) Register select.

{

*DSP_CS = 0x201 | (RW_SEL?0x800:0);  //DSP_CS is the DSP chip select address; DUAL_UHPIA=1, HWOB = 1

}:

void WriteDSP( uint32_t dsp_address, uint32_t dsp_data)

{

uint32_t addr;

//set HPIC

HPIC(0);

if( dsp_addr < 0x10000 )addr = (dsp_addr+0x10000)/4;

else addr = (dsp_addr+0x80000)/4;

//write HPIA

*(DSP_CS+0x40) = (uint16_t)(addr & 0xffff);//set address low

*(DSP_CS+0x140) = (uint16_t)((addr >>16)&0xffff);//set address high

//write HPID

*(DSP_CS+0x60)=(uint16_t)(dsp_data & 0xffff);//set data low

*(DSP_CS+0x160)=(uing16_t)((dsp_addr>>16)&0xffff);

}

uint 32_t ReadDsp( uint32_t dsp_addr )

{

uint32_t addr, data;

uint16_t data_0, data_1;

//set HPIC

HPIC(1);

//write HPIA

if( dsp_addr <0x10000)addr = (dsp_addr + 0x10000)/4;

else addr=(dsp_addr+0x80000)/4;

*(DSP_CS+0x40)=(uint16_t)(addr & 0xffff); //set address low

*(DSP_CS+0x140)=(uint16_t)((addr>>16)&0xffff);//set address high

//read HPID

data_0 = *(DSP_CS+0xe0); //read data low

data _1= *(DSP_CS+0x1e0); //read data high

data = data_0+(data_1<<16);

return data;

}

The write data to SARAM is correct and I verify it with CCS . But the read data is error with 1st halfword return 0( data_0 =0, data_1 is correct;).

We can capture the read and write ttiming with FPGA SignalTap Logic Analyzer., But I don't know how to put it here.

Best Regards,

Dudechao

  • Hello, how do you have the UHPI configuration register (UHPICR) register set?  Bit 2 controls 8 bit vs 16 bit address mode selection.  It is located at offset  0x1C4E.  Please see section 1.7.9 of the TRM.

  • Hello Jeff,

    Thank you for your responds!

    I 'm not set UHPICR register, the BYTEADDR bit default is 0 which is 16-bit address. I delay the host reading timing and it seem ok now when reading SARAM(address >= 0x10000),  But when host  access  C5517 64K DARAM(address<0x10000) through UHPI,it has no effect:the value of the host writing  in this area remains unchanged( with CCS checked), the host reading in this area always return 0.

    I calculate UHPI DMA address of the DSP internal memory as following:

    when visiting DARAM(address<0x10000): = (DARAM_byte_address+0x10000)/4,

    when visiting SARAM(address>=0x10000): = (SARAM_ byte_address+0x80000)/4.

    Is this right?

    Cann't the host  visit the DARAM?  If so, How to boot the C5517 from UHPI?

    Best Regards,

    Dudechao

  • Hellow Jeff,

    Thank you for your responds!

    Regards,

    Dudechao