Hello,
I'm trying to compile a basic program with TI-RTOS. As template I used SYS/BIOS - TI Target Examples - Typical.
Device: ARM
Variant: Stellaris LM4F120H5QR
Connection: Stellaris In-Circuit Debug Interface
Products and Repositories:
- SYS/BIOS 6.35.4.50
- TI-RTOS 1.10.0.23
If I compile this code below I get this error message:
"C:/ti/tirtos_1_10_00_23/packages/ti/drivers/ENV.h", line 99: fatal error #35: #error directive: This platform is not supported by TI-RTOS currently.
My question now, where do I find the board.h definitions for the EK-LM4F120XL / LM4F120H5QR / TM4C1233H6PM?
/* * ======== main.c ======== */ #include <xdc/std.h> #include <xdc/runtime/Error.h> #include <xdc/runtime/System.h> #include <ti/sysbios/BIOS.h> #include <ti/sysbios/knl/Task.h> #include "EKS_LM4F232.h" // TI-RTOS Header files #include <ti/drivers/GPIO.h> #include <ti/drivers/I2C.h> #include <string.h> #define HYT221_ADDR 0x28 #define I2C0 0 I2C_Handle i2c; double Humidity; double Temperature; UChar txBuffer[200]; UChar rxBuffer[200]; void waitI2C(UChar slaveAddress) { UChar txBuffer[1]; I2C_Transaction i2cTransaction; // Wait for the I2C slave to be ready for the next read/write operation txBuffer[0] = 0x00; /* Some dummy value */ i2cTransaction.slaveAddress = slaveAddress; /* 7-bit slave address */ i2cTransaction.writeBuf = txBuffer; /* txBuffer to be TX'd */ i2cTransaction.writeCount = 1; /* Number of bytes to be TX'd */ i2cTransaction.readBuf = NULL; /* rxBuffer to be RX'd */ i2cTransaction.readCount = 0; /* Number of bytes to be RX'd */ /* * Perform I2C transfer until a good I2C has been ACK'd by the slave * indicating that the I2C slave is now ready for the next command */ while (!I2C_transfer(i2c, &i2cTransaction)) { } } /* * ======== taskFxn ======== */ Void taskFxn(UArg a0, UArg a1) { System_printf("enter taskFxn()\n"); UInt transferOK; I2C_Params i2cParams; // Create I2C for usage I2C_Params_init(&i2cParams); i2cParams.bitRate = I2C_400kHz; i2c = I2C_open(I2C0, &i2cParams); if (i2c == NULL) { System_abort("Error Initializing I2C\n"); } else { System_printf("I2C Initialized!\n"); } txBuffer = 0x00; I2C_transaction i2cTransaction; i2cTransaction.slaveAddress = HYT221_ADDR; i2cTransaction.writeBuf = txBuffer; i2cTransaction.writeCount = 10; i2cTransaction.readBuf = rxBuffer; i2cTransaction.readCount = 20; transferOK = I2C_transfer(i2c, &i2cTransaction); if (!transferOK) System_abort("Error in I2C Transfer\n"); waitI2C(HYT221_ADDR); // Deinitialized I2C I2C_close(i2c); System_printf("I2C Deinitialized!\n"); Task_sleep(10); System_printf("exit taskFxn()\n"); } /* * ======== main ======== */ Int main() { Board_initGeneral(); Board_initGPIO(); Board_initI2C(); Task_Handle task; Error_Block eb; System_printf("enter main()\n"); System_flush(); // Turn on user LED GPIO_write(Board_LED, Board_LED_ON); Error_init(&eb); task = Task_create(taskFxn, NULL, &eb); if (task == NULL) { System_printf("Task_create() failed!\n"); BIOS_exit(0); } BIOS_start(); /* does not return */ return(0); }
/* * ======== app.cfg ======== */ var Defaults = xdc.useModule('xdc.runtime.Defaults'); var Diags = xdc.useModule('xdc.runtime.Diags'); var Error = xdc.useModule('xdc.runtime.Error'); var Log = xdc.useModule('xdc.runtime.Log'); var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf'); var Main = xdc.useModule('xdc.runtime.Main'); var Memory = xdc.useModule('xdc.runtime.Memory') var SysMin = xdc.useModule('xdc.runtime.SysMin'); var System = xdc.useModule('xdc.runtime.System'); var Text = xdc.useModule('xdc.runtime.Text'); var BIOS = xdc.useModule('ti.sysbios.BIOS'); var Clock = xdc.useModule('ti.sysbios.knl.Clock'); var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 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 I2C = xdc.useModule('ti.drivers.I2C'); var GPIO = xdc.useModule('ti.drivers.GPIO'); /* * Program.argSize sets the size of the .args section. * The examples don't use command line args so argSize is set to 0. */ Program.argSize = 0x0; /* * Uncomment this line to globally disable Asserts. * All modules inherit the default from the 'Defaults' module. You * can override these defaults on a per-module basis using Module.common$. * Disabling Asserts will save code space and improve runtime performance. Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; */ /* * Uncomment this line to keep module names from being loaded on the target. * The module name strings are placed in the .const section. Setting this * parameter to false will save space in the .const section. Error and * Assert messages will contain an "unknown module" prefix instead * of the actual module name. Defaults.common$.namedModule = false; */ /* * Minimize exit handler array in System. The System module includes * an array of functions that are registered with System_atexit() to be * called by System_exit(). */ System.maxAtexitHandlers = 4; /* * Uncomment this line to disable the Error print function. * We lose error information when this is disabled since the errors are * not printed. Disabling the raiseHook will save some code space if * your app is not using System_printf() since the Error_print() function * calls System_printf(). Error.raiseHook = null; */ /* * Uncomment this line to keep Error, Assert, and Log strings from being * loaded on the target. These strings are placed in the .const section. * Setting this parameter to false will save space in the .const section. * Error, Assert and Log message will print raw ids and args instead of * a formatted message. Text.isLoaded = false; */ /* * Uncomment this line to disable the output of characters by SysMin * when the program exits. SysMin writes characters to a circular buffer. * This buffer can be viewed using the SysMin Output view in ROV. SysMin.flushAtExit = false; */ /* * The BIOS module will create the default heap for the system. * Specify the size of this default heap. */ BIOS.heapSize = 0x1000; /* * Build a custom SYS/BIOS library from sources. */ BIOS.libType = BIOS.LibType_Custom; /* System stack size (used by ISRs and Swis) */ Program.stack = 0x2000; /* Circular buffer size for System_printf() */ SysMin.bufSize = 0x200; /* * Create and install logger for the whole system */ var loggerBufParams = new LoggerBuf.Params(); loggerBufParams.numEntries = 16; var logger0 = LoggerBuf.create(loggerBufParams); Defaults.common$.logger = logger0; Main.common$.diags_INFO = Diags.ALWAYS_ON; System.SupportProxy = SysMin;