JN5169 uart1 Cannot send data to computer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

JN5169 uart1 Cannot send data to computer

1,183 Views
13560436802
Contributor II

      JN5169

      JN-AN-1217-Zigbee-3-0-Base-Device  Router

Hello,

   My problem is below:

   I send  the uart data to the computer through uart1,but it is failure;

   (uart0 can work normal,it can printf log)

   uart1 initialize:

pastedImage_3.png

I use APP_UART1_WriteByte(0x11); send data, and the computer receive nothing;

pastedImage_7.png

4 Replies

786 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Dylan,

You can work with the uart.c and .h files, included in the next path.

C:\NXP\bstudio_nxp\workspace\JN-AN-1217-Zigbee-3-0-Base-Device\Coordinator\Source

In the makefile, be sure that you have enabled the 

CFLAGS += -DUART=1

CFLAGS += -DDBG_ENABLE

add the APPSRC += uart.c

In the irq_JN516x.S Set the priority in the uart1 also the ISR

Please let me know if you still have issues with this.

Regards,

Mario

0 Kudos

786 Views
dotruonggiang88
Contributor II

Hello @Mario Ignacio Castaneda Lopez , I want to use UART1 to debug, UART0 to send data on AN1217.

How to do that ?

0 Kudos

786 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Giang Do,

Set the Debug port to the UART1. In the makefile.

# Define which UART to use for HW debug
 DEBUG_PORT ?= UART1

Please let me know if you have issues with this.

Regards,

Mario

786 Views
dotruonggiang88
Contributor II

Hi Mario Ignacio Castaneda Lopez,

Thanks for your reply.

The UART1 can print debug OK. But when I send data over UART0 and use UART1 debug this data, nothing to show..  But it's not successfully. Please advise.

This is irq_J516x.S and makefile.


.globl  PIC_ChannelPriorities
    .section .text,"ax"
    .align 4
    .type   PIC_ChannelPriorities, @object
    .size   PIC_ChannelPriorities, 16
PIC_ChannelPriorities:
    .byte 0                 # pwm1 priority
    .byte 0                 # pwm2 priority
    .byte 15                # system controller priority
    .byte 7                 # MAC priority
    .byte 0                 # AES priority
    .byte 0                 # PHY priority
    .byte 5                 # uart0 priority
    .byte 0                 # uart1 priority
    .byte 0                 # timer0 priority
    .byte 0                 # spi slave priority
    .byte 0                 # i2c maste/slave priority
    .byte 0                 # spi master priority
    .byte 0                 # pwm4 priority
    .byte 0                 # analog peripherals priority
    .byte 0                 # pwm3 priority
    .byte 12                # tick timer priority

.globl  PIC_SwVectTable
    .section .text,"ax"
    .extern zps_isrMAC
    .extern ISR_vTickTimer
    .extern vISR_SystemController
    .extern APP_isrUart
    .align 4
    .type   PIC_SwVectTable, @object
    .size   PIC_SwVectTable, 64
PIC_SwVectTable:
    .word vUnclaimedInterrupt               # 0
    .word vUnclaimedInterrupt               # 1
    .word vUnclaimedInterrupt               # 2
    .word vUnclaimedInterrupt               # 3
    .word vUnclaimedInterrupt               # 4
    .word APP_isrUart                       # 5
    .word vUnclaimedInterrupt               # 6
    .word zps_isrMAC                        # 7
    .word vUnclaimedInterrupt               # 8
    .word vUnclaimedInterrupt               # 9
    .word vUnclaimedInterrupt               # 10
    .word vUnclaimedInterrupt               # 11
    .word ISR_vTickTimer                    # 12
    .word vUnclaimedInterrupt               # 13
    .word vUnclaimedInterrupt               # 14
    .word vISR_SystemController             # 15
   
=====================================================
This is makefile

############################################################################
TARGET  =    Coordinator
###############################################################################
# User definable make parameters that may be overwritten from the command line
ZBPRO_DEVICE_TYPE       = ZCR
JENNIC_MAC             ?= MiniMacShim
PDM_BUILD_TYPE         ?= _EEPROM
BAUD                   ?= 115200
DEBUG                  ?= NONE
STACK_SIZE              = 5000
MINIMUM_HEAP_SIZE       = 2000
# Chip variant
JENNIC_CHIP            ?= JN5179
JENNIC_CHIP_FAMILY     ?= JN517x
JENNIC_PCB             ?= DEVKIT5
ifeq ($(JENNIC_CHIP_FAMILY), JN517x)
JENNIC_SDK = JN-SW-4270
ZNCLKCMD               = AppBuildZBPro.ld
JENNIC_PCB             = DEVKIT5
ENDIAN                 = LITTLE_ENDIAN_PROCESSOR
DISABLE_LTO            = 1
else
ifeq ($(JENNIC_CHIP_FAMILY), JN516x)
JENNIC_SDK = JN-SW-4170
ZNCLKCMD                = AppBuildZBPro.ld
JENNIC_PCB             = DEVKIT4
ENDIAN                 = BIG_ENDIAN
endif
endif
###############################################################################
# Network settings
# Optional network.mk for channel
sinclude ../../../network.mk
# Channel (0 for default channels)
SINGLE_CHANNEL ?= 0
CFLAGS         += -DSINGLE_CHANNEL=$(SINGLE_CHANNEL)
###############################################################################
# Default DK4 development kit target hardware
DR                     ?= DR1199
ifeq ($(DR), DR1199)
CFLAGS  += -DBUTTON_MAP_$(DR)
CFLAGS += -D$(DR)
else ifeq ($(DR), DONGLE)
CFLAGS  += -DBUTTON_MAP_DR1199
CFLAGS += -D$(DR)
endif
ICODES ?=0
ifeq ($(ICODES), 1)
CFLAGS  += -DBDB_JOIN_USES_INSTALL_CODE_KEY=1
endif
# NFC NCI ICODE (new) functionality
APP_NCI_ICODE ?= 0
ifeq ($(DR), DONGLE)
APP_NCI_ICODE = 0
endif
ifeq ($(APP_NCI_ICODE), 1)
CFLAGS  += -DAPP_NCI_ICODE
endif
# NFC NCI AES (old) functionality (6x only)
APP_NCI_AES ?= 0
ifeq ($(DR), DONGLE)
APP_NCI_AES = 0
endif
ifeq ($(JENNIC_CHIP_FAMILY),JN517x)
APP_NCI_AES = 0
endif
ifeq ($(APP_NCI_AES), 1)
CFLAGS  += -DAPP_NCI_AES
endif
ifeq ($(JENNIC_CHIP_FAMILY),JN517x)
INTERRUPT_HANDLER_BBC = zps_isrMAC
LDFLAGS += -Wl,-u$(INTERRUPT_HANDLER_BBC) -Wl,-defsym,vAHI_IntHandlerBbc_select=$(INTERRUPT_HANDLER_BBC)
endif

###############################################################################
# Select the network stack (e.g. MAC, ZBPro)
JENNIC_STACK           ?= ZCL
# BDB features Enable as required
#BDB_SUPPORT_TOUCHLINK_INITIATOR ?= 1
#BDB_SUPPORT_TOUCHLINK_TARGET ?= 1
BDB_SUPPORT_NWK_STEERING ?= 1
BDB_SUPPORT_NWK_FORMATION ?= 1
BDB_SUPPORT_FIND_AND_BIND_INITIATOR ?= 1
#BDB_SUPPORT_FIND_AND_BIND_TARGET ?= 1
ifeq ($(APP_NCI_ICODE), 1)
BDB_SUPPORT_OOBC ?= 1
endif
ifeq ($(APP_NCI_AES), 1)
BDB_SUPPORT_OOBC ?= 1
endif
###############################################################################
# commands options
# enable optional commands as required per applicaion.
#
#NETWORK_RECOVERY       ?= 0
STACK_MEASURE          ?= 0
#
###############################################################################
# Debug options - define DEBUG to enable
# DEBUG ?=HW
#
# Define which UART to use for HW debug
 DEBUG_PORT ?= UART1
#  DEBUG_MODE  ?=  SWD    # For ARM core
CFLAGS += -DUART=1
###############################################################################
CFLAGS  += -DUART_BAUD_RATE=$(BAUD)
TRACE ?=1
ifeq ($(TRACE), 1)
CFLAGS += -DDBG_ENABLE=TRUE
# Enable any debug output here:
CFLAGS += -DDEBUG_APP=TRUE
CFLAGS += -DDEBUG_BDB=TRUE
CFLAGS += -DDEBUG_ZCL=TRUE
CFLAGS += -DDEBUG_APP_BUTTON=TRUE
CFLAGS += -DDEBUG_APP_BDB=TRUE
CFLAGS += -DDEBUG_APP_EVENT=TRUE
CFLAGS += -DDEBUG_APP_NCI=TRUE
CFLAGS += -DDEBUG_APP_ICODE=TRUE
CFLAGS  += -DUART_DEBUGGING=TRUE
CFLAGS  += -DDEBUG_UART=TRUE
endif
CFLAGS += -D$(TARGET)
GROUPS ?=0
ifeq ($(GROUPS), 1)
CFLAGS  += -DUSE_GROUPS
CFLAGS += -DGROUP_ID=0x5678
endif

###############################################################################
# Path definitions
# Use if application directory contains multiple targets
SDK_BASE_DIR        = $(abspath ../../../../sdk/$(JENNIC_SDK))
APP_BASE            = $(abspath ../..)
APP_BLD_DIR         = $(APP_BASE)/$(TARGET)/Build
APP_SRC_DIR         = $(APP_BASE)/$(TARGET)/Source
APP_COMMON_SRC_DIR  = $(APP_BASE)/Common/Source
HW_SRC_DIR   = $(COMPONENTS_BASE_DIR)/HardwareAPI/Source
###############################################################################
# Application Source files
# Note: Path to source file is found using vpath below, so only .c filename is required
APPSRC = app_main.c
ifeq ($(JENNIC_CHIP_FAMILY), JN517x)
APPSRC += port_JN517x.c
endif
ifeq ($(JENNIC_CHIP_FAMILY), JN516x)
APPSRC += irq_JN516x.S
APPSRC += portasm_JN516x.S
APPSRC += port_JN516x.c
endif
APPSRC += pdum_gen.c
APPSRC += pdum_apdu.S
APPSRC += zps_gen.c
APPSRC += app_start.c
APPSRC += app_coordinator.c
APPSRC += app_serial_commands.c
APPSRC += app_zcl_task.c
APPSRC += app_buttons.c
APPSRC += app_pdm.c
ifeq ($(JENNIC_CHIP_FAMILY), JN516x)
#APPSRC += StackMeasure.c
endif
ifeq ($(JENNIC_CHIP_FAMILY), JN517x)
APPSRC += AHI_ModuleConfiguration.c
endif
APPSRC += uart.c
ifeq ($(APP_NCI_ICODE),1)
APPSRC += app_nci_icode.c
#APPSRC += app_icode.c
endif
ifeq ($(APP_NCI_AES),1)
APPSRC += app_nci_aes.c
endif
APP_ZPSCFG = app.zpscfg
OPTIONAL_STACK_FEATURES = $(shell $(ZPSCONFIG) -n $(TARGET) -f $(APP_COMMON_SRC_DIR)/$(APP_ZPSCFG) -y )
0 Kudos