Other Parts Discussed in Thread: CC2538, Z-STACK
I am trying to debug the UART port on CC2538. I have it connected with a serial to USB cable to my PC. I added following piece of code in Zmain.c main() function, just before osal_start_system() to continuously send a MT Command on UART port. Problem is I can't see anything on PC with the terminal application (TeraTermo here). I checked the UART port settings, and configured the PC side with same parameters.
Do you think the code is not sending MT commands as I thought it would or there is some other issue?
MT_UartInit();
while(1){ serial_debug(); for (cnt=0;cnt<65530;cnt++){ ; } } osal_start_system(); // No Return from here return 0; // Shouldn't get here. } // main() void serial_debug(){ uint8 *p; p = osal_msg_allocate(11); if (p){ p[0]=0xFA;p[1]=0xCE; p[2]=0xAB;p[3]=0xCD; p[4]=0xEF;p[5]=0x01; p[6]=0x23;p[7]=0x45; p[8]=0x67;p[9]=0x89; p[10]=0x02; MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_AREQ | (uint8)MT_RPC_SYS_ZDO), MT_ZDO_END_DEVICE_ANNCE_IND, 0x0B, p); osal_mem_free(p); } }
