diff --git a/app/app.uvoptx b/app/app.uvoptx
index 3b0a333..da0a52e 100644
--- a/app/app.uvoptx
+++ b/app/app.uvoptx
@@ -1027,7 +1027,7 @@
nRF_Log
- 0
+ 1
0
0
0
@@ -1091,6 +1091,18 @@
0
0
+
+ 9
+ 56
+ 1
+ 0
+ 0
+ 0
+ ..\sdk\components\libraries\log\src\nrf_log_backend_uart.c
+ nrf_log_backend_uart.c
+ 0
+ 0
+
@@ -1101,7 +1113,7 @@
0
10
- 56
+ 57
1
0
0
@@ -1113,7 +1125,7 @@
10
- 57
+ 58
1
0
0
@@ -1125,7 +1137,7 @@
10
- 58
+ 59
1
0
0
@@ -1145,7 +1157,7 @@
0
11
- 59
+ 60
1
0
0
@@ -1157,7 +1169,7 @@
11
- 60
+ 61
1
0
0
@@ -1169,7 +1181,7 @@
11
- 61
+ 62
1
0
0
@@ -1189,7 +1201,7 @@
0
12
- 62
+ 63
1
0
0
diff --git a/app/app.uvprojx b/app/app.uvprojx
index 7138442..4f40246 100644
--- a/app/app.uvprojx
+++ b/app/app.uvprojx
@@ -3299,6 +3299,11 @@
+
+ nrf_log_backend_uart.c
+ 1
+ ..\sdk\components\libraries\log\src\nrf_log_backend_uart.c
+
@@ -6958,6 +6963,11 @@
+
+ nrf_log_backend_uart.c
+ 1
+ ..\sdk\components\libraries\log\src\nrf_log_backend_uart.c
+
diff --git a/app/config/sdk_config.h b/app/config/sdk_config.h
index 3716597..8e946e6 100644
--- a/app/config/sdk_config.h
+++ b/app/config/sdk_config.h
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2017 - 2021, Nordic Semiconductor ASA
+ * Copyright (c) 2017 - 2020, Nordic Semiconductor ASA
*
* All rights reserved.
*
@@ -3111,6 +3111,134 @@
//
+// NRFX_QSPI_ENABLED - nrfx_qspi - QSPI peripheral driver
+//==========================================================
+#ifndef NRFX_QSPI_ENABLED
+#define NRFX_QSPI_ENABLED 0
+#endif
+// NRFX_QSPI_CONFIG_SCK_DELAY - tSHSL, tWHSL and tSHWL in number of 16 MHz periods (62.5 ns). <0-255>
+
+
+#ifndef NRFX_QSPI_CONFIG_SCK_DELAY
+#define NRFX_QSPI_CONFIG_SCK_DELAY 1
+#endif
+
+// NRFX_QSPI_CONFIG_XIP_OFFSET - Address offset in the external memory for Execute in Place operation.
+#ifndef NRFX_QSPI_CONFIG_XIP_OFFSET
+#define NRFX_QSPI_CONFIG_XIP_OFFSET 0
+#endif
+
+// NRFX_QSPI_CONFIG_READOC - Number of data lines and opcode used for reading.
+
+// <0=> FastRead
+// <1=> Read2O
+// <2=> Read2IO
+// <3=> Read4O
+// <4=> Read4IO
+
+#ifndef NRFX_QSPI_CONFIG_READOC
+#define NRFX_QSPI_CONFIG_READOC 0
+#endif
+
+// NRFX_QSPI_CONFIG_WRITEOC - Number of data lines and opcode used for writing.
+
+// <0=> PP
+// <1=> PP2O
+// <2=> PP4O
+// <3=> PP4IO
+
+#ifndef NRFX_QSPI_CONFIG_WRITEOC
+#define NRFX_QSPI_CONFIG_WRITEOC 0
+#endif
+
+// NRFX_QSPI_CONFIG_ADDRMODE - Addressing mode.
+
+// <0=> 24bit
+// <1=> 32bit
+
+#ifndef NRFX_QSPI_CONFIG_ADDRMODE
+#define NRFX_QSPI_CONFIG_ADDRMODE 0
+#endif
+
+// NRFX_QSPI_CONFIG_MODE - SPI mode.
+
+// <0=> Mode 0
+// <1=> Mode 1
+
+#ifndef NRFX_QSPI_CONFIG_MODE
+#define NRFX_QSPI_CONFIG_MODE 0
+#endif
+
+// NRFX_QSPI_CONFIG_FREQUENCY - Frequency divider.
+
+// <0=> 32MHz/1
+// <1=> 32MHz/2
+// <2=> 32MHz/3
+// <3=> 32MHz/4
+// <4=> 32MHz/5
+// <5=> 32MHz/6
+// <6=> 32MHz/7
+// <7=> 32MHz/8
+// <8=> 32MHz/9
+// <9=> 32MHz/10
+// <10=> 32MHz/11
+// <11=> 32MHz/12
+// <12=> 32MHz/13
+// <13=> 32MHz/14
+// <14=> 32MHz/15
+// <15=> 32MHz/16
+
+#ifndef NRFX_QSPI_CONFIG_FREQUENCY
+#define NRFX_QSPI_CONFIG_FREQUENCY 15
+#endif
+
+// NRFX_QSPI_PIN_SCK - SCK pin value.
+#ifndef NRFX_QSPI_PIN_SCK
+#define NRFX_QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED
+#endif
+
+// NRFX_QSPI_PIN_CSN - CSN pin value.
+#ifndef NRFX_QSPI_PIN_CSN
+#define NRFX_QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED
+#endif
+
+// NRFX_QSPI_PIN_IO0 - IO0 pin value.
+#ifndef NRFX_QSPI_PIN_IO0
+#define NRFX_QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED
+#endif
+
+// NRFX_QSPI_PIN_IO1 - IO1 pin value.
+#ifndef NRFX_QSPI_PIN_IO1
+#define NRFX_QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED
+#endif
+
+// NRFX_QSPI_PIN_IO2 - IO2 pin value.
+#ifndef NRFX_QSPI_PIN_IO2
+#define NRFX_QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED
+#endif
+
+// NRFX_QSPI_PIN_IO3 - IO3 pin value.
+#ifndef NRFX_QSPI_PIN_IO3
+#define NRFX_QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED
+#endif
+
+// NRFX_QSPI_CONFIG_IRQ_PRIORITY - Interrupt priority
+
+// <0=> 0 (highest)
+// <1=> 1
+// <2=> 2
+// <3=> 3
+// <4=> 4
+// <5=> 5
+// <6=> 6
+// <7=> 7
+
+#ifndef NRFX_QSPI_CONFIG_IRQ_PRIORITY
+#define NRFX_QSPI_CONFIG_IRQ_PRIORITY 6
+#endif
+
+//
+
// NRFX_RNG_ENABLED - nrfx_rng - RNG peripheral driver
//==========================================================
#ifndef NRFX_RNG_ENABLED
@@ -7606,7 +7734,7 @@
// NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
//==========================================================
#ifndef NRF_LOG_BACKEND_RTT_ENABLED
-#define NRF_LOG_BACKEND_RTT_ENABLED 0
+#define NRF_LOG_BACKEND_RTT_ENABLED 1
#endif
// NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings.
// Size of the buffer is a trade-off between RAM usage and processing.
@@ -7636,10 +7764,55 @@
//
+// NRF_LOG_BACKEND_UART_ENABLED - nrf_log_backend_uart - Log UART backend
+//==========================================================
+#ifndef NRF_LOG_BACKEND_UART_ENABLED
+#define NRF_LOG_BACKEND_UART_ENABLED 1
+#endif
+// NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin
+#ifndef NRF_LOG_BACKEND_UART_TX_PIN
+#define NRF_LOG_BACKEND_UART_TX_PIN 2
+#endif
+
+// NRF_LOG_BACKEND_UART_BAUDRATE - Default Baudrate
+
+// <323584=> 1200 baud
+// <643072=> 2400 baud
+// <1290240=> 4800 baud
+// <2576384=> 9600 baud
+// <3862528=> 14400 baud
+// <5152768=> 19200 baud
+// <7716864=> 28800 baud
+// <10289152=> 38400 baud
+// <15400960=> 57600 baud
+// <20615168=> 76800 baud
+// <30801920=> 115200 baud
+// <61865984=> 230400 baud
+// <67108864=> 250000 baud
+// <121634816=> 460800 baud
+// <251658240=> 921600 baud
+// <268435456=> 1000000 baud
+
+#ifndef NRF_LOG_BACKEND_UART_BAUDRATE
+#define NRF_LOG_BACKEND_UART_BAUDRATE 30801920
+#endif
+
+// NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings.
+// Size of the buffer is a trade-off between RAM usage and processing.
+// if buffer is smaller then strings will often be fragmented.
+// It is recommended to use size which will fit typical log and only the
+// longer one will be fragmented.
+
+#ifndef NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE
+#define NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE 64
+#endif
+
+//
+
// NRF_LOG_ENABLED - nrf_log - Logger
//==========================================================
#ifndef NRF_LOG_ENABLED
-#define NRF_LOG_ENABLED 0
+#define NRF_LOG_ENABLED 1
#endif
// Log message pool - Configuration of log message pool
@@ -10590,7 +10763,7 @@
#ifndef NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED
-#define NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED 0
+#define NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED 1
#endif
//
@@ -11305,7 +11478,7 @@
// Requested BLE GAP data length to be negotiated.
#ifndef NRF_SDH_BLE_GAP_DATA_LENGTH
-#define NRF_SDH_BLE_GAP_DATA_LENGTH 251
+#define NRF_SDH_BLE_GAP_DATA_LENGTH 27
#endif
// NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links.
diff --git a/app/main.c b/app/main.c
index d24c331..f71b293 100644
--- a/app/main.c
+++ b/app/main.c
@@ -27,48 +27,24 @@ void qingfengboard_test(void) {
debug_light_init(15);
// 测试BUTTON
- static uint8_t io_index[] = {ZPIN(0, 5), ZPIN(1, 9)};
- zbsp_gpio_state_monitor(1000, (uint8_t*)io_index, ZARRAY_SIZE(io_index));
+ // static uint8_t io_index[] = {ZPIN(0, 5), ZPIN(1, 9)};
+ // zbsp_gpio_state_monitor(1000, (uint8_t*)io_index, ZARRAY_SIZE(io_index));
// 测试睡眠唤醒
zbsp_enter_sleep(3000, 5, true);
}
int main(void) {
- // zsys_init();
-
- // NRF_LOG_INFO("compile time :%s", __TIME__);
- // NRF_LOG_INFO("Version :%d", VERSION);
- // NRF_LOG_INFO("Manufacturer :%s", MANUFACTURER_NAME);
+ zsys_init();
+ zble_service_init(&cfg);
+
+ NRF_LOG_INFO("compile time :%s", __TIME__);
+ NRF_LOG_INFO("Version :%d", VERSION);
+ NRF_LOG_INFO("Manufacturer :%s", MANUFACTURER_NAME);
/*******************************************************************************
* 开发板测试 *
*******************************************************************************/
- // qingfengboard_test();
- // ret_code_t err_code = NRF_LOG_INIT(NULL);
- // APP_ERROR_CHECK(err_code);
- // NRF_LOG_DEFAULT_BACKENDS_INIT();
- nrf_pwr_mgmt_init();
- nrf_gpio_cfg(15, //
- NRF_GPIO_PIN_DIR_OUTPUT, //
- NRF_GPIO_PIN_INPUT_DISCONNECT, //
- NRF_GPIO_PIN_PULLUP, //
- NRF_GPIO_PIN_S0S1, //
- NRF_GPIO_PIN_NOSENSE);
- nrf_delay_ms(1000);
- for (size_t i = 0; i < 3; i++) {
- nrf_gpio_pin_set(15);
- nrf_delay_ms(300);
- nrf_gpio_pin_clear(15);
- nrf_delay_ms(300);
- }
-
- sd_power_system_off();
- for (size_t i = 0; i < 3; i++) {
- nrf_gpio_pin_set(15);
- nrf_delay_ms(100);
- nrf_gpio_pin_clear(15);
- nrf_delay_ms(100);
- }
+ qingfengboard_test();
zsys_loop();
}
diff --git a/app/src/board.c b/app/src/board.c
index 389bc2d..45541de 100644
--- a/app/src/board.c
+++ b/app/src/board.c
@@ -53,7 +53,11 @@ static void enter_sleep_tmr_cb(void* p_context) {
}
// Go to system-off mode (this function will not return; wakeup will cause a reset).
- APP_ERROR_CHECK(sd_power_system_off());
+ ret_code_t err_code;
+ err_code = sd_power_system_off();
+ if(err_code != NRF_SUCCESS) {
+ ZLOGE("sd_power_system_off err_code: %x", err_code);
+ }
}
void zbsp_enter_sleep(int32_t after_ms, int32_t wakeup_io_index, bool mirror) {
m_wakeup_io_index = wakeup_io_index;
diff --git a/app/src/zble_service.c b/app/src/zble_service.c
index 3910973..c06b26f 100644
--- a/app/src/zble_service.c
+++ b/app/src/zble_service.c
@@ -280,5 +280,5 @@ void zble_service_init(zble_service_cfg_t* cfg) {
APP_ERROR_CHECK(err_code);
}
- zble_service_start_adv();
+ // zble_service_start_adv();
}
\ No newline at end of file
diff --git a/libznordic b/libznordic
index 933f383..3678551 160000
--- a/libznordic
+++ b/libznordic
@@ -1 +1 @@
-Subproject commit 933f383bdaaeaa70d38176b7008897f56a04d516
+Subproject commit 3678551881438d95c91c36b2f2277219084e2a05