Jump to content

Using Energia with a custom board (CC3220MODASF)

Recommended Posts

I'd like to use Energia with my custom board that has the CC3220MODASF MCU on it.  Can someone please provide step-by-step instructions on the steps required to have my custom board show up in the "Boards" in the Energia menu and the required edits to make it usable ? I've done quite a bit of online research and in this forum and found bits and pieces but nothing complete. From this ticket and others I found, putting the pieces together, I believe this is the correct partial course of action:


1.  Install the corresponding Launch Pad board in Energia (CC3220SF_LAUNCHXL) --> DONE

2. Go to "....\AppData\Local\Energia15\packages\energia\hardware\cc3220emt\5.6.2" 

3. Edit "boards.txt" , copy the entry for the board of interest and replicate for the custom board after renaming , ie:


Took this one:


and created this one:

CC3220SF-LAUNCHXL.name=CC3220SF_CUSTOM_BOARD --> renamed 
CC3220SF-LAUNCHXL.build.variant=CC3220SF_CUSTOM_BOARD --> renamed 
CC3220SF-LAUNCHXL.build.board=CC3220SF_CUSTOM_BOARD--> renamed 


5. In the "variants" folder, I created a copy of the "CC3220SF_LAUNCHXL/" and named "CC3220SF_CUSTOM_BOARD"


I'm not sure what to do after this step. I know I have to do some pin mapping/edits, but not where where/how. 


My questions are:

A. Are the steps above correct? 


B.  After this, opening up Energia, I know see "CC3220SF_CUSTOM_BOARD" but no longer see "CC3220SF_LAUNCHXL". Why is that? Isn't this supposed to leave CC3220SF_LAUNCHXL and just add "CC3220SF_CUSTOM_BOARD"?


C. In the "CC3220SF_CUSTOM_BOARD/" folder, is "pins_energia.h" the only file I need to edit? The current contents are


static const uint8_t RED_LED = 29;
static const uint8_t GREEN_LED = 10;  /* same as pin 40 */
static const uint8_t BLUE_LED = 10; /* mapped to same as GREEN_LED */
static const uint8_t YELLOW_LED = 9;  /* same as pin 39  */

static const uint8_t PUSH1 = 3;
static const uint8_t PUSH2 = 11;

static const uint8_t SDA = 10;
static const uint8_t SCL = 9;

static const uint8_t MOSI = 15;
static const uint8_t MISO = 14;
static const uint8_t SCK  = 7;

static const uint8_t A0 = 23;
static const uint8_t A1 = 25;
static const uint8_t A2 = 26;
static const uint8_t A3 = 24;

D. There's also the "pins.c" file. It looks like I have to edit that file as well? If so, I'm not sure how to edit these and what keyword I need to use instead of "PIN_FUNC_UNUSED"? The current contents are:


 PIN_FUNC_UNUSED,    /*  dummy */
    PIN_FUNC_UNUSED,    /*  1  - 3.3V */
    PIN_FUNC_UNUSED,    /*  2  - GPIO_03 */
    PIN_FUNC_UNUSED,    /*  3  - GPIO_13 */
    PIN_FUNC_UNUSED,    /*  4  - GPIO_12 */
    PIN_FUNC_UNUSED,    /*  28 - GPIO_30 */
    PIN_FUNC_UNUSED,    /*  29 - GPIO_09 */

E. Can someone explain how the "pins.c" and "pins_energia.h" relate to each other? For example, how does this line in "pins_energia.h":

"static const uint8_t RED_LED = 29;"

relate to the same pin number in  "pins.c" file? Pin 29 in that file shows it's unused:

"    PIN_FUNC_UNUSED,    /*  29 - GPIO_09 */"


I'm using: energia-1.8.10E23 and I have the XDS110 standalone programmer, which I plan to use with Energia to program my custom board. 


Link to post
Share on other sites
  • 3 weeks later...

Thanks StefanSch. Can you please comment on what files I need to hack to customize the pinouts to suit my custom board (question 5C-5E)? Custom board not only uses GPIOs, but also SPI, UART,  and ADCs. 

I've got all my IO pins configured in CCS using SysConfig (Pin Mux Tool). I'm not sure what is the process to configure these pins for use with Energia.  Is there a way to somehow import the output from the SySConfig tool into Energia? 


Link to post
Share on other sites

Hi Berry,

i am not the expert on the cc3220 as this uses RTOS functions to implement the multi threading features. In this implementation a lot of the functions are inside the RTOS library.

So check following files:

Board_init.c - to adopt pins for SPI, ADC, UART

Board.h - to adopt pins for I2C, LEDs, SPI

pins.c -  maps function to board pin (not CC3220 pin)

pins_energia.h -  maps function to board pin (not CC3220 pin)

Note: DIOxx is pin xx on CC3220 - sometimes the use of board pins and CC3220 can be confusing but needs to be handled carefully.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...