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.

IWR6843ISK: Unable to launch multiple SYS/BIOS Tasks

Part Number: IWR6843ISK
Other Parts Discussed in Thread: IWR1443BOOST

Hi E2E,

Our customer need your guidance and expertise with the IWR6843ISK. Please see the full details of the questions below.

We have been trying to learn how to control the IWR6843ISK radar board and for some reason, we are unable to launch more than one task at a time. As an initial starting point, we are trying to implement a blinking LED and a continuous "ping" over UART. Each of these tasks runs fine when launched as the only task, but when we try to launch both of them the device appears to hang (neither LED blink nor "ping" can be observed). Unfortunately, since we only own the IWR6843ISK board we have no means of directly attaching a debugger and stepping through the code.

What could be the reason for this behaviour of the IWR6843ISK board? Is there some configuration/build setting that we are missing?

Below I have attached our minimal code which tries to launch two separate tasks.

#include <stdint.h>

#include <xdc/std.h>
#include <ti/sysbios/BIOS.h>

// These need to be manually initialized on startup
#include <ti/drivers/esm/esm.h>
#include <ti/drivers/soc/soc.h>
#include <ti/drivers/pinmux/pinmux.h>

// Actually useful components
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Clock.h>

// Error handling
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>

// Stuff that is actually used
#include <ti/drivers/gpio/gpio.h>
#include <ti/drivers/uart/UART.h>

// LED operation
void ledBlinkTask(UArg a0, UArg a1)
{
    // Set pin control for GPIO
    Pinmux_Set_OverrideCtrl(SOC_XWR68XX_PINK13_PADAZ, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);

    // Set pins as GPIO
    Pinmux_Set_FuncSel(SOC_XWR68XX_PINK13_PADAZ, SOC_XWR68XX_PINK13_PADAZ_GPIO_2);

    // Configure GPIO pins
    GPIO_setConfig(SOC_XWR68XX_GPIO_2, GPIO_CFG_OUTPUT);

    // Blinking
    GPIO_write(SOC_XWR68XX_GPIO_2, 0);
    while (1)
    {
        GPIO_toggle(SOC_XWR68XX_GPIO_2);
        Task_sleep(250);
    }
}

// UART operation
void uartTask(UArg a0, UArg a1)
{
    UART_Handle uartHandle;
    UART_Params uartParams;
    const unsigned char ping[] = "PING\r\n";

    // Set pin control for UART
    Pinmux_Set_OverrideCtrl(SOC_XWR68XX_PINN4_PADBD, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);
    Pinmux_Set_OverrideCtrl(SOC_XWR68XX_PINN5_PADBE, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);
    // Set pins as UART SCI-A
    Pinmux_Set_FuncSel(SOC_XWR68XX_PINN4_PADBD, SOC_XWR68XX_PINN4_PADBD_MSS_UARTA_RX);
    Pinmux_Set_FuncSel(SOC_XWR68XX_PINN5_PADBE, SOC_XWR68XX_PINN5_PADBE_MSS_UARTA_TX);

    UART_Params_init(&uartParams);
    uartParams.baudRate = 115200;
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_BINARY;
    uartParams.readReturnMode = UART_RETURN_FULL;
    uartParams.readEcho = UART_ECHO_OFF;
    uartParams.isPinMuxDone = 1;
    uartHandle = UART_open(0, &uartParams);
    if (!uartHandle)
        return;

    while (1)
    {
        UART_write(uartHandle, ping, sizeof(ping));
        Task_sleep(1000);
    }
}

int main(void)
{
    SOC_Handle socHandle;
    SOC_Cfg socCfg;
    int32_t socErr = 0;

    Task_Params taskParams;

    // These things need to be initialized in main()
    ESM_init(0U);
    memset((void *)&socCfg, 0, sizeof(SOC_Cfg));
    socCfg.clockCfg = SOC_SysClock_INIT;
    socCfg.mpuCfg = SOC_MPUCfg_CONFIG;
    socCfg.dssCfg = SOC_DSSCfg_HALT;
    socHandle = SOC_init(&socCfg, &socErr);
    if (socHandle == NULL)
        BIOS_exit(0);

    // This can be initialized in Task or main()
    // Initialize UART controller
    UART_init();
    // Has to be done before setting pin mode
    GPIO_init();

    // Start the concurrent tasks
    Task_Params_init(&taskParams);
    taskParams.priority = 3;
    taskParams.stackSize = 3 * 1024;
    Task_create((Task_FuncPtr)ledBlinkTask, &taskParams, NULL);

    Task_Params_init(&taskParams);
    taskParams.priority = 4;
    taskParams.stackSize = 3 * 1024;
    Task_create((Task_FuncPtr)uartTask, &taskParams, NULL);

    BIOS_start();
    return (0);
}

Thank you for the help.

Regards,
Carlo

  • Hi,

    You may find it easier to start from the Out Of Box Demo, and just to strip out whatever it is you do not need rather than start from the ground up. I agree that it may be a build or configuration setting, could you provide any/all predefined symbols in your project?

    Best Regards,
    Alec

  • Hello Alec,

    Please see the response of our customer below.

    We considered using OOD Demo as a starting point, but it contains a lot of different functionalities, and it is not 100% clear how each component is controlled. Since we do not have access to a debugger, we wanted to start from a "bare minimum" project (i.e., a blinking LED) and build the desired functionalities piece by piece. We chose this approach to avoid a "cargo cult" approach and ensure that the code is doing what we want.

    The CCS project was actually created by taking the OOB demo and removing everything except the barebone main() function. Below I have attached all of our project code.

    XWR6843_TUL.zip

    Regards,
    Carlo

  • Carlo,

    A couple of suggestions. Firstly, if the customer is in development and can not debug, I would recommend that they sample the standalone XDS110 module. It will be challenging to go all the way through evaluation or development without the ability to debug. Without stepping through the code myself (which is outside the scope of these forums), I would recommend that they add an init task similar to the one in our demos, I suspect that one of the functions that they are calling in Main has a dependency on Bios being started.

    Best Regards,
    Alec

  • Hello Allec,

    According to our customer, they have tried using a single init task that would launch the UART and LED task without any success.
    In the meantime, they have also managed to borrow IWR1443BOOST since it has a debugger built-in. Using the same approach of removing everything in OOB demo and placing the code,  they have managed to launch both tasks with initTask without much issue.
    At this point, they have the following questions.
    1. Can you spot any obvious issues with our IWR6843ISK config?
    2. Does the mmWaveSDK contain any "bare bones" project that we could base our code on? Given our 50% success rate with removing things from an OOB demo, such a project could serve as a much better starting point.
    3. In the IWR1443BOOST we can only read UART from the USB port, and we have found no obvious indication as to how to redirect it to the AR_RS232RX/TX pins on the J5 header. Is there a DIP switch (same as in the case of IWR6843ISK) that we need to use? Or is there some additional flag that needs to be set in the code?

    Your guidance is appreciated.

    Regards,
    Carlo

  • Carlos,

    1. I did not see any obvious issues.
    2. The out of box demo would be the most barebones one we provide.

    3. According to the schematic for the IWR1443BOOSTEVM, there is a Do Not Populate resistor for this UART line. If you populate this resistor it should be possible.

    Best Regards,
    Alec