diff --git a/.vscode/launch.json.template b/.vscode/launch.json.template new file mode 100644 index 0000000..1435490 --- /dev/null +++ b/.vscode/launch.json.template @@ -0,0 +1,42 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "dfu", + "gdbPath": "gdb-multiarch", + // "showDevDebugOutput": "raw", + "cwd": "${workspaceFolder}", + "executable": "artifacts/OnekeyProBTFW_BL", + // "loadFiles": [], + "request": "launch", + "type": "cortex-debug", + "runToEntryPoint": "main", + "servertype": "jlink", + "device": "NRF52832_XXAA", + "interface": "swd", + // "serialNumber": "", //If you have more than one J-Link probe, add the serial number here. + // "jlinkscript":"${workspaceRoot}/xxx.jlink", + "svdFile": "${workspaceRoot}/ble-firmware/modules/nrfx/mdk/nrf52.svd" + }, + { + "name": "app", + "gdbPath": "gdb-multiarch", + // "showDevDebugOutput": "raw", + "cwd": "${workspaceFolder}", + "executable": "artifacts/OnekeyProBTFW_APP", + // "loadFiles": [], + "request": "attach", + "type": "cortex-debug", + "runToEntryPoint": "main", + "servertype": "jlink", + "device": "NRF52832_XXAA", + "interface": "swd", + // "serialNumber": "", //If you have more than one J-Link probe, add the serial number here. + // "jlinkscript":"${workspaceRoot}/xxx.jlink", + "svdFile": "${workspaceRoot}/ble-firmware/modules/nrfx/mdk/nrf52.svd" + } + ] +} \ No newline at end of file diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 21e8ee5..6ef3ec9 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -428,7 +428,8 @@ add_custom_target( # Install install( FILES - ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin + ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME} + ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.hex # DESTINATION ${PROJECT_SOURCE_DIR}/../artifacts DESTINATION ${CMAKE_INSTALL_PREFIX} diff --git a/app/main.c b/app/main.c index 2c0f843..cf7c8fa 100644 --- a/app/main.c +++ b/app/main.c @@ -202,8 +202,8 @@ #define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */ #define PASSKEY_LENGTH 6 /**< Length of pass-key received by the stack for display. */ -#define HEAD_NAME_LENGTH 6 -#define ADV_NAME_LENGTH 10 +#define HEAD_NAME_LENGTH 4 +#define ADV_NAME_LENGTH 8 #define MAC_ADDRESS_LENGTH 6 #define DEAD_BEEF 0xDEADBEEF /**< Value used as error code on stack dump, can be used to identify stack location on stack unwind. */ diff --git a/app/power_manage.c b/app/power_manage.c index 444053f..cbe1242 100644 --- a/app/power_manage.c +++ b/app/power_manage.c @@ -34,10 +34,17 @@ ret_code_t open_all_power(void) axp216_write(AXP_ALDO3OUT_VOL,0x1E); //set DCDC1 Value 3.2V axp216_write(AXP_DC1OUT_VOL,0x10); - //set LDO2 Value 3.2V - axp216_write(AXP_ALDO2OUT_VOL,0x1F); //set ALDO1 Value 1.8V - axp216_write(AXP_ALDO1OUT_VOL,0xB); + axp216_write(AXP_ALDO1OUT_VOL,0x0B); + + // ALDO2 -> LDO_FB + // set to 3.0V + axp216_write(AXP_ALDO2OUT_VOL,0x1C); + // enable output + axp216_read(AXP_LDO_DC_EN1,1,&val); + val |= 0x80; + axp216_write(AXP_LDO_DC_EN1,val); + nrf_delay_ms(100); return ret; } diff --git a/dfu/CMakeLists.txt b/dfu/CMakeLists.txt index 56fe363..f57ce4f 100644 --- a/dfu/CMakeLists.txt +++ b/dfu/CMakeLists.txt @@ -334,9 +334,9 @@ add_custom_target( # Install install( FILES - ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin - ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.hex ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME} + ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin + ${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.hex # DESTINATION ${PROJECT_SOURCE_DIR}/../artifacts DESTINATION ${CMAKE_INSTALL_PREFIX} ) \ No newline at end of file