I followed the example on
and was unsuccessful in my attempt to get System_printf to appear on my terminal (putty).
This is my code below from the main.c file:
/**
@file main.c
@brief main entry of the BLE stack sample application.
<!--
Copyright 2013 - 2015 Texas Instruments Incorporated. All rights reserved.
IMPORTANT: Your use of this Software is limited to those specific rights
granted under the terms of a software license agreement between the user
who downloaded the software, his/her employer (which must be your employer)
and Texas Instruments Incorporated (the "License"). You may not use this
Software unless you agree to abide by the terms of the License. The License
limits your use, and you acknowledge, that the Software may not be modified,
copied or distributed unless embedded on a Texas Instruments microcontroller
or used solely and exclusively in conjunction with a Texas Instruments radio
frequency transceiver, which is integrated into your product. Other than for
the foregoing purpose, you may not use, reproduce, copy, prepare derivative
works of, modify, distribute, perform, display or sell this Software and/or
its documentation for any purpose.
YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
PROVIDED ``AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
Should you have any questions regarding your right to use this Software,
contact Texas Instruments Incorporated at www.TI.com.
-->
*/
#include "uart_printf.h"
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>
#include <ti/sysbios/family/arm/cc26xx/Power.h>
#include <ti/sysbios/BIOS.h>
#include "ICall.h"
#include "observer.h"
#include "simpleBLEObserver.h"
/* Header files required to enable instruction fetch cache */
#include <inc/hw_memmap.h>
#include <driverlib/vims.h>
#ifndef USE_DEFAULT_USER_CFG
#include "bleUserConfig.h"
// BLE user defined configuration
bleUserCfg_t user0Cfg = BLE_USER_CFG;
#endif // USE_DEFAULT_USER_CFG
/**
* Exception handler
*/
void exceptionHandler()
{
volatile char i = 1;
while(i);
}
/*
* ======== main ========
*/
int main()
{
PIN_init(BoardGpioInitTable);
// Enable System_printf(..) UART output
UART_Params uartParams;
UART_Params_init(&uartParams);
uartParams.baudRate = 115200;
UartPrintf_init(UART_open(Board_UART, &uartParams));
#ifndef POWER_SAVING
/* Set constraints for Standby, powerdown and idle mode */
Power_setConstraint(Power_SB_DISALLOW);
Power_setConstraint(Power_IDLE_PD_DISALLOW);
#endif //POWER_SAVING
/* Initialize ICall module */
ICall_init();
/* Start tasks of external images - Priority 5 */
ICall_createRemoteTasks();
/* Kick off profile - Priority 3 */
GAPObserverRole_createTask();
/* Kick off application - Priority 1 */
SimpleBLEObserver_createTask();
/* enable interrupts and start SYS/BIOS */
BIOS_start();
System_printf("Hello, universe!\r\n");
return 0;
}
/**
* Error handled to be hooked into TI-RTOS
*/
Void smallErrorHook(Error_Block *eb)
{
for (;;);
}
/**
* HAL assert handler required by OSAL memory module.
*/
void halAssertHandler(void)
{
for (;;);
}
I have also changed the appBLE.cfg:
var ROM = xdc.useModule('ti.sysbios.rom.ROM');
ROM.romName = ROM.CC2650;
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Types = xdc.useModule('xdc.runtime.Types');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory')
var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var Reset = xdc.useModule('xdc.runtime.Reset');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power');
/* Enable idle task (default). */
Task.enableIdleTask = true;
/* Idle CPU when threads blocked waiting for an interrupt */
Power.idle = true;
Power.policyFunc = Power.standbyPolicy;
Power.calibrateRCOSC = false;
/* compile out all Assert's */
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
/* Don't load string names of modules on the target */
Defaults.common$.namedModule = false;
/* Allow Mod_create() and Mod_construct() but not delete() or destruct() */
Defaults.common$.memoryPolicy = Types.CREATE_POLICY;
/* Don't load diagnostic/descriptive text strings on the target */
Text.isLoaded = false;
/* Use the minimal user-supplied callback provider */
System.SupportProxy = SysCallback;
/* no exit handlers needed */
System.maxAtexitHandlers = 0;
/* main() and Hwi, Swi stack size */
Program.stack = 1024;
/* no command-line arguments main(argc, argv) needed */
Program.argSize = 0;
/* build a custom, optimized version of SYS/BIOS */
BIOS.libType = BIOS.LibType_Custom;
/* no logging - all compiled out */
BIOS.logsEnabled = false;
/* disable Asserts in SYS/BIOS code */
BIOS.assertsEnabled = false;
/* Reduce number of Task priority levels to save RAM */
Task.numPriorities = 6;
/* Set the default Task stack size - used if one is not specified */
Task.defaultStackSize = 512;
/* Don't check stacks for overflow - saves cycles (and power) and Flash */
Task.checkStackFlag = false;
/* Disable exception handling to save Flash - undo during active development */
M3Hwi.enableException = true;
M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */
M3Hwi.nvicCCR.UNALIGN_TRP = 0;
M3Hwi.nvicCCR.DIV_0_TRP = 0;
/* Don't check for interrupt stack overflow during Idle loop */
Hwi.checkStackFlag = false;
/* Minimize Flash and RAM usage of Error module */
Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */
Error.maxDepth = 2;
/* Set the default CPU frequency */
BIOS.cpuFreq.lo = 48000000;
/* Put reset vector at start of Flash */
M3Hwi.resetVectorAddress = 0x0;
/* Put interrupt vector at start of RAM so interrupts can be configured at runtime */
M3Hwi.vectorTableAddress = 0x20000000;
/* CC2650 has 50 interrupts */
M3Hwi.NUM_INTERRUPTS = 50;
/* Create a small heap */
BIOS.heapSize = 1668;
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
Swi.numPriorities = 6;
BIOS.swiEnabled = true;
BIOS.includeXdcRuntime = true;
/* Tasks cannot pend based on priority */
Semaphore.supportsPriority = false;
/* Change default error function -- just spin */
Error.policyFxn = Error.policySpin;
/* true: Allow runtime creation of e.g. semaphores
* false: Compile out reference to Memory in BIOS */
BIOS.runtimeCreatesEnabled = true;
/* Abort and exit functions -- just spin */
System.abortFxn = System.abortSpin;
System.exitFxn = System.exitSpin;
/* CC26xx Boot module */
var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot');
Boot.driverlibVersion = 2;
Boot.customerConfig = false;
/* 10 us tick period */
Clock.tickPeriod = 10;
/* Uart printout */
var Idle = xdc.useModule('ti.sysbios.knl.Idle');
Idle.addFunc('&uartPrintf_flush');
SysCallback.putchFxn = "&uartPrintf_putch";
I am currently using BLE stack 2.1.1 because the UART implementation linked on the website was not possible on the latest BLE stack 2.2. I am also using the TI RTOS that came with the BLE stack, which is TI RTOS 2.13.
Thanks for reading the post, any help on what to do from here will be appreciated.