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