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.

Project 0 problem

Other Parts Discussed in Thread: HALCOGEN, RM42L432

I just received my Hercules LaunchPad evaluation kit (RM42x) and I started working on the project 0 tutorial (PWM Generation using the Hercules LaunchPad) which can be found here:

    http://www.youtube.com/watch?v=WYjLGBr9n3M


When I try to compile the code (Run->Debug) I get the following error message:

   Cannot open source file F021.h

I can find this header file and include its location in the path for the compiler but more error messages for even more absent header files appear when I try to compile. It appears that there are numerous header files that are included in this example code that I could not possibly need for this relatively simple program.

What is going on?  If Halcogen can't do this right why do I need it at all?

I should mention that I am running CCS 6.0.1 and Halcogen 04.01.00 on a PC running the Windows 8 OS. I should also note the following. One step of the project video tells me to right-click the project in CCS and the go to the properties window and include the header files that were created previously in Halcogen. I was not able to add the header files by simply opening the "Add file path" selecting "Workspace" and then clicking the include dir as done in the video. The OK button was grayed-out and there was a message that said "One of the elements selected isn't a file". So instead I selected all the files in the include dir and then the OK button worked. In the file path window I then see multiple header files with paths that look like this example:

  "${workspace_loc:/${ProjName}/include/adc.h}"
  

Thank you

 

  • If I try to include just the missing F021.h file by right-clicking the project in CCS then selecting Properties and adding the header file in the file path window (bottom window) I see a path for the file that looks like this:

       C:\ti\Hercules\F021 Flash API\02.01.00\include\F021.h


    which differs from the path example given in my previous post in that backslashes are used instead of forward slashes. Is this important under the Windows OS? I am far more experienced with Linux than Windows (which i rarely use).

  • The forward / back slash difference shouldn't matter.  CCS isn't consistent, and sometimes will change it on you, but it should be OK either way.

     

    You can only add include paths from the workspace if the folder is shown there, which I think will only happen if it is in the same directory as the project.

     

    You should be able to go to the project properties->build->ARM Compiler-> Include Options , click the plus button and select "file system".  Then go find the halcogen include folder, there should be no need to include each file individually.

     

    If this doesn't solve the issue, can you post the errors you are getting?

  • Hi David

    If I go to project properties->build->ARM Compiler-> Include Options -> "file system" and then try to choose the include dir all that happens is that the include dir is opened and all files are listed. I can't seem to simply choose the entire directory.

  • I tried to select one of the header files and then edit it to eliminate the file name and leave only the path to the include dir but that does not work either. I still get the same error which is:

    #1965 cannot open source file "F021.h"

    which is apparently used on line 81 of the header file Device_RM42.h

  • Does the path that the file exist in show in the Project Explorer window if you expand your project and the Incudes sub-item?

     

    If it is there but greyed out then CCS isn't showing a valid path.  If it is there in normal black, you should be able to expand it and see the file there.

     

    Can you attach a screen shot?

  • Hi David


    The header file is not in the include dir of the project. But it is on my machine elsewhere.

  • So you need to tell the project to include the file, regardless of where it exists on the filesystem.   It doesn't need to be in the same directory as the project.

     

    For instance, my project uses includes from several locations, so my project explorer looks like this:

     

    And in my project properties I have each directory shown there specified.  Some hardcoded paths, most relative paths

     

    You need to have the directory that has that file in the include search path.

  • David


    I did as you suggested but now the console window shows an error in compilation and CCS launchs a debug session after which I can no longer see what the source of the error is. But despite this I now have a flashing D8 JTAG LED. The light is flashing at a rate that is fast than once per second so I guess this not the LED that should be blinking in project 0.

    I am not happy with Halcogen or CCS! This is very frustrating. I just want to test the board and software so that I can move on to my project but that is proving difficult because of something as simple as getting the correct header files compiled. This is why I do not like high level languages and high level development environments. There is too much that happens under-the-hood and out of my control and the ease-of-use claims never seem to valid. Despite my expressed frustrations I still need to get this working and I am thankful for your assistance.

    What should I do next?

    PS: I should also mention that I had to clean the project when ever I changed include files. This is something I would expect to have to do with most compilers or makefiles but it is not something that I expected of a high level coding environment like CCS.

    Dan

  • Can you copy the compiler error you are getting and paste it here?  CCS has different perspectives, and it probably changed to the debug perspective.  You can go back to the Edit perspective from the upper right corner.

    I know new tools are tough, but hang in there...CCS and halcogen took me a bit of getting used to, but like anything once you learn them they aren't that bad :)

  • Going to Edit perspective does not recover the fatal error message.

  • I don't really care if I get project 0 specifically working. I just need a "hello world" type example working before I dig into the details of my project. Does anybody have any simple code that flashes an LED with some prescribed duty cycle not necessarily controlled by the HET?

  • In halcogen if you go to help-> help topics ->examples look at example_rtiBlinky.c

     

    It sets up an rti interrupt and toggles an led connected through a het I/O pin.  You'll need to look at the schematic on the board (or look on the screen if it's labeled) to see if you have an led connected through het that you can configure.

  • Hi David

    I don't see example files for the RM42L342 (Hercules Launchpad). I do see example files for the RM42x_41x. Will they work for the RM42L342?

    Thanks,

    Daniel

  • Daniel,

    Yes, examples for RM42x/RM41x will work on the RM42L432.

    Regards, Sunil

  • Thanks I will give it a try.

  • I tried building the example_rtiBlinky.c code and I get the same error message that I got when trying to build the project 0 code. The compiler can't find the F021.h header file.

    What is going on? Getting the correct header files included should be easy. Isn't that what Halcogen is ostensibly designed to do? Any help appreciated.

    Daniel

  • Daniel,

    Can you upload your CCS project? Zip the top-level folder so all include files and source files get included in the zip archive, along with the HALCoGen setup files.

    Regards, Sunil

  • Hi Sunil

    Here is the zipped folder.

    2860.Blinky.zip


    Thanks,

    Daniel

  • Daniel,

    There are a lot of header files individually added to the --preinclude section. This is not required. You just need to add the HALCoGen generated "include" folder path to the #include search path. Once you do this, your build settings will look like this:

    Once you correct this and compile, you get a compile error due to the typo:

    Once you correct this typo (change it to rtiNOTIFICATION_COMPARE0) and build the project, it will create the out file you need.

    Good luck.

    Regards, Sunil

  • OK I fixed that one error and I also added the include file folder in the manner you specified but I still got an error message which said that F021.h was missing. So I then included F021.h and did a "Clean Project" and it compiled. I think it is running but I don't see a light flashing once per second. Which LED should be flashing?

  • That's a good question....What does the code say? What happens in the rti notification?

     

    It should tell you the led that should blink.

  • Dan,

    You have configured the RTI interrupts to be fast interrupts (FIQ). FIQ handling is not enabled inside the CPU. Your main routine only enables IRQ handling. Please change the line "_enable_IRQ()" to be "_enable_interrupt_()".

    This will enable both IRQ and FIQ handling, and then your project will work.

    Regards, Sunil

  • Please note that the correct function name is "_enable_interrupt_()" and not "_enable_interrupt()" as I had posted earlier.

    Regards, Sunil

  • I forgot to mention one more change that is required in your software.

    /* USER CODE BEGIN (4) */
    void rtiNotification(uint32 notification)
    {
    	gioSetPort(hetPORT1, gioGetPort(hetPORT1) ^ 0x00000001);
    }
    /* USER CODE END */
    

    The above code toggles HET[0]. To toggle HET[8] you need to change the gioSetPort function call to be

    gioSetPort(hetPORT1, gioGetPort(hetPORT1) ^ 0x00000100);

  • Thanks Sunil. I will try those changes Tuesday.

  • Thanks Sunil

    The NHET08 LED is now flashing at a rate of 1 Hz.

    Yippee!!

    So ... now how do I stop it from blinking? Do I have to disconnect from power? Write over the code in the flash?

  • You'll have to overwrite the flash with code that doesn't flash the led.  Just take out the line that toggles the bit.

  • I want to change the blink rate in the example_rtiBlinkey.c code so I opened my blinky project in HalCoGen and went to the RTI1 Compare tab and tried to increase the time between blinks by a factor of 2 by changing the value of Update Compare from 1000000 (its present value) to 2000000 but HalCoGen does not allow me to edit these values at all. So what is going on?

  • Sorry. Problem solved. Apparently I can only change the blink rate by changing the "Compare 0 Period".

  • Dan,

    You can write to the "update compare register" by accessing it via the structure defined in the rti.h header file.

    rtiREG1->CMP[0U].UDCPx = {any value you want}

    HALCoGen assumes that you are looking for a periodic interrupt, so it configures the update compare value based on the initial compare value and the period selected.

    -Sunil

  • Thank you, Sunil.

    In the example_rtiBlinkey.c source code I would like to conditionally change the blink rate within the corresponding interrupt service routine for the timer/counter. How can I do this? For example, lets say that I want to increment the time which the LED is turned on and off.


    Thanks,

    Daniel

  • Daniel,

    Let's suppose you have the initial compare value set to 10000 with the update compare value of 10000 as well. This will cause a periodic interrupt to be generated when the free-running counter (FRC) becomes 10000, 20000, 30000, and so on. You toggle the LED in each RTI interrupt service routine (ISR).

    If you want the increase the time for which the LED stays ON/OFF, you can increase the update-compare value within an ISR as well. e.g. you can increase the update compare value in the first ISR to be 15000. Then you will get interrupts when the FRC becomes 10000, 25000, 40000, 55000, 70000, and so on.

    -Sunil

  • Thanks Sunil


    I tried incrementing the time that LED is on or off by 1 sec as the ISR gets called and it works fine.