Skip to content

Commit

Permalink
nRF52 SDK15: Fix UART when >1 central link enabled
Browse files Browse the repository at this point in the history
Bangle.js2: Allow 2 central links at once
  • Loading branch information
gfwilliams committed Sep 13, 2023
1 parent 6baf1a5 commit a9651ec
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2v20 : Ensure String.charCodeAt returns NaN for out of bounds chars
Bangle.js2: When rendering overlays, *do not* use the current FG/BG color for 1 bit overlays
nRF52 SDK15: Fix UART when >1 central link enabled
Bangle.js2: Allow 2 central links at once

2v19 : Fix Object.values/entries for numeric keys after 2v18 regression (fix #2375)
nRF52: for SD>5 use static buffers for advertising and scan response data (#2367)
Expand Down
3 changes: 2 additions & 1 deletion boards/BANGLEJS2.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
#'DEFINES += -DESPR_REGOUT0_1_8V=1', # this increases power draw, so probably not correct!
'DEFINES += -DESPR_LSE_ENABLE', # Ensure low speed external osc enabled
'DEFINES += -DNRF_SDH_BLE_GATT_MAX_MTU_SIZE=131', # 23+x*27 rule as per https://devzone.nordicsemi.com/f/nordic-q-a/44825/ios-mtu-size-why-only-185-bytes
'LDFLAGS += -Xlinker --defsym=LD_APP_RAM_BASE=0x2ec0', # set RAM base to match MTU
'DEFINES += -DCENTRAL_LINK_COUNT=2 -DNRF_SDH_BLE_CENTRAL_LINK_COUNT=2', # allow two outgoing connections at once
'LDFLAGS += -Xlinker --defsym=LD_APP_RAM_BASE=0x3660', # set RAM base to match MTU=131 + CENTRAL_LINK_COUNT=2
'DEFINES += -DESPR_DCDC_ENABLE=1', # Use DC/DC converter
'ESPR_BLUETOOTH_ANCS=1', # Enable ANCS (Apple notifications) support
'DEFINES += -DSPIFLASH_SLEEP_CMD', # SPI flash needs to be explicitly slept and woken up
Expand Down
8 changes: 6 additions & 2 deletions boards/NRF52840DK.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,19 @@
'NET',
'GRAPHICS',
# 'NFC',
'NEOPIXEL'
'NEOPIXEL',
'JIT' # JIT compiler enabled
],
'makefile' : [
'DEFINES += -DCONFIG_GPIO_AS_PINRESET', # Allow the reset pin to work
'DEFINES += -DBOARD_PCA10056',
'DEFINES += -DNRF_USB=1 -DUSB',
'DEFINES += -DNEOPIXEL_SCK_PIN=22 -DNEOPIXEL_LRCK_PIN=23', # nRF52840 needs LRCK pin defined for neopixel
'NRF_SDK15=1',
'DEFINES += -DNRF_SDH_BLE_GATT_MAX_MTU_SIZE=131', # 23+x*27 rule as per https://devzone.nordicsemi.com/f/nordic-q-a/44825/ios-mtu-size-why-only-185-bytes
'DEFINES += -DCENTRAL_LINK_COUNT=2 -DNRF_SDH_BLE_CENTRAL_LINK_COUNT=2', # allow two outgoing connections at once
'LDFLAGS += -Xlinker --defsym=LD_APP_RAM_BASE=0x3660', # set RAM base to match MTU=131 + CENTRAL_LINK_COUNT=2
'ESPR_BLUETOOTH_ANCS=1', # Enable ANCS (Apple notifications) support
'NRF_SDK15=1',
]
}
};
Expand Down
8 changes: 8 additions & 0 deletions targets/nrf5x/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@
#endif // BLE_AMS_C_BLE_OBSERVER_PRIO
#endif // ESPR_BLUETOOTH_ANCS

#ifndef PERIPHERAL_LINK_COUNT
#define PERIPHERAL_LINK_COUNT 1
#endif
#ifndef CENTRAL_LINK_COUNT
#define CENTRAL_LINK_COUNT 1
#endif
// SDK15+ (fixes BLE UART send when CENTRAL_LINK_COUNT>1)
#define NRF_SDH_BLE_TOTAL_LINK_COUNT (CENTRAL_LINK_COUNT + PERIPHERAL_LINK_COUNT)

#if SPI_COUNT>0
#define SPI_ENABLED 1
Expand Down

0 comments on commit a9651ec

Please sign in to comment.