fanoush / ds-d6

stuff for Desay/MPOW DS-D6 nRF52832 bracelet
167 stars 28 forks source link

Adafruit Bootloader #6

Open seihan opened 5 years ago

seihan commented 5 years ago

Could you please share your way of building the Adafruit bootloader ZIP package? I'm trying to run the latest Adafruit bluefruit version with the 0.2.12-1 bootloader and s132_6.1.1 softdevice. Your Adafruit bootloader stuck like in this issue in AdaOTA mode, which I solve by flashing the https://github.com/fanoush/ds-d6/blob/master/micropython/DS-D6-adafruit-back-to-desay-sd132v201.zip with the desay_dfu.py script.

I tried to build a custom bootloader based on Adafruit's with following entries inside board.h file:

`#ifndef _DSD6_NRF52832_H

define _DSD6_NRF52832_H

/------------------------------------------------------------------/ / LED ------------------------------------------------------------------*/

define LEDS_NUMBER 2

define LED_PRIMARY_PIN 33 // Red // NOT EXISTENT ?HARMLESS? PINS

define LED_SECONDARY_PIN 34 // Blue

define LED_STATE_ON 1

/------------------------------------------------------------------/ / BUTTON ------------------------------------------------------------------*/

define BUTTONS_NUMBER 2

define BUTTON_1 30

define BUTTON_2 35

define BUTTON_PULL NRF_GPIO_PIN_PULLDOWN //UP

/------------------------------------------------------------------/ / UART ------------------------------------------------------------------*/

define RX_PIN_NUMBER 22

define TX_PIN_NUMBER 23

define CTS_PIN_NUMBER 7

define RTS_PIN_NUMBER 5

define HWFC false

// Used as model string in OTA mode

define BLEDIS_MANUFACTURER "Desay"

define BLEDIS_MODEL "DS-D6"

define UF2_PRODUCT_NAME "DSD6 - Tracker"

define UF2_INDEX_URL "https://fccid.io/2AEMN-D6"

endif // _DSD6_NRF52832_H`

This gives me a 472K HEX file which is some bigger then yours (168K). In case this will work, how to generate the ZIP package with adafruit-nrfutil?

fanoush commented 5 years ago

So this is for DS-D6? in that case check my patch in micropython folder for board file and no LEDs and single button, it may not be enough to get sensible behaviour with your board field as is. Also changing button to pull down makes it always pressed. I build it via make BOARD=dsd6_nrf52832 genhex and then take the resulting dsd6_nrf52832_bootloader-0.2.11-3-gfb847b9-dirty-nosd.hex file and make zip for stock Desay firmware via

adafruit-nrfutil dfu genpkg adafruit-bootloder.zip --bootloader dsd6_nrf52832_bootloader-0.2.11-3-gfb847b9-dirty-nosd.hex --softdevice s132_nrf52_6.1.1_softdevice.hex