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.

TM4C129CNCPDT: USB Library initialization issue with SafeRTOS

Part Number: TM4C129CNCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Hello,

We are using the mentioned down microcontroller in our project and currently facing a problem with initilization of the USB port.

This issue seems to come when calling a function of the TivaWare USB Library (USBDCDCInit), see more informations below:

Device: TM4C129CNCPDT

Texas Instruments TM4C12xx (SAFERTOS Library) Demo Code Release (DCR) using IAR version 7.10.1

with TivaWare USB Library for TM4C devices

 

When: Before creating any SafeRTOS task (so with a nearly empty code) and after calling the USBBufferInit() function for the Rx and Tx buffers.

What: The USBDCDCInit() function called right after (that returns a success).

Problem: The xTaskStartScheduler(pdTRUE); function returns directly errINVALID_BYTE_ALIGNMENT

I already checked the definitions of all values comming from "my side" of the code and all data are aligned accordingly to SafeRTOS specifications.

Is there a way to initialize the USB port as this is very much needed for the project target?

  • Texas Instruments TM4C12xx (SAFERTOS Library) Demo Code Release (DCR) using IAR version 7.10.1

    Hi,

      Can you clarify where you get the TM4C12xx SafeRTOS library Demo Code Release (DCR). Personally, I'm not aware of this demo code. 

  • Hello Charles,
    I requested this demo library on the SafeRTOS website: https://www.highintegritysystems.com/safertos/

  • Hi Louis,

    I requested this demo library on the SafeRTOS website: https://www.highintegritysystems.com/safertos/

    This is a third party developed demo based on SafeRTOS that I'm totally unfamiliar with. I don't know how to help you. If USBDCDCInit is returning a success but xTaskStartScheduler is returning an errINVALID_BYTE_ALIGNMENT error then I will suggest you contact the vendor for support. I have no idea why SafeRTOS is complaining for an alignment error. Doing so Google search, it may be related to the stack buffer or Queue memory  value was not correct for the target hardware.

     I will also suggest you also try out a CDC example at C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\usb_dev_cdcserial. I This example calls USBBufferInit() function for the Rx and Tx buffers.and USBDCDCInit() to initialize the CDC class. If you can get this bare-metal to work but not the SafeRTOS then it means it has something to do with the interaction with SafeRTOS. Since I have never worked with SafeRTOS, I really don't know why is the problem with the alignment espeically when the function USBDCDCInit returns success. Please contact highintegritysystems for assistance. Hopefully, they can easily pinpoint what areas and tips to address the issue. 

      

  • Hello Charles,

    Thank you for the quick response!

    try out a CDC example at C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\usb_dev_cdcserial

    I tested this but as long as I add the USB Library with SafeRTOS, I can this issue.

    it has something to do with the interaction with SafeRTOS

    Yes, I came to the same conclusion.

    I think the USB Library is not aligning data as SafeRTOS is expecting...

    Then, I will ask for some help to HighIntegritySystems.

    Thank you for your help! I will send news on this thread as soon as I have an update!