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.

Expression not showing correct value



Whilst working on custom code, from examples, to interface an f28027 to a drv8353rs, I came across this problem with CCS10.4:

I'm reading 8 registers from the 8353 chip over the SPI interface. These are read into an array as follows:

void spi_read(void){
    uint16_t i;
    uint16_t sdata;         // send data

    for (i = 0; i<8; i++){
        sdata = (i<<11)|0x8000;
        SPI_write(mySpi,sdata);
        //
        // Wait until data is received
        //
        while(SPI_getRxFifoStatus(mySpi) == SPI_FifoStatus_Empty)
        {
        }
        reg_data[i] =  SPI_read(mySpi); // mask don't care bits
    }
    return;

I then added reg_data to the "watch expressions" list, but the expressions window does not contain the correct values for the array. The memory where the array is storred DOES have the correct Values:

How can this be fixed?

Mike.

(Also why do some variables come up in the expressions window and others in the variables window when they are both added to the watch list in the same way?)

  • Hi Mike,

    I then added reg_data to the "watch expressions" list, but the expressions window does not contain the correct values for the array. The memory where the array is storred DOES have the correct Values:

    Is the CPU halted while capturing these results? If the CPU is running and the memory contents change in the background, you may find different results in different views, since the debugger reads are happening at different times. If you have not enabled "Continuous refresh", please enable that and try.

    (Also why do some variables come up in the expressions window and others in the variables window when they are both added to the watch list in the same way?)

    Variables view is auto-populated by CCS with the list of all local variables within the scope. It does not include any global variables and you cannot add or remove variables from this view. Whereas in Expressions view, you can add any variables or expressions. When you perform "add to watch", it gets added to expressions view

    Regards,

    Veena