Index: azure_iot_hub_riscv/trunk/app_iothub_client/Debug/Makefile
===================================================================
--- azure_iot_hub_riscv/trunk/app_iothub_client/Debug/Makefile	(revision 458)
+++ azure_iot_hub_riscv/trunk/app_iothub_client/Debug/Makefile	(revision 459)
@@ -183,11 +183,11 @@
 APPL_ASMOBJS :=
 ifdef USE_CXX
-	APPL_CXXOBJS := $(APPL_CXXOBJS) main.o
-	APPL_COBJS := $(APPL_COBJS) client.o code.o envcmd.o command.o esp_at_socket.o kpu_main.o region_layer.o kpu.o
+	APPL_CXXOBJS := $(APPL_CXXOBJS)
+	APPL_COBJS := $(APPL_COBJS) main.o client.o code.o envcmd.o command.o esp_at_socket.o kpu_main.o region_layer.o kpu.o
 else
 	APPL_COBJS := $(APPL_COBJS) main.o client.o code.o envcmd.o command.o esp_at_socket.o kpu_main.o region_layer.o kpu.o
 endif
 APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o stub.o yolo.o
-APPL_CFLAGS := $(APPL_CFLAGS) -D___src_yolo_kmodel=model_data -D___src_yolo_kmodel_len=model_size
+APPL_CFLAGS := $(APPL_CFLAGS)
 APPL_LIBS =
 ifdef APPLDIR
Index: azure_iot_hub_riscv/trunk/app_iothub_client/src/client.c
===================================================================
--- azure_iot_hub_riscv/trunk/app_iothub_client/src/client.c	(revision 458)
+++ azure_iot_hub_riscv/trunk/app_iothub_client/src/client.c	(revision 459)
@@ -23,4 +23,5 @@
 #include "serializer_devicetwin.h"
 #include "client.h"
+#include "kpu_main.h"
 
 #ifdef _MSC_VER
@@ -41,5 +42,4 @@
 bool g_use_proxy;
 HTTP_PROXY_OPTIONS g_proxy_options;
-int ledOn;
 
 static int callbackCounter;
@@ -133,10 +133,9 @@
 
 // Define the Model
-BEGIN_NAMESPACE(WeatherStation);
-
-DECLARE_MODEL(ContosoAnemometer,
-WITH_DATA(double, windSpeed),
-WITH_DATA(double, temperature),
-WITH_DATA(double, humidity),
+BEGIN_NAMESPACE(SecurityStation);
+
+DECLARE_MODEL(ContosoSecurityCamera,
+WITH_DATA(int, is_person),
+WITH_DATA(int, is_car),
 WITH_METHOD(quit),
 WITH_METHOD(turnLedOn),
@@ -153,17 +152,17 @@
 );
 
-DECLARE_DEVICETWIN_MODEL(AnemometerState,
+DECLARE_DEVICETWIN_MODEL(SecurityCameraState,
 WITH_REPORTED_PROPERTY(ThresholdR, threshold)
 );
 
-DECLARE_DEVICETWIN_MODEL(AnemometerSettings,
+DECLARE_DEVICETWIN_MODEL(SecurityCameraSettings,
 WITH_DESIRED_PROPERTY(ThresholdD, threshold, onDesiredThreshold)
 );
 
-END_NAMESPACE(WeatherStation);
+END_NAMESPACE(SecurityStation);
 
 void anemometerReportedStateCallback(int status_code, void* userContextCallback)
 {
-	AnemometerState *anemometer = (AnemometerState *)userContextCallback;
+	SecurityCameraState *anemometer = (SecurityCameraState *)userContextCallback;
 
 	printf("received states \033[43m%d\033[49m, reported threshold = %.1f\n", status_code, anemometer->threshold.value);
@@ -174,7 +173,7 @@
 	// Note: The argument is NOT a pointer to threshold, but instead a pointer to the MODEL
 	//       that contains threshold as one of its arguments.  In this case, it
-	//       is AnemometerSettings*.
-
-	AnemometerSettings *anemometer = (AnemometerSettings *)argument;
+	//       is SecurityCameraSettings*.
+
+	SecurityCameraSettings *anemometer = (SecurityCameraSettings *)argument;
 	printf("received a new desired.threshold = \033[42m%.1f\033[49m\n", anemometer->threshold.value);
 
@@ -182,5 +181,5 @@
 }
 
-METHODRETURN_HANDLE quit(ContosoAnemometer* device)
+METHODRETURN_HANDLE quit(ContosoSecurityCamera* device)
 {
 	(void)device;
@@ -193,10 +192,12 @@
 }
 
-METHODRETURN_HANDLE turnLedOn(ContosoAnemometer* device)
+METHODRETURN_HANDLE turnLedOn(ContosoSecurityCamera* device)
 {
 	(void)device;
 	(void)printf("\033[41mTurning LED on with Method.\033[49m\r\n");
 
-	ledOn = 1;
+	digitalWrite(LED_G_PIN, LOW);
+	digitalWrite(LED_R_PIN, LOW);
+	digitalWrite(LED_B_PIN, LOW);
 
 	METHODRETURN_HANDLE result = MethodReturn_Create(1, "{\"Message\":\"Turning fan on with Method\"}");
@@ -204,10 +205,12 @@
 }
 
-METHODRETURN_HANDLE turnLedOff(ContosoAnemometer* device)
+METHODRETURN_HANDLE turnLedOff(ContosoSecurityCamera* device)
 {
 	(void)device;
 	(void)printf("\033[44mTurning LED off with Method.\033[49m\r\n");
 
-	ledOn = 0;
+	digitalWrite(LED_G_PIN, HIGH);
+	digitalWrite(LED_R_PIN, HIGH);
+	digitalWrite(LED_B_PIN, HIGH);
 
 	METHODRETURN_HANDLE result = MethodReturn_Create(0, "{\"Message\":\"Turning fan off with Method\"}");
@@ -295,7 +298,4 @@
 	EVENT_INSTANCE messages[MESSAGE_COUNT];
 	int msg_id = 0;
-	double avgWindSpeed = 10.0;
-	double minTemperature = 20.0;
-	double minHumidity = 60.0;
 	int receiveContext = 0;
 
@@ -315,5 +315,5 @@
 			(void)printf("Failed in serializer_init.");
 		}
-		else if (SERIALIZER_REGISTER_NAMESPACE(WeatherStation) == NULL)
+		else if (SERIALIZER_REGISTER_NAMESPACE(SecurityStation) == NULL)
 		{
 			LogError("unable to SERIALIZER_REGISTER_NAMESPACE");
@@ -389,23 +389,23 @@
 				}
 #endif // SET_TRUSTED_CERT_IN_SAMPLES
-				AnemometerState *anemometerState = IoTHubDeviceTwin_LL_CreateAnemometerState(iotHubClientHandle);
+				SecurityCameraState *anemometerState = IoTHubDeviceTwin_LL_CreateSecurityCameraState(iotHubClientHandle);
 				if (anemometerState == NULL)
 				{
-					printf("Failure in IoTHubDeviceTwin_LL_CreateAnemometerState");
+					printf("Failure in IoTHubDeviceTwin_LL_CreateSecurityCameraState");
 				}
 				else
 				{
-					(void)printf("IoTHubDeviceTwin_LL_CreateAnemometerState...successful.\r\n");
-				}
-				AnemometerSettings *anemometerSettings = IoTHubDeviceTwin_LL_CreateAnemometerSettings(iotHubClientHandle);
+					(void)printf("IoTHubDeviceTwin_LL_CreateSecurityCameraState...successful.\r\n");
+				}
+				SecurityCameraSettings *anemometerSettings = IoTHubDeviceTwin_LL_CreateSecurityCameraSettings(iotHubClientHandle);
 				if (anemometerSettings == NULL)
 				{
-					printf("Failure in IoTHubDeviceTwin_LL_CreateAnemometerSettings");
+					printf("Failure in IoTHubDeviceTwin_LL_CreateSecurityCameraSettings");
 				}
 				else
 				{
-					(void)printf("IoTHubDeviceTwin_LL_CreateAnemometerSettings...successful.\r\n");
-				}
-				ContosoAnemometer* myWeather = CREATE_MODEL_INSTANCE(WeatherStation, ContosoAnemometer);
+					(void)printf("IoTHubDeviceTwin_LL_CreateSecurityCameraSettings...successful.\r\n");
+				}
+				ContosoSecurityCamera* myWeather = CREATE_MODEL_INSTANCE(SecurityStation, ContosoSecurityCamera);
 				if (myWeather == NULL)
 				{
@@ -440,8 +440,8 @@
 						unsigned char *msgText;
 						size_t msgSize;
-						myWeather->windSpeed = avgWindSpeed + (rand() % 4 + 2);
-						myWeather->temperature = minTemperature + (rand() % 10);
-						myWeather->humidity = minHumidity + (rand() % 20);
-						if (SERIALIZE(&msgText, &msgSize, myWeather->windSpeed, myWeather->temperature, myWeather->humidity) != CODEFIRST_OK)
+						myWeather->is_person = yolo_result.person;
+						myWeather->is_car = yolo_result.car;
+						yolo_result.reset = 1;
+						if (SERIALIZE(&msgText, &msgSize, myWeather->is_person, myWeather->is_car) != CODEFIRST_OK)
 						{
 							(void)printf("Failed to serialize\r\n");
@@ -459,6 +459,6 @@
 
 							propMap = IoTHubMessage_Properties(messages[msgPos].messageHandle);
-							(void)sprintf_s(propText, sizeof(propText), myWeather->temperature > anemometerSettings->threshold.value ? "true" : "false");
-							if (Map_AddOrUpdate(propMap, "temperatureAlert", propText) != MAP_OK)
+							(void)sprintf_s(propText, sizeof(propText), (yolo_result.person > 0) ? "true" : "false");
+							if (Map_AddOrUpdate(propMap, "personAlert", propText) != MAP_OK)
 							{
 								(void)printf("ERROR: Map_AddOrUpdate Failed!\r\n");
@@ -487,5 +487,5 @@
 						anemometerState->threshold.value = anemometerSettings->threshold.value;
 						anemometerState->threshold.status = "success";
-						IoTHubDeviceTwin_LL_SendReportedStateAnemometerState(anemometerState, anemometerReportedStateCallback, anemometerState);
+						IoTHubDeviceTwin_LL_SendReportedStateSecurityCameraState(anemometerState, anemometerReportedStateCallback, anemometerState);
 					}
 					iterator++;
@@ -504,7 +504,7 @@
 
 				if (anemometerSettings != NULL)
-					IoTHubDeviceTwin_LL_DestroyAnemometerSettings(anemometerSettings);
+					IoTHubDeviceTwin_LL_DestroySecurityCameraSettings(anemometerSettings);
 				if (anemometerState != NULL)
-					IoTHubDeviceTwin_LL_DestroyAnemometerState(anemometerState);
+					IoTHubDeviceTwin_LL_DestroySecurityCameraState(anemometerState);
 				if (myWeather != NULL)
 					DESTROY_MODEL_INSTANCE(myWeather);
Index: azure_iot_hub_riscv/trunk/app_iothub_client/src/command.c
===================================================================
--- azure_iot_hub_riscv/trunk/app_iothub_client/src/command.c	(revision 458)
+++ azure_iot_hub_riscv/trunk/app_iothub_client/src/command.c	(revision 459)
@@ -9,4 +9,5 @@
 #include "monitor.h"
 #include "device.h"
+#include "kpu_main.h"
 
 /*
@@ -55,7 +56,8 @@
 "          WIFI                   set ssid pwd \n";
 
-#define LED_PIN       3		/* D13 */
-static const uint16_t led_pattern[1] = {
-	LED_PIN
+static const uint16_t led_pattern[] = {
+	LED_G_PIN,
+	LED_R_PIN,
+	LED_B_PIN,
 };
 
@@ -88,16 +90,4 @@
 
 /*
- *  ダイレクトデジタルピン出力
- */
-void
-digitalWrite(uint8_t Pin, int dwVal){
-	int8_t gpio_pin = gpio_get_gpiohno(Pin, false);
-
-	if( gpio_pin >= 0){
-		gpio_set_pin(TADR_GPIOHS_BASE, (uint8_t)gpio_pin, dwVal);
-	}
-}
-
-/*
  *  LED設定コマンド関数
  */
@@ -110,9 +100,16 @@
 	arg1 = a2i(argv[1]);
 	arg2 = a2i(argv[2]);
-	if(arg1 >= 1 && arg1 <= 4){
-		if(arg2 != 0)
-			digitalWrite(led_pattern[arg1-1], 1);
-		else
-			digitalWrite(led_pattern[arg1-1], 0);
+	if(arg1 >= 1 && arg1 <= sizeof(led_pattern) / sizeof(led_pattern[0])){
+		if(arg2 != 0) {
+			digitalWrite(led_pattern[arg1-1], LOW);
+			syslog(LOG_NOTICE, "digitalWrite(%d,LOW)", arg1);
+		}
+		else {
+			digitalWrite(led_pattern[arg1-1], HIGH);
+			syslog(LOG_NOTICE, "digitalWrite(%d,HIGH)", arg1);
+		}
+	}
+	else{
+		syslog(LOG_NOTICE, "LED %d is not arival.", arg1);
 	}
 	return 0;
Index: azure_iot_hub_riscv/trunk/app_iothub_client/src/esp_at_socket.c
===================================================================
--- azure_iot_hub_riscv/trunk/app_iothub_client/src/esp_at_socket.c	(revision 458)
+++ azure_iot_hub_riscv/trunk/app_iothub_client/src/esp_at_socket.c	(revision 459)
@@ -61,4 +61,8 @@
 #include "azure_c_shared_utility/optimize_size.h"
 
+#ifdef _MSC_VER
+extern int sprintf_s(char* dst, size_t dstSizeInBytes, const char* format, ...);
+#endif // _MSC_VER
+
 //#define AT_DEBUG
 time_t MINIMUM_YEAR;
@@ -306,10 +310,10 @@
 {
 	struct tm tm = {
-		0,  /* tm_sec */
-		0,  /* tm_min */
-		0,  /* tm_hour */
-		1,  /* tm_mday */
-		0,  /* tm_mon */
-		2020 - 1900,  /* tm_year */
+        0,  /* tm_sec */
+        0,  /* tm_min */
+        0,  /* tm_hour */
+        1,  /* tm_mday */
+        0,  /* tm_mon */
+        2020 - 1900,  /* tm_year */
 	};
 	MINIMUM_YEAR = mktime(&tm);
@@ -426,4 +430,10 @@
 				return false;
 			}
+#ifdef AT_DEBUG
+			else{
+				append_char(esp_state, '\0');
+				printf("\"%s\"\r\n", esp_state->string);
+			}
+#endif
 		}
 		else if (isalpha(c) || isdigit(c) || c == ' ') {
@@ -432,4 +442,10 @@
 			return false;
 		}
+#ifdef AT_DEBUG
+		else{
+			append_char(esp_state, '\0');
+			printf("\"%s\"\r\n", esp_state->string);
+		}
+#endif
 		break;
 	case at_link_id:
@@ -634,5 +650,5 @@
 #ifdef AT_DEBUG
 	if (esp_state->parse_state != at_none)
-		printf("\033[35mparse error. state:%d\033[0m\r\n", esp_state->parse_state);
+		printf("\033[35mparse error. state:%d, char:%d\033[0m\r\n", esp_state->parse_state, c);
 #endif
 	esp_state->parse_state = at_none;
@@ -1487,5 +1503,5 @@
 		}
 
-		sprintf(temp, "AT+CWJAP=\"%s\",\"%s\"\r\n", esp_state->ssid, esp_state->pwd);
+		sprintf_s(temp, sizeof(temp), "AT+CWJAP=\"%s\",\"%s\"\r\n", esp_state->ssid, esp_state->pwd);
 		ret = esp_serial_write(esp_state, temp, &res_kind, 20000);
 		if ((ret != E_OK) || (res_kind != at_response_kind_ok)) {
@@ -1495,5 +1511,5 @@
 		esp_state->esp_state = esp_state_update_time;
 	case esp_state_update_time:
-		sprintf(temp, "AT+CIPSNTPCFG=%d,%d,\"%s\"\r\n", 1, 9, "ntp.nict.jp");
+		sprintf_s(temp, sizeof(temp), "AT+CIPSNTPCFG=%d,%d,\"%s\"\r\n", 1, 9, "ntp.nict.jp");
 		ret = esp_serial_write(esp_state, temp, &res_kind, 10000);
 		if ((ret != E_OK) || (res_kind != at_response_kind_ok)) {
@@ -1591,6 +1607,6 @@
 
 	ER ret;
-	char temp[64];
-	sprintf(temp, "AT+CIPSTART=%d,\"%s\",\"%s\",%d\r\n", connection->link_id, connection->ssl, host, port);
+	char temp[128];
+	sprintf_s(temp, sizeof(temp), "AT+CIPSTART=%d,\"%s\",\"%s\",%d\r\n", connection->link_id, connection->ssl, host, port);
 	ret = esp_serial_write(connection->esp_state, temp, &res_kind, 10000);
 	if ((ret != E_OK) || (res_kind != at_response_kind_connect)) {
@@ -1630,5 +1646,5 @@
 	ER ret;
 	char temp[64];
-	sprintf(temp, "AT+CIPCLOSE=%d\r\n", connection->link_id);
+	sprintf_s(temp, sizeof(temp), "AT+CIPCLOSE=%d\r\n", connection->link_id);
 	ret = esp_serial_write(connection->esp_state, temp, &res_kind, 10000);
 	if (ret == E_OK) {
@@ -1656,5 +1672,5 @@
 	ER ret;
 	char temp[64];
-	sprintf(temp, "AT+CIPSEND=%d,%d\r\n", connection->link_id, length);
+	sprintf_s(temp, sizeof(temp), "AT+CIPSEND=%d,%d\r\n", connection->link_id, length);
 	ret = esp_serial_write(connection->esp_state, temp, &res_kind, 10000);
 	if ((ret != E_OK) || (res_kind != at_response_kind_ok)) {
Index: azure_iot_hub_riscv/trunk/app_iothub_client/src/kpu_main.c
===================================================================
--- azure_iot_hub_riscv/trunk/app_iothub_client/src/kpu_main.c	(revision 458)
+++ azure_iot_hub_riscv/trunk/app_iothub_client/src/kpu_main.c	(revision 459)
@@ -148,5 +148,15 @@
 }
 
-void digitalWrite(uint8_t Pin, int dwVal);
+/*
+ *  ダイレクトデジタルピン出力
+ */
+void
+digitalWrite(uint8_t Pin, int dwVal){
+    int8_t gpio_pin = gpio_get_gpiohno(Pin, false);
+
+    if( gpio_pin >= 0){
+        gpio_set_pin(TADR_GPIOHS_BASE, (uint8_t)gpio_pin, dwVal);
+    }
+}
 
 #if (CLASS_NUMBER > 1)
@@ -188,4 +198,6 @@
 kpu_model_context_t g_task;
 static region_layer_t detect_rl;
+yolo_result_t yolo_result;
+yolo_result_t yolo_result_frame;
 
 volatile uint8_t g_ai_done_flag;
@@ -220,4 +232,8 @@
 	lcd_drawRect(&DrawProp, x1, y1, x2, y2, 2, ST7789_RED);
 #endif
+	if (strcmp(class_lable[class].str, "person") == 0)
+		yolo_result_frame.person++; 
+	if (strcmp(class_lable[class].str, "car") == 0)
+		yolo_result_frame.car++; 
 }
 
@@ -247,5 +263,10 @@
 	syslog(LOG_NOTICE, "Sample program starts (exinf = %d).", (int_t) exinf);
 
-	pinMode(LED_PIN, OUTPUT);
+	pinMode(LED_G_PIN, OUTPUT);
+	digitalWrite(LED_G_PIN, HIGH);
+	pinMode(LED_R_PIN, OUTPUT);
+	digitalWrite(LED_R_PIN, HIGH);
+	pinMode(LED_B_PIN, OUTPUT);
+	digitalWrite(LED_B_PIN, HIGH);
 
 	select_spi0_dvp_mode(1);
@@ -523,6 +544,19 @@
 		lcd_drawPicture(hlcd, 0, 0, hcmr->_width, hcmr->_height, (uint16_t *)hcmr->_dataBuffer);
 
+		yolo_result_frame.person = 0;
+		yolo_result_frame.car = 0;
+
 		/* draw boxs */
 		region_layer_draw_boxes(&detect_rl, drawboxes);
+
+		if (yolo_result.reset) {
+			yolo_result.reset = 0;
+			yolo_result.person = 0;
+			yolo_result.car = 0;
+		}
+		if (yolo_result.person < yolo_result_frame.person)
+			yolo_result.person = yolo_result_frame.person;
+		if (yolo_result.car < yolo_result_frame.car)
+			yolo_result.car = yolo_result_frame.car;
 	}
 	ov2640_activate(hcmr, false);
Index: azure_iot_hub_riscv/trunk/app_iothub_client/src/kpu_main.h
===================================================================
--- azure_iot_hub_riscv/trunk/app_iothub_client/src/kpu_main.h	(revision 458)
+++ azure_iot_hub_riscv/trunk/app_iothub_client/src/kpu_main.h	(revision 459)
@@ -86,5 +86,7 @@
 #define SPI_MOSI_PIN  28
 #define SPI_SS_PIN    29
-#define LED_PIN       3		/* D13 */
+#define LED_G_PIN     12
+#define LED_R_PIN     13
+#define LED_B_PIN     14
 
 #define SPI_PORTID    SPI1_PORTID
@@ -133,4 +135,12 @@
 #ifndef TOPPERS_MACRO_ONLY
 
+typedef struct yolo_result_t {
+	int reset;
+	int person;
+	int car;
+} yolo_result_t;
+
+extern yolo_result_t yolo_result;
+
 /*
  *  ヒープ領域の設定
@@ -145,4 +155,6 @@
 extern void heap_init(intptr_t exinf);
 extern void ai_done_isr(intptr_t exinf);
+extern void pinMode(uint8_t Pin, uint8_t dwMode);
+extern void digitalWrite(uint8_t Pin, int dwVal);
 
 #endif /* TOPPERS_MACRO_ONLY */
Index: azure_iot_hub_riscv/trunk/asp_baseplatform/OBJ/K210_GCC/DEMO/demo.h
===================================================================
--- azure_iot_hub_riscv/trunk/asp_baseplatform/OBJ/K210_GCC/DEMO/demo.h	(revision 458)
+++ azure_iot_hub_riscv/trunk/asp_baseplatform/OBJ/K210_GCC/DEMO/demo.h	(revision 459)
@@ -87,5 +87,5 @@
 #define SPI_MOSI_PIN  28
 #define SPI_SS_PIN    29
-#define LED_PIN       3		/* D13 */
+#define LED_PIN       13
 
 #define SPI_PORTID    SPI1_PORTID
Index: azure_iot_hub_riscv/trunk/asp_baseplatform/arch/riscv_gcc/prc_config.c
===================================================================
--- azure_iot_hub_riscv/trunk/asp_baseplatform/arch/riscv_gcc/prc_config.c	(revision 458)
+++ azure_iot_hub_riscv/trunk/asp_baseplatform/arch/riscv_gcc/prc_config.c	(revision 459)
@@ -73,44 +73,86 @@
 	unsigned long mstatus = *(((uintptr_t*)p_excinf) + P_EXCINF_OFFSET_MSTATUS);
 	uintptr_t     pc      = *(((uintptr_t*)p_excinf) + P_EXCINF_OFFSET_PC);
+	uintptr_t     sp0     = *(((uintptr_t*)p_excinf) + P_EXCONF_OFFSET_SP);
+	uintptr_t     sp1     = *(((uintptr_t*)p_excinf) + P_EXCONF_OFFSET_SP + 1);
 	unsigned long excno   = mcause & MCAUSE_CAUSE;
+	static int count = 0;
+
+	if (count == 0) {
+		count++;
 
 	if((long)mcause < 0)
 		excno += TMAX_MACHNE_INTNO / 2;
 
-	switch (excno) {
-	case EXC_INSTRUCTION_ADDRESS_MISALIGNED:
-		syslog(LOG_EMERG, "\nUnregistered instruction address misaligned occurs.");
-		break;
-	case EXC_INSTRUCTION_ADDRESS_FAULT:
-		syslog(LOG_EMERG, "\nUnregistered instruction address fault occurs.");
-		break;
-	case EXC_ILLEGAL_INSTRUCTION:
-		syslog(LOG_EMERG, "\nUnregistered illegal instruction occurs.");
-		break;
-	case EXC_BREAKPOINT:
-		syslog(LOG_EMERG, "\nUnregistered breakpoint occurs.");
-		break;
-	case EXC_LOAD_ADDRESS_MISALIGNED:
-		syslog(LOG_EMERG, "\nUnregistered load address misaligned occurs.");
-		break;
-	case EXC_LOAD_ADDRESS_FAULT:
-		syslog(LOG_EMERG, "\nUnregistered load address fault occurs.");
-		break;
-	case EXC_STORE_AMO_ADDRESS_MISALIGNED:
-		syslog(LOG_EMERG, "\nUnregistered store AMO address misaligned occurs.");
-		break;
-	case EXC_STORE_AMO_ACCESS_FAUT:
-		syslog(LOG_EMERG, "\nUnregistered store AMO access faut occurs.");
-		break;
-	case EXC_ENVIRONMENT_CALL_FROM_MMODE:
-		syslog(LOG_EMERG, "\nUnregistered environment call from MMODE occurs.");
-		break;
-	default:
-		syslog(LOG_EMERG, "\nUnregistered Interrupt occurs.");
-		break;
-	}
-
-	syslog(LOG_EMERG, "Excno = 0x%02X, PC = 0x%X, mstatus = 0x%X, p_excinf = 0x%X",
-		   excno, pc, mstatus, p_excinf);
+		switch (excno) {
+		case EXC_INSTRUCTION_ADDRESS_MISALIGNED:
+				syslog_0(LOG_EMERG, "\nUnregistered instruction address misaligned occurs.");
+			break;
+		case EXC_INSTRUCTION_ADDRESS_FAULT:
+				syslog_0(LOG_EMERG, "\nUnregistered instruction address fault occurs.");
+			break;
+		case EXC_ILLEGAL_INSTRUCTION:
+				syslog_0(LOG_EMERG, "\nUnregistered illegal instruction occurs.");
+			break;
+		case EXC_BREAKPOINT:
+				syslog_0(LOG_EMERG, "\nUnregistered breakpoint occurs.");
+			break;
+		case EXC_LOAD_ADDRESS_MISALIGNED:
+				syslog_0(LOG_EMERG, "\nUnregistered load address misaligned occurs.");
+			break;
+		case EXC_LOAD_ADDRESS_FAULT:
+				syslog_0(LOG_EMERG, "\nUnregistered load address fault occurs.");
+			break;
+		case EXC_STORE_AMO_ADDRESS_MISALIGNED:
+				syslog_0(LOG_EMERG, "\nUnregistered store AMO address misaligned occurs.");
+			break;
+		case EXC_STORE_AMO_ACCESS_FAUT:
+				syslog_0(LOG_EMERG, "\nUnregistered store AMO access faut occurs.");
+			break;
+		case EXC_ENVIRONMENT_CALL_FROM_MMODE:
+				syslog_0(LOG_EMERG, "\nUnregistered environment call from MMODE occurs.");
+			break;
+		default:
+				syslog_0(LOG_EMERG, "\nUnregistered Interrupt occurs.");
+			break;
+		}
+
+		syslog_4(LOG_EMERG, "Excno = 0x%02X, PC = 0x%X, mstatus = 0x%X, p_excinf = 0x%X",
+			excno, pc, mstatus, p_excinf);
+
+		syslog_3(LOG_EMERG, "SP0 = 0x%X, SP1 = 0x%X, runtsk = 0x%X", sp0, sp1, p_runtsk->p_tinib->task);
+
+		unsigned int *addr = (((unsigned int *)p_excinf) + P_EXCONF_OFFSET_SP + 3);
+		syslog_5(LOG_EMERG, "a0%x:%08X%08X %08X%08X", 0, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a0%x:%08X%08X %08X%08X", 2, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a0%x:%08X%08X %08X%08X", 4, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a0%x:%08X%08X %08X%08X", 6, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a0%x:%08X%08X %08X%08X", 8, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a1%x:%08X%08X %08X%08X", 0, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a1%x:%08X%08X %08X%08X", 2, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a1%x:%08X%08X %08X%08X", 4, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a1%x:%08X%08X %08X%08X", 6, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a1%x:%08X%08X %08X%08X", 8, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a1%x:%08X%08X %08X%08X",10, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a2%x:%08X%08X %08X%08X", 0, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a2%x:%08X%08X %08X%08X", 2, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a2%x:%08X%08X %08X%08X", 4, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a2%x:%08X%08X %08X%08X", 6, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a2%x:%08X%08X %08X%08X", 8, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+		syslog_5(LOG_EMERG, "a2%x:%08X%08X %08X%08X",10, addr[0], addr[1], addr[2], addr[3]); addr+=4;
+
+		addr = (unsigned int *)((sp0 + 15) / 16);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[-4], addr[-4], addr[-3], addr[-2], addr[-1]);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[ 0], addr[ 0], addr[ 1], addr[ 2], addr[ 3]);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[ 4], addr[ 4], addr[ 5], addr[ 6], addr[ 7]);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[ 8], addr[ 8], addr[ 9], addr[10], addr[11]);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[12], addr[12], addr[13], addr[14], addr[15]);
+
+		addr = (unsigned int *)((sp1 + 15) / 16);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[-4], addr[-4], addr[-3], addr[-2], addr[-1]);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[ 0], addr[ 0], addr[ 1], addr[ 2], addr[ 3]);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[ 4], addr[ 4], addr[ 5], addr[ 6], addr[ 7]);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[ 8], addr[ 8], addr[ 9], addr[10], addr[11]);
+		syslog_5(LOG_EMERG, "%08X:%08X %08X %08X %08X", (unsigned int)&addr[12], addr[12], addr[13], addr[14], addr[15]);
+	}
 
 	target_exit();
Index: azure_iot_hub_riscv/trunk/azure_iot_sdk/serializer/src/jsondecoder.c
===================================================================
--- azure_iot_hub_riscv/trunk/azure_iot_sdk/serializer/src/jsondecoder.c	(revision 458)
+++ azure_iot_hub_riscv/trunk/azure_iot_sdk/serializer/src/jsondecoder.c	(revision 459)
@@ -598,4 +598,7 @@
             result = JSON_DECODER_MULTITREE_FAILED;
         }
+        else if (strcmp(json, "null") == 0) {
+            result = JSON_DECODER_OK;
+        }
         else
         {
