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.

TMS320F28386S: Need CM gpio example

Part Number: TMS320F28386S
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE, MSPDRIVERLIB

I did not find an cm projects that have gpio examples so I imported an empty cm project, used what worked for the C28 and fired up sysconfig.

It will not build as the console states: Missing argument: --board or --device must be specified. I have not had this problem when adding .syscfg files C28 projects and sysconfig insist on a device type before it will add a device.

It also put the ix-Nay on all of these lines:

#include "driverlib.h"
#include "device.h"

    Device_init();                      // Initialize device and peripherals clock (FILE: device.c)
    Device_initGPIO();

    Interrupt_initModule();             
    Interrupt_initVectorTable();       

    EINT;                             
    ERTM;  

So I am about to be in deep kimchi here as this is my first time addressing the CM side of this processor.

Thanks,

John

  • Hi John,

    What does your current syscfg file look like?

    Are you using the stand alone SysConfig tool or importing sysconfig through your CCS?

    If you are using the stand alone tool (not in CCS) it may be an issue that the sysconfig file you're importing might not have the correct headers.

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "F2837xD" --package "F2837xD_176PTP" --part "F2837xD_176PTP" --product "C2000WARE@3.01.00.00"
     * @versions {"tool":"1.0.0+dev","templates":null}
     */
    
    /**
     * Import the modules used in this configuration.
     */

    Best,

    Ryan Ma

  • Thanks for the post.

    I reckon I am importing sysconfig, I am adding a c2000.syscfg file to my project per the documentation I read. When it comes up it prompts me to go back a page and fill in the device and sw, else it will not generate.

    Here is my board.c file:

    
    #include "board.h"
    
    void Board_init()
    {
    	EALLOW;
    
    	PinMux_init();
    	GPIO_init();
    
    	EDIS;
    }
    
    void PinMux_init()
    {
    	// GPIO13 -> myGPIO_Pin13Set Pinmux
    	GPIO_setPinConfig(GPIO_13_GPIO13);
    
    }
    
    void GPIO_init(){
    		
    	//myGPIO_Pin13Set initialization
    	GPIO_setDirectionMode(myGPIO_Pin13Set, GPIO_DIR_MODE_OUT);
    	GPIO_setPadConfig(myGPIO_Pin13Set, GPIO_PIN_TYPE_STD);
    	GPIO_setMasterCore(myGPIO_Pin13Set, GPIO_CORE_CM);
    	GPIO_setQualificationMode(myGPIO_Pin13Set, GPIO_QUAL_ASYNC);
    }
    

    Thanks,

    John

  • Hi John,

    Could you show your c2000.syscfg file instead of the board.c file? This may give more clues to why you're not able to generate any files.

    Double check to see if your c2000.syscfg has the correct headers like in the snippet I sent above. Try importing this syscfg file and see if it generates.

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "F2838x" --package "176pin" --part "F2838x_176pin" --product "C2000WARE@4.01.00.00"
     * @versions {"tool":"1.0.0+dev"}
     */
    

  • I copied the lines above into my syscfg file. It compile OK but upon build I get this error:

    subdir_rules.mk:9: recipe for target 'build-664209937' failed
    Invalid argument '--product': No product with name "C2000WARE" and version "4.01.00.00" found

    I seems this only occurs with CM projects, CPU1 works fine.

    If I take the board.c and .h files and copy them into main and do away with syscfg I get these errors which looks like it wants to build for CPU1 instead of CM although I imported a CM empty project and also tried uart_ex1_echoback which claims to be CM Flash based:

    >> Compilation failure
    subdir_rules.mk:9: recipe for target 'empty_driverlib_main_cm.obj' failed
    "../empty_driverlib_main_cm.c", line 65: error #20: identifier "EALLOW" is undefined
    "../empty_driverlib_main_cm.c", line 70: error #20: identifier "EDIS" is undefined
    "../empty_driverlib_main_cm.c", line 76: warning #225-D: function "GPIO_setPinConfig" declared implicitly
    "../empty_driverlib_main_cm.c", line 76: error #20: identifier "GPIO_13_GPIO13" is undefined
    "../empty_driverlib_main_cm.c", line 83: warning #225-D: function "GPIO_setDirectionMode" declared implicitly
    "../empty_driverlib_main_cm.c", line 83: error #20: identifier "GPIO_DIR_MODE_OUT" is undefined
    "../empty_driverlib_main_cm.c", line 84: warning #225-D: function "GPIO_setPadConfig" declared implicitly
    "../empty_driverlib_main_cm.c", line 85: warning #225-D: function "GPIO_setMasterCore" declared implicitly
    "../empty_driverlib_main_cm.c", line 85: error #20: identifier "GPIO_CORE_CM" is undefined
    "../empty_driverlib_main_cm.c", line 86: warning #225-D: function "GPIO_setQualificationMode" declared implicitly
    "../empty_driverlib_main_cm.c", line 86: error #20: identifier "GPIO_QUAL_SYNC" is undefined

  • Hi John,

    I don't believe we have CM support in SysConfig just yet. We only have compatibility with CPU1 of the C28x core, but are actively working on extending this support out to other cores. To implement CM support, you would need to refer to the example projects in C2000Ware, which I believe configure CM using DriverLib code.

    There are source files which detail the DriverLib code for GPIO on the CM core, you can use those as reference for adding GPIO use to an empty CM example project.

    Regards,

    Peter

  • Thanks for posting.

    I have had a couple of people recommend that I use sysconfig rather than examples. So I try doing that now. So I have some questions.

    1) Sysconfig allows the choice of CM for the core but it does not work. Is this documented anywhere? It could save people several hours of frustration.

    2) I cannot find a gpio example in this directory or subs

    C:\ti\c2000\C2000Ware_4_01_00_00\driverlib\f2838x\examples

    Could you point me to the example you speak of?

    3) My search for DriveLib only finds MSPDriverLib. Could you please provide a path to some documentation?

    Thanks,

    John

  • Hi John,

    1) Sysconfig allows the choice of CM for the core but it does not work. Is this documented anywhere? It could save people several hours of frustration.

    I stand corrected, there does look to be CM support in SysConfig but I cannot comment on how extensive that support is, I would have to reach out to another expert who is aware of the development progress on that.

    2) I cannot find a gpio example in this directory or subs

    C:\ti\c2000\C2000Ware_4_01_00_00\driverlib\f2838x\examples

    Our GPIO examples are typically labeled as LED or LED_BLINKY in which a GPIO (typically connected to an LED on our EVMs) is configured and periodically toggled. You can find the relevant example project at this location

    C:\ti\c2000\C2000Ware_4_01_00_00\driverlib\f2838x\examples\c28x_cm\led

    3) My search for DriveLib only finds MSPDriverLib. Could you please provide a path to some documentation?

    For the DriverLib functions, I was referring to the gpio.c and gpio.h files at this location

    C:\ti\c2000\C2000Ware_4_01_00_00\driverlib\f2838x\driverlib_cm

    Let me know if this c28x_cm\led project is what you are looking for to get GPIO working on the CM core

    Regards,

    Peter

  • Thanks for the quick reply.

    I loaded the example projects and changed them to flash base build configs. I fixed the debug config to run the cm. I now see that CPU1 must configure the GPIO so now I must figure out how to run cpu1 and cm at the same time.

    John