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.

TI-RTOS TM4C129X empty.c Example Problem

I am working on getting the TI-RTOS running on the TM4C129x development board and am having trouble getting the LED heartbeat to work properly. I am using IAR Embedded Workbench IDE. When I download and debug, the heartBeatFxn never gets run. Per the config file this should be getting called every 1000ms. I was messing around with breakpoints and commenting out some code and realized it has to do with System_flush().

int main(void)
{
   
    /* Call board init functions. */
    Board_initGeneral();
	 // Board_initEMAC();
    Board_initGPIO();
    // Board_initI2C();
    // Board_initSDSPI();
    // Board_initSPI();
    // Board_initUART();
    // Board_initUSB(Board_USBDEVICE);
    // Board_initUSBMSCHFatFs();
    // Board_initWatchdog();
    

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the example\nSystem provider is set to SysMin. "
                  "Halt the target to view any SysMin contents in ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();
    
    /* Start BIOS */
    BIOS_start();

    return (0);
}

When I comment out System_flush(), the code seems to run properly and the LED blinks at 1 second interval. I have not found much information on System_flush(). What would be the reason for this blocking the function call and how can I work around this in the future?

  • I just compiled and tried debugging the GPIO_INTERRUPT example and cannot get the program to enter the gpioButtonFxns either. I'll do some more digging as to why the callbacks are not working. Not sure where I am going wrong, but these examples should just work out of the box.

  • Hi Brayden,

    Are you having the problem when you debug in IAR or when you build/load via IAR and then run after a reset or power-cycle? I'm assuming the latter. The problem is semi-hosting. The System_flush is trying to write IO which IAR reads. Since IAR is out of the picture now, the code just loops.

    Solutions

    1. Disable semi-hosting (it's in the project options) and rebuild

    2. Use a different System Provider (e.g. SysCallback) that does try to do IO instead of SysMin

    3. Remove the System_flush

    We are writing up a more detailed wiki description and it will be place here in a day or so: http://processors.wiki.ti.com/index.php/TI-RTOS_Support

    Todd

  • Todd,

    Thank you for the feedback. I forgot to state in the initial post that if I do quit debugging and reset/power down the program usually works fine after that. I attached a screenshot of the options. If I switch to "None" I get linker errors, however if I leave "Semihosted" checked and switch to "Via SWO" it builds and seems to debug and work properly. Is this the correct configuration?

     

  • I take that back. Switching to "Via SWO" and now even removing the System_flush() does not fix the issue. I am having some very buggy issues when I try to debug. Sometimes the code will stop at int main(void) and other times it runs right through. The heartBeatFxn() does not get called unless I exit debugging and reset the device. We need to have this RTOS up and running for development soon and need a fix for this.

    Thank you

  • Hi Brayden,

    What version of IAR are you using? We've seen some issues with 7.20 and loading the TM4C devices.

    Todd

  • Todd,

    I am using IAR version 7.20.

    -Brayden

  • Todd,

    Steve is one of the engineers I am working with from this post here: http://e2e.ti.com/support/embedded/tirtos/f/355/p/349191/1223463.aspx#1223463

    We made a change in the options that seems to have fixed the problem. Options>Linker>Config uncheck the "Override default" checkbox. Rebuild all. I was then able to get the UART_echo and empty project with the heartbeat function working while debugging.

    -Brayden