Part Number: CC2650MODA
Other Parts Discussed in Thread: CC2650
Tool/software: Code Composer Studio
Hello,
I am working with CC2650moda and code composer v7. I am trying to display values obtained from sensors connected to the cc2650 moda into the console but cannot get printf to work. I removed most of my code to see if I could simply display “Hello World” on the screen and it still does not work. These are some of the things I have tried so far
*Make sure CIO function is enabled
*Increase heap and stack size (I have use multiple values and still nothing works)
*use System_printf and puts functions as alternatives to printf
*make sure stdio.h is included
*Use compilers 5.2.6 and 16.9.3
I do not see a CIO console appear at any point. Can anybody please help me to get printf working? Or let me know if you know of any other methods to print to the console.
Thanks so much in advance!
Best Regards,
Janelle
Below is my code:
/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/runtime/System.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
/* TI-RTOS Header files */
/*#include <ti/drivers/GPIO.h>*/
#include <ti/drivers/PWM.h>
/* Example/Board Header files */
#include "Board.h"
#include <ti/drivers/PIN.h>
#include <ti/drivers/pin/PINCC26XX.h>
#include <ti/drivers/ADC.h>
#include <stdio.h>
PIN_Config ledPinTable[] = {
IOID_0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, //OE
IOID_1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //MOSI(DIN)
IOID_3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //CLK
IOID_4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, //LE
IOID_7 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //IN1
IOID_8 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //EN1
IOID_9 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //IN2
IOID_10 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //EN2
IOID_11 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //IN3
IOID_12 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //EN3
IOID_14 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //nsleep
PIN_TERMINATE
};
static PIN_Handle ledPinHandle;
static PIN_State ledPinState;
/*int age[5]={0, 0, 1, 0,0};
int age[5]={0, 1, 2, 3, 4};
fresh2refresh.com/.../
age[0]; 0 is accessed
age[1]; 1 is accessed*/
/* * ======== main ========*/
int main(void)
{
printf("Hello world\n");
volatile uint32_t i,j;
/*Call board init functions.*/
Board_initGeneral();
// Board_initGPIO();
// Board_initPWM();
/* * ======== ADC========*/
/* ADC_Handle adc;
ADC_Params params;
ADC_Params_init(¶ms);
adc = ADC_open(IOID_14, ¶ms);
if (adc != NULL) {
ADC_close(adc);
}
int_fast16_t res;
uint_fast16_t adcValue;
res = ADC_convert(adc, &adcValue);
if (res == ADC_STATUS_SUCCESS) {
//use adcValue
}
printf("Hello world %d!\r\n", adc);*/
//////////////////////////////
printf("Hello world\n");
puts("Hello, world!\n");
// Display_print0("hey.\n");
// System_printf("hello World!\n");
ledPinHandle = PIN_open(&ledPinState, ledPinTable);
if(!ledPinHandle) {
System_abort("Error initializing board LED pins\n");
}
//return(0);
}

