How to select c99 or c11 compiler in Beyond studio for NXP

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

How to select c99 or c11 compiler in Beyond studio for NXP

Jump to solution
2,331 Views
dmsherazi
Contributor IV

I am following the ZigbeeNodeControlBridge demo and I want to at least enable c99 support. Can any one please guide me how to enable c99 or c2011 support?

Labels (1)
Tags (3)
1 Solution
2,113 Views
davidashraf
Contributor V

Hello dostshah‌ 

Try to add this line in the Makefile under CFLAGS 

CFLAGS+= -std=c99

I haven't tried it with this code before so let me know if it worked for you 

Regards

View solution in original post

0 Kudos
Reply
3 Replies
2,114 Views
davidashraf
Contributor V

Hello dostshah‌ 

Try to add this line in the Makefile under CFLAGS 

CFLAGS+= -std=c99

I haven't tried it with this code before so let me know if it worked for you 

Regards

0 Kudos
Reply
2,113 Views
dmsherazi
Contributor IV

This worked. Thanks a lot!

Below is a fragment of a Makefile with "CFLAGS+= -std=c99"  added for an example .

#
# Application target name

TARGET = ZigbeeNodeControlBridge
###############################################################################
#User definable make parameters that may be overwritten from the command line

JENNIC_SDK ?= JN-SW-4168
ZBPRO_DEVICE_TYPE = ZCR
JENNIC_MAC ?= MiniMacShim
PDM_BUILD_TYPE ?= _NONE
BAUD ?= 1000000
DEBUG ?= NONE
VERSION ?= 0

STACK_SIZE = 6500
MINIMUM_HEAP_SIZE = 2000

# Chip variant

JENNIC_CHIP ?= JN5168
JENNIC_CHIP_FAMILY ?= JN516x


###############################################################################
# Default DK2 development kit target hardware

JENNIC_PCB ?= DEVKIT2

###############################################################################
# Select the network stack (e.g. MAC, ZBPro)

JENNIC_STACK ?= ZLLHA
###############################################################################
# commands options
# enable optional commands as required per applicaion.
#
STACK_MEASURE      ?= 0
EXTENDED_DEBUG      ?= 0
ZCL_ON_HOST          ?= 0
DISCOVERY_ONLY_MODE ?= 0
#
###############################################################################
# Debug options - define DEBUG to enable
#DEBUG =HW
#
# Define which UART to use for HW debug
DEBUG_PORT ?= UART1

###############################################################################

CFLAGS  += -DUART_BAUD_RATE=$(BAUD)
CFLAGS  += -DVERSION=$(VERSION)
CFLAGS  += -std=c99
ifeq ($(DEBUG_PORT), UART1)
CFLAGS  += -DUART_DEBUGGING=1
CFLAGS  += -DDEBUG_UART=DBG_E_UART_1
#CFLAGS  += -DDEBUG_APP_OTA
CFLAGS  += -DDEBUG_ZCL
CFLAGS     += -DDEBUG_ZB_CONTROLBRIDGE_TASK
CFLAGS  += -DTRACE_APP
endif‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

After this for testing added the following line to code and build the project. If the build succeeds c99 support has been enabled! (which did!)

for (int yy = 0; yy < 2; yy++) {
// initialiation of a variable inside for loop is not available before c99
}
2,113 Views
davidashraf
Contributor V

dostshah‌ 
Glad it helped .. Good luck :smileyhappy: 

0 Kudos
Reply