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.

ZNP Uart transport

Other Parts Discussed in Thread: CC2530, CC2530EM

Hi,

I connected a Silabs MCU to the CC2530 and it works with SPI but I must also use the UART transport layer and I don't seem to be able to get it to work.

I hooked a logic analyzer: CTS and RTS are both low and the CC2530 Rx line shows the MCU characters but there is nothing back from the CC2530 Tx line (nothing after a reset either).

I'm using the ZNP Mini Kit CC2530-MK-PRO.hex file (from the Mini Kit BIN directory) and the CC2530 is connected as follows:

- CC2530 P0_4 CTS to MCU RTS

- CC2530 P0_5 RTS to MCU CTS

- CC2530 P0_3 TX to MCU RX

- CC2530 P0_2 RX to MCU TX

- CC2530 RESET_N to MCU GPIO

- CC2530 P0_0 CFG0 to +3.3V through 10K pullup

- CC2530 P0_1 CFG1 to GND


The uart configuration on the MCU side is 115200-8-N-1 with hardware flow control and I carefully followed the instructions described in the SWRA312 CC2530ZNP Interface Specifications manual.

Please can you help me out to find what I am doing wrong ?

Many thanks in advance. Patrick

  • Note that the pre-compiled ZNP images have the boot loader embedded, and it is active at powerup. If there is no valid ZNP image to run, of course it goes directly to boot loader mode (and thus the only message you get out of it will be in response to the specific boot loader messages sent in - it has no automatic, asynchronous "reset indication" message like the ZNP. Now, if there is a valid ZNP image to run, the boot loader waits to allow the host to force into boot loader mode anyway. For the SPI transport, it only waits 50 usec for a special byte, but for the UART transport it waits 30 seconds (maybe 60, I forget) for a special character. If it does not receive the special character, the wait times out and the boot loader runs the valid image.

    0xF8 -> force boot loader mode even though there is a valid image ready to run.

    0x07 -> force immediate jump to the valid image.

  • Hi Dirty Harry,

    Thank you very much for your reply.

    Under .NETMF I did the following at startup but there is still no activity on the CC2530 TX pin, even after waiting over 60s or sending a command frame from the MCU:

    public void reset() {  

       resetPort.Write(false); 

      Thread.Sleep(100); 

      resetPort.Write(true);

      serialPort.Write(new byte[] { 0x7 }, 0, 1);

    }

    The ZNP image is the ZNP Mini Kit CC2530-MK-PRO.hex file.

    Is this procedure correct ?

    Once again, thank you very much.

    Best regards, Patrick

  • Hello - it looks like the ZNP images pre-compiled for the mini-kit are hard-coded to use SPI transport only and no external sleep crystal (i.e. the CFG0/CFG1 GPIO's are not enabled or acted upon as might be inferred from 2.1.2.3 of the CC2530ZNP Interface Specification).

     

  • Hi Dirty Harry,

    Thank you for your reply.

    I connected P1_2/P2_0/P0_0/P0_1 to GND and checked the different ZNP images I got so far. Please find below my results.

    I finally got the ZAP-MSP430-2.5.0 working with the uart transport and I am a happy camper.

    Now I got the same inconvenience as Derek9531 in his 187965 post: it takes 30s to run the ZNP image after a reset. I tried a SYS_RESET_REQ and the 0x07 special character but didn't succeed in shortening the system startup.

    Thank you for your support.

    Best regards,

    Patrick.

    C:\Texas Instruments\CC2530ZNP-MK Sensor Network Application\IAR\Bin\TestHex Images\CC2530ZNP-MK-Pro.hex

    - SPI0 -> OK

    - UART0 -> NG

    - UARt1 -> NG

    C:\Texas Instruments\CC2530ZNP-MK Sensor Network Application\IAR\Bin\ProdHex Images\CC2530ZNP-MK-Pro.hex

    - SPI0 -> NG

    - UART0 -> NG

    - UART1 -> NG

    C:\Texas Instruments\CC2530ZNP Mini Kit\Bin\CC2530-MK-Pro.hex

    - SPI0 -> OK

    - UART0 -> NG

    - UART1 -> NG

    C:\Texas Instruments\ZAP-MSP430-2.5.0\Projects\zstack\ZAP\ZNP-HexFiles\CC2530ZNP-Pro.hex

    - SPI0 -> NG

    - UART0 -> OK (P2.0 = CFG1)

    - UART1 -> NG

     

  • One last gotcha - the embedded serial boot loader does not configure the UART for flow control, whereas the ZNP image will. So send the 0x07 with no flow control and then turn flow control on.

  • Thank you for your feedback Dirty Harry.

    I tried as suggested but I'm still getting the 30s waiting time.

    Thanks anyway. Best regards, Patrick

     

  • So something is still not right with your setup - I just program the znp .hex onto the CC2530EM on the SmartRF05EB and connect the serial cable to the PC. On the PC, I run Br@y Terminal, open the port at 115k, no flow control, powerup the ZNP and send a 0x07 and immediately receive a 0x00. Then on the Br@y Terminal as soon as I click the enable flow control, I immediately get the powerup message (no 30 second wait). So total data dump is this:

    00 FE 06 41 80 01 02 00 02 05 00 C3

     

  • Thank so lot Dirty Harry, I made a cable to connect to a terminal and test under the same conditions as your setup and it worked. Great !!

    Best regards, Patrick.

  • Hello,

    I also did the setup suggested by DirtyHarry and received the power message. 

    Next step I want to do is to send any command and get a reply (e.g. SYS_VERSION). I tried using the Bray Terminal and sent 0xfe 0x00 0x21 0x02 0x23 but I got nothing.

    Can you guide me on how to get communication running between a PC and CC2530 (flashed with CC2530ZNP-Pro.hex) on SmartRF05 EB?

    (My goal in this task is to use our microchip's UART to send commands to CC2530ZNP.)

    Thank you!

    -Martin

  • Found the answer to my question...

    I was using the wrong format in Br@y Terminal. To send Hex format, should use $ instead of 0x (e.g. to send 0xFE, send $FE)

    to send SYS_VERSION, send $FE$00$21$02$23 

    (should've used Help button earlier :D)