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.

CC2530: ZNP not responding

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK

Hi,

i have development board from waveshare zb502(www.waveshare.com/.../ZB502) with cc2530. 

I building ZNP .hex from Z-Stack 3.0.0/Projects/zstack/ZNP/CC253x, then flash it on mcu.

But when i try to send commant to ZNP through UART (0xFE 0x01 0x41 0x00 0x00 0x40) ZNP is not responding.

When i send command to ZNP i see blinking RX led on board.

I tried to set diferent baudrate, send command throught UART from arduino and RPI 2, nothing works.

I tried flash .hex from cc2530znp minikit, change TX/RX, use CTS, RTS, alternative ports P1_6, P1_7, connect CFG0 and CFG1 to ground nothing helps.

When i tried to use z-tool -> "No device found".

I used this tutorials/decumentation SWRA444, ZNP interface specification and lot of others...

So my idea is, use raspberry pi 2 like a ZAP, connect through UART with my development board (P0_2 and P0_3). Program ZNP .hex to cc2530 and configurate it through raspberry pi 2 like coordinator.

Is it possible to do that? How can i test if ZNP on cc2530 works correct (ping or smth like that)?

Can someone explain me what i am doing wrong or what i need to do?

Thank you for you answers,

Andrej Tichý

  • The default CC2530 ZNP uses SPI interface. You can refer to which shows you how to configure it to use UART.

  • Thank you,

    i did exactly what you wrote in your blog. But a one small thing, i need connect port P0_4 to GND, only after i was do that MCU are able to answer me.

    Still Z-tool can not find my device, i don't know if possible. If is possible can you help me?
    If is not possible and i need configure ZNP like in your blog "Use ZTool + Z-Stack 3.0 Znp...", how i can create/compile command through UART.
    For example command SYS_OSAL_NV_WRITE can be like that [0xFE 0x21 0x09 0x00 0x03 0x00 0x01 0x03]?

    Thank you for you answer,

    Andrej Tichý
  • I couldn't understand your latest question. Can you elaborate?
  • Yes, of course (sorry if my english is bad)

    now i have zb502 + cc2530 with flashed ZNP and i need to configure it like coordinator, second like enddevice and try to transmit simple message.

    Unfortunately my device Z-Tool 2.0 can not recognize,i don't know if its possible.
    So i think i need to do manually, like send hex commands through UART.
    Like in your blog, you send 1. command with using Z-Tool

    "10:36:58.53 COM1 SYS_OSAL_NV_WRITE (0x2109) --> Write startup option to clear NV when reset
    Id: 0x0003
    Offset: 0x00
    Len: 0x01
    Value: . (0x03)

    10:36:58.55 COM1 SYS_OSAL_NV_WRITE_SRSP (0x6109)
    Status: SUCCESS (0x0)"

    and i try to create command -> hex numbers like you, which i can send through UART to ZNP.

    So when after what i read "Z-Stack monitor and test API.pdf" i find command

    SYS_OSAL_NV_WRITE
    LENGTH | CMD0 | CMD1 | ID | OFFSET | LEN | VALUE
    x x x x x x| 0x21 | 0x09 | 0x00 0x03 | 0x00 | 0x01 | 0x03

    And i don't know what means 1. LENGTH?
    is this what i do ok?

    Thank you,

    Andrej Tichý

  • You can refer to section 2.1.2 MT CMD in Z-Stack Monitor and Test API.pdf
  • Hi again, 

    when i send through UART SYS_RESET_REQ (FE 01 41 00 00 40), it works. The MCU will reboot and answered me correctly (FE 06 41 80 02 02 00 02 07 00 C2).

    But when i try send others commands, still i dont have response. For example SYS_PING (0xFE 0x00 0x21 0x01 0x20).

    I used:

    Z-Stack 3.0.0 - CC2530 - ProdHex

    I changed:

    OnBoard.h

    #define ZAPP_PORT HAL_UART_PORT_0

    #define ZTOOL_PORT HAL_UART_PORT_0

    and on InitBoard()

    ...
    /** CHANGE */ znpCfg1 = ZNP_CFG1_UART; //znpCfg0 = ZNP_CFG0_32K_OSC; /** #if defined CC2531ZNP znpCfg1 = ZNP_CFG1_UART; #elif defined CC2530_MK znpCfg1 = ZNP_CFG1_SPI; znpCfg0 = ZNP_CFG0_32K_OSC; #else znpCfg1 = P2_0; znpCfg0 = P1_2; // Tri-state the 2 CFG inputs after being read (see hal_board_cfg_xxx.h for CFG0.) P1INP |= BV(2); P2INP |= BV(0); #endif*/

    ...

    Compile options:

    BDB_FINDING_BINDING_CAPABILITY_ENABLED=0
    TC_LINKKEY_JOIN
    NWK_MAX_DEVICE_LIST=10
    ZDSECMGR_TC_DEVICE_MAX=30
    ZNP_ENABLED
    POWER_SAVING
    FEATURE_SYSTEM_STATS
    MT_GP_CB_FUNC
    ASSERT_RESET
    FAKE_CRC_SHDW
    ENABLE_MT_SYS_RESET_SHUTDOWN



  • If you can do SYS_RESET_REQ, I see no reason why SYS_PING doesn't work. Do you test this with ZTool?
  • When i tried to use Z-Tool 2.0 -> No devices found. (I edited port in settings). I dont know if its possible, bc my device use CP2102 like USB to UART bridge.
    When i send command SYS_RESET_REQ cc2530 answered me 2x all time it is normal?
  • What do you mean CC2530 answered 2x all time?
  • When i send through UART SYS_RESET_REQ (FE 01 41 00 00 40) -> answered me correctly (FE 06 41 80 02 02 00 02 07 00 C2) and after ca. 1s again answered (FE 06 41 80 02 02 00 02 07 00 C2)
  • Hi again, update.

    Now everything doing OK. -> I don't know where was the trap, but i reinstall Z-Stack 3.0 -> do everything what you say and now work well.

    I have a question out of post. How much powerful is ZNP? I think, what i can do with ZNP?
    For example, can i read some data from end-device(humidity sensor) through coordinator via API?
    Or configurate coordinator to send all mesage whitch he receive from end-devices throught UART to my ZAP?
    It is possible something like that, can you direct me wherever I can find some information about it.

    It is possible to create application like simple_switch / simple_light only with using ZNP or i need to use generic_app or rewrite original simple_switch / simple_light applications?

    Thank you for your answer and your time
    Andrej Tichý
  • Yes, all of those are doable with ZAP-ZNP. You can refer to sunmaysky.blogspot.tw/.../use-ztool-z-stack-30-znp-to-set-up.html for some basic ZNP tests.