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.

A few questions

I'd like to work with lm3S9D90 processor, its UART ports to be more specific. But there are some things I don't understand.

1) What is Generic Cortex M3 Device in "Project Properties"? Does it have the same registers and functionality as all processors of the series? What limitaions are there?

2) When creating a project using a specific device, is it normal, that variables don't show up and breakpoints on lines with them disappear?

In this piece of code, for example, I put breakpoints on every line, but after debugging it removes some of them. "Variables" tab is also empty.

What am I doing wrong? Also, the same code in a project for Generic Cortex M3 Device works fine.

3) How do I write to registers? I included a .h file for my chosen processor from StellarisWare package and do as in the above piece. Is this the right way? It also doesn't give access to CPU registers listed  in the "Registers" tab. How do I write to them?

4) Is there a way to see all the registers, not just a dozen listed in the "Registers" tab?

 

That's it for now. Thanks for your patience.

  • Azzar,

    I suspect what is happening here is that when you are specifying a specific device in the project wizard it is correctly setting up the memory map for the linker (by adding a .cmd file to your project) and also for the debugger.  This results in the program code being located in flash.  When setting breakpoints in flash the debugger has to use hardware breakpoints so when you start the debugger it is going to have to remove some of them as there are only a limited number of hardware breakpoints on the device.  When you are selecting Generic M3 device there is no linker command file specified and by chance the code is ending up in RAM, in RAM software breakpoints can be used so there is no limit.  In general you are likely going to hit all kinds of issues if you don't have a linker command file specified.

    As far as seeing all the registers you need to specify a specific device for that.  

     

    Regards,

    John

  • Thank you, but that brought up more questions. Sorry, I'm just getting into CCS, so I'm not yet comfortable with all the files and options.

    JohnS said:
     In general you are likely going to hit all kinds of issues if you don't have a linker command file specified.

    What is linker command file and how do I specify one? 

    JohnS said:
    it is going to have to remove some of them

    The strange thing is that it removes them on lines, where I operate C++ variables. If I create a project for a specific device with a .c file containing simple operations like 

    int a = b + с

    it removes all breakpoints.

    JohnS said:
    As far as seeing all the registers you need to specify a specific device for that.  

    I specified the device while creating the project, but when I debug under "Registers" there is only a "CPU Registers" category with R1-R12 and a few others. What else should I do to see the rest of them, UART registers, for instance.

  • A linker command file is a file that is read by the linker.  It defines what the memory of the device looks like and specifies where the various pieces of your application should go.  For example for the 9D90 it will define that FLASH starts at 0x00000000 and has a length of 0x00080000 and that SRAM starts at 0x20000000 and has a length of 0x00018000.  It will the If you create a project using the project wizard and specify a specific Stellaris device it will add the appropriate linker command file for you.  You can open the file and see what it looks like.  For more information on linker command files you can check out the users guide for the compiler tools.  For the TI ARM compiler this is the users guide: http://www.ti.com/lit/pdf/spnu151

    If you are only seeing the "CPU Registers" group in the register view then the target configuration for your project is not specifying a specific Stellaris device.  If it was setup for a 9D90 then it would look like this:

    I would suggest starting a new project.  Run the project wizard and select your options so that it looks like this:

    This will result in a project for the 9D90 that has an appropriate linker command file (.cmd) and target configuration file (.ccxml) for the 9D90 device.  I am assuming that you are using a kit that has the onboard Stellaris JTAG emulator.

     

     

     

     

     

     

  • Forgot to mention, I don't have a board and there's next to no chance to obtain it for me, so I stick with simulation. 
    Maybe this is te problem?

    I select "Cortex M3 Cycle Accurate Simulator Little Enidan" in the target configuration file, is that enough?

  • If you are using the simulator they only registers you are going to see are the core registers.  Stellaris development kits are very cheap, most of them are less that $100.  You are not going to be able to get very far using a simulator.

    The "Cortex M3 Cycle Accurate Simulator Little Endian" is the correct one to choose but keep in mind that the only thing it simulates is the core, no peripherals are simulated.

  • Thank you, that cleared it all up.
    I'll try and fetch one.