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.

ioport migrating from CCS3.3 to CCS6

Hi,

Just migrated from CCS3.3 to CCS6 - all things seem to work, save for the ioport - we've been using

*(ioport int *) CE3_1 = 0xFF03; /* CE3 EMIF Space control register 1 */
*(ioport int *) CE3_2 = 0xFFFF; /* CE3 EMIF Space control register 2 */

 but it seems to get stuck for some reason when I try and write to CE2 space control register

*(ioport int *) CE2_1 = 0x0a10; /* CE2 EMIF Space control register 1 */
*(ioport int *) CE2_2 = 0x0150; /* CE2 EMIF Space control register 2 */

*(ioport int *) CE3_1 = 0xFF03; /* CE3 EMIF Space control register 1 */
*(ioport int *) CE3_2 = 0xFFFF; /* CE3 EMIF Space control register 2 */

When I tried to use 

#define CE2_1 port0800            //Ce2 memory space control register 1

ioport unsigned int port0800;    // IO Space address is 0x0800

CE2_1 = 0x0A10;                        // write 0x0A10 to CE2_1 space control register 

It complained - we used to build without any funny behaviors in CCS3.3, is there something else we need to do for the compiler or development environment?

  • Hello,
    What kind of complaint did you get? Can you post the build warning/error you see?

    Thanks
    ki
  • Hi Ki,

    Thank you for your reply. The strange thing about this error is that the project builds OK. I can load, and run it, to the point of when I get to initialising the EMIF registers. I step through, initializing CE0_1, CE0_2, CE1_1, CE1_2, and even through to CE3_1, CE3_2. But, when I attempt to write to CE2_2, the development environment seems to hang. I am using an XDS100, 5501 and CS6.1.0. The whole project builds OK, as mentioned. I can also use the memory browser to view the change in iospace registers, and can also modify the registers in this window. I've checked the GEL_MapAdd and that seems to be OK for the iospace register. I see from the documentation that suggests using a pointer to read iospace values. Thank you for your support and I look forward to your feedback. As a matter of course, please can you confirm my use of the ioport syntax.
  • Hi Ki,
    There appeared to be a subtlety with the GEL file initialization script and the function call in C. So, using the GEL_MapAdd I was super careful, and made sure that I mapped all of the addresses on iospace, or I turn it off and allow the memory browser to complain. In this instance I rechecked the mapped addresses in the GEL file. Strangely enough, I was able to change the iospace location of CE2_2 in the memory browser, but not in the function call which confused me.

    So GEL_MapAdd was the issue for CE2_2.

    The older version of CCS, namely CCS3.3 seemed to be a bit more forgiving, but I wasn't using the GEL_MapAdd as I am now, and also some of the nice script calls.

    I think this is done - thank you.

    Regards
  • Glad it is working now. Thanks for the update!

    I'm still a bit confused on what you did to resolve the issue. Was the GEL_MapAdd call for CE2_2 incorrect?

    btw - GEL_MapAdd would only specify to the debugger what memory addresses are valid, not to your application. It is to set the debugger memory map.

    thanks
    ki