More reliability tweaks for nRF52

This commit is contained in:
Gordon Williams 2016-11-07 13:11:54 +00:00
parent 1503d6ce86
commit c7c77e17f2
5 changed files with 13 additions and 11 deletions

View File

@ -496,7 +496,7 @@ USE_BLUETOOTH=1
USE_NET=1
USE_GRAPHICS=1
#USE_HASHLIB=1
USE_FILESYSTEM=1
#USE_FILESYSTEM=1
USE_CRYPTO=1
#USE_TLS=1
USE_NFC=1

View File

@ -47,10 +47,10 @@ chip = {
'adc' : 1,
'dac' : 0,
'saved_code' : {
'address' : ((121 - 3) * 4096), # Bootloader takes pages 121-127
'address' : ((120 - 3) * 4096), # Bootloader takes pages 120-127
'page_size' : 4096,
'pages' : 3,
'flash_available' : 512 - ((31 + 7 + 3)*4) # Softdevice uses 31 pages of flash, bootloader 7, code 3. Each page is 4 kb.
'flash_available' : 512 - ((31 + 8 + 3)*4) # Softdevice uses 31 pages of flash, bootloader 8, code 3. Each page is 4 kb.
},
};

View File

@ -46,10 +46,10 @@ chip = {
'adc' : 1,
'dac' : 0,
'saved_code' : {
'address' : ((121 - 3) * 4096), # Bootloader takes pages 121-127
'address' : ((120 - 3) * 4096), # Bootloader takes pages 120-127
'page_size' : 4096,
'pages' : 3,
'flash_available' : 512 - ((31 + 7 + 3)*4) # Softdevice uses 31 pages of flash, bootloader 7, code 3. Each page is 4 kb.
'flash_available' : 512 - ((31 + 8 + 3)*4) # Softdevice uses 31 pages of flash, bootloader 8, code 3. Each page is 4 kb.
},
};

View File

@ -5,7 +5,7 @@ GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x59000 /* 0x78000 and above is reserved for the bootloader. see Makefile, secure_dfu_gcc_nrf52.ld, linker_nrf52_ble_espruino_bootloader.ld and dfu_types.h */
FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x56000 /* 0x78000 and above is reserved for the bootloader, the there's saved JS code. see Makefile, secure_dfu_gcc_nrf52.ld, linker_nrf52_ble_espruino_bootloader.ld and dfu_types.h, BOARD.py */
RAM (rwx) : ORIGIN = 0x20002c40, LENGTH = 0xd3c0
}

View File

@ -587,11 +587,13 @@ static void nfc_callback(void * p_context, nfc_t2t_event_t event, const uint8_t
/// Function for dispatching a SoftDevice event to all modules with a SoftDevice event handler.
static void ble_evt_dispatch(ble_evt_t * p_ble_evt) {
ble_conn_params_on_ble_evt(p_ble_evt);
if (bleStatus & BLE_NUS_INITED) {
if (!((p_ble_evt->header.evt_id==BLE_GAP_EVT_CONNECTED) &&
(p_ble_evt->evt.gap_evt.params.connected.role != BLE_GAP_ROLE_PERIPH)) &&
!(p_ble_evt->header.evt_id==BLE_GAP_EVT_DISCONNECTED))
if (!((p_ble_evt->header.evt_id==BLE_GAP_EVT_CONNECTED) &&
(p_ble_evt->evt.gap_evt.params.connected.role != BLE_GAP_ROLE_PERIPH)) &&
!((p_ble_evt->header.evt_id==BLE_GAP_EVT_DISCONNECTED) &&
m_conn_handle != p_ble_evt->evt.gap_evt.conn_handle)) {
// Stuff in here should ONLY get called for Peripheral events (not central)
ble_conn_params_on_ble_evt(p_ble_evt);
if (bleStatus & BLE_NUS_INITED)
ble_nus_on_ble_evt(&m_nus, p_ble_evt);
}
#if BLE_HIDS_ENABLED