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.

uart problem



Hi

I am using C6748. I configure UART1 to communicate to external device (the PC).

I can send data or it seems OK.

But on the receive side I have a very strange thing happening.

 

I poll the UART receive by

while(CSL_FEXT(ISPUartRegs->LSR, UART_LSR_DR)!= 1);

ISPUartRegs is the base address pointing to UART1 base which is (0x01D0C000u).

 

I can see that data is ready on the LSR.DR bit of UART1 but the code does something strange.

I trace dissambly of  while(CSL_FEXT(ISPUartRegs->LSR, UART_LSR_DR)!= 1);

The assembly code first loads the address of LSR and then ANds it to get LSR.DR. The address that seems to be loaded for UART1 LSR is 0x00E20001 instead

of   (0x01D0C000)+5= UART1 base + 5.

 

What could be the reason for this.

Vert strange. I have  occasions when the code does the right thing.

 

regards

izzet

 

 

 

  • Izzet,

    The value 0x00E20001 looks more like the value that might be read from the LSR register. That value should then be AND'd to get LSR.DR. This would be correct operation.

    If that is the case, the lsb is 1 which would indicate the data is ready.

    Why would you expect to add 5? It should always be a multiple of 4 unless you are leaving off some word-addressing information.

    Regards,
    RandyP

  • Hi Randy

    That value was not the one in LSR it was like 0x0000020 which says no data.

    This problem disappeared now. I think I input some wrong mapping in .cmd file.

    Thanks for the quick response.

    I moved on. Now I am trying to write my code to the flash which is AT25DF041A from adesto, an SPI flash.

    I have an another question.

    I get my .out file from CCSV5 and use hex6x to generate Tektronik formated hexadecimal code.

    I use the hex6x witht the following options:

    main.out

    -memwidth 8

    -romwidth 8

    -boot

     -map MXL_6748.map

    -x

     

     

    I have my own routine to read the code from PC via UART.

    I run my code with JTAG and write the data to the flash.  This looks ok since I reread data from flash and compare it with what it should be.

     

    But when I choose boot from SPI_1 flash and start the board as standalone, it does not do anything sensible.

    When the DSP is reset, it must see that SPI1 boot option is selected and should do the necessary pinmuxing to communicated the SPI.

    Does  the bootloader set the CPU speed. I suspect there is an issue here.

    The SPI speed cannot be more 40MHz or 70 MHz. How does clocking occur after booting.

    is there a way I can tell the bootloader to set the CPU at a certain value.

     

    Best regards