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.

CC2538-CC2592EMK: HEX file to communicate with ZStack Linux using CC2538 + CC2592

Part Number: CC2538-CC2592EMK
Other Parts Discussed in Thread: CC2592, Z-STACK, CC2538, , CC2531

Hi, I'm developing a Zigbee Hub that uses CC2538 in combination with CC2592. The Software Stack I'm using is Z-Stack Linux. The CC2538 must communicate with my SoC via UART without flow control.

I have a precompiled hex file that kinda works with CC2538 but that doesn't make use of the CC2592 LNA, infact I checked the PA_EN and LNA_EN lines with the scope and both are low, which means the precompiled hex I have is definitely not driving them.

At this point I decided to enable a trial version of the IAR for ARM (8.11.2) and try to compile the ZNP application that comes with ZStack 3.0.1 for CC2538 by myself. Unfortunately when I flash the CC2538 with the latter firmware, ZStack Linux fails completely to communicate with CC2538 ([Z_STACK/LSTN] ERROR  : apicSendSynchData() failed getting response).


(Just for reference this is the full path of the ZNP application I'm trying to compile C:\Texas Instruments\Z-Stack 3.0.1\Projects\zstack\ZNP\CC2538, is that the right one for communicating with ZStack Linux?).

Since I want to enable CC2592 LNA and UART communication, I edited the following files:

OnBoard.h (so that compiles with IAR 8.11 as suggested by JasonB)

....
#define CSTACK_BEG ((uint8 const *)(_Pragma("segment=\"CSTACK\"") __segment_begin("CSTACK")))
//#define CSTACK_END ((uint8 const *)(_Pragma("segment=\"CSTACK\"") __segment_end("CSTACK"))-1)
....

OnBoard.c

....
// for (ptr = CSTACK_END; ptr > CSTACK_BEG; ptr--)
for (ptr = CSTACK_END, ptr--; ptr > CSTACK_BEG; ptr--)
....
//return (uint16)(CSTACK_END - ptr + 1);
return (uint16)(CSTACK_END - ptr);
....


hal_board_cfg.h

....
#define HAL_PA_LNA
#define HAL_PA_LNA_CC2592
#define xHAL_PA_LNA_CC2590
....
// Values based on powerup h/w config as input with pull-up - not using dynamic cfg of transport.
#define ZNP_CFG0_32K_XTAL 1 /* 32kHz crystal installed and used */
#define ZNP_CFG0_32K_OSC 0 /* 32kHz crystal not installed; internal osc. used */
#define ZNP_CFG1_SPI 0  /* 1 */ /* use SPI transport */
#define ZNP_CFG1_UART 1  /* 0 */ /* use UART transport */
....


MT_UART.h

....
#if !defined MT_UART_DEFAULT_BAUDRATE
#define MT_UART_DEFAULT_BAUDRATE HAL_UART_BR_115200 /* HAL_UART_BR_38400 */
#endif
....


flow control should be disabled as ZNP_ALT is defined under the option section (under C/C++ Compiler - Preprocessor) as well as the following:

xHAL_UART_USB
xUSB_SETUP_MAX_NUMBER_OF_INTERFACES=5
xHAL_SPI=TRUE
HAL_UART=TRUE
BDB_FINDING_BINDING_CAPABILITY_ENABLED=0
TC_LINKKEY_JOIN
ewarm
CC2538_USE_ALTERNATE_INTERRUPT_MAP=1
CC2538ZNP
ZNP_ALT
xPOWER_SAVING
FEATURE_SYSTEM_STATS
FEATURE_RESET_MACRO
ZDNWKMGR_MIN_TRANSMISSIONS=0
MT_UART_DEFAULT_OVERFLOW=FALSE
ASSERT_RESET
MAKE_CRC_SHDW
SBL_CLIENT
ZCL_READ
ZCL_DISCOVER
ZCL_WRITE
ZCL_BASIC

The configuration I'm trying is CC2538ZNP-with-SBL but I've also tried CC2538ZNP-without-SBL without success (haven't tried and CC2538ZNP-Debug yet). What config should I use?

Can you please advise a solution or perhaps provide a precompiled HEX file for CC2538 with UART and CC2592 enabled? 

Any help would be very much appreciated.

Thanks,

John