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.

CCS/EVMK2G: unable to access SPI registers

Part Number: EVMK2G

Tool/software: Code Composer Studio

Hi,

I'm trying to write to the SPI registers but get a "data abort" error, looking at the register window in CCS debug, while most register groups are readable, the SPI register group shows "error: unable to read" by each register. I must be missing a step in enabling the SPI, please could you let me know what I need to be doing at startup?

Thanks,

Steve

  • Hi Steve,

    Do you have the GEL file loaded? Also check if the SPI clock is enabled from the psc.

    Best Regards,
    Yordan
  • Hi Yordan,

    I have GEL files loading for the A15 and C66xx. On further investigation I found that the SPI registers were fine at the point execution runs to main(), inside main the first thing board setup is doing is calling the function MMUConfigAndEnable(), this is where the viewable values in the SPI rgisters disappear and are replaced with the "error: unable to read" message.

    I dont have any experience of programming the MMU, so I'm not sure why this causes problems for the SPI registers. I also noticed the PLL registers are not viewable, but this is right after loading and before beginning to run code. I'm not sure if the two are related, or if there was something else I should have done with board configuration.

    I tried changing the dip-switch options on the board on the board, but I'm not sure it helped any. I did try commenting out the MMU config and was able to keep the SPI register view, but I'm not sure I can just leave it out.

    Thanks,

    Steve

  • Hi Yordan,

    I stepped down into MMU config and the last function "CP15MMUEnable" causes the issue below calling the line "MCR     p15, #0, r0, c1, c0, #0".

    Steve

  • Hi Yordan,

    I found I needed to add the following MMU setup code to mmu.c to enable the SPI register banks:

    {

    #define START_ADDR_DEV2                     (0x20000000) //0x20000000~0X7FFFFFFF

    #define NUM_SECTIONS_DEV2                   1536

    REGION regionDev2 = {

                            MMU_PGTYPE_SECTION, START_ADDR_DEV2, NUM_SECTIONS_DEV2,

                            MMU_MEMTYPE_DEVICE_SHAREABLE,

                            MMU_REGION_SECURE,

                            MMU_AP_PRV_RW_USR_RW ,

                            (unsigned int*)MMUTable

                           };

        MMUMemRegionMap(&regionDev2);

    }

    Unfortunately I'm still unsure why the PLL rgisters are not viewable on connection to the board.

    Regards,

    Steve

  • Hi Steve,

    Sorry for the late reply.

    Are you using the onboard XDS200 emulator?

    Before I connect to a core i was getting the same "error: unable to read". When I connected to the C66x core, I am seeing both PLL & SPI registers, see screenshots attached screenshots:

     

    Best Regards,
    Yordan