2 months ago
different behavior on DA14531 when burning OTPPosted by pierrej@kickma… 20 points 6 replies
i'm trying develop an application with DA14531 to control RGB led by BLE.
The DA14531 is set in BYPASS mode HW-wise and the CFG_POWER_MODE_BYPASS is defined. CFG_DEVELOPMENT_DEBUG is defined also.
Led are wired on pin 0, 10 and 11. (RST and SWIO are disabled by the firmware)
a button is wired on pin 6.
Led are controlled by pwm using timer 2.
The button is linked to an interrupt setting the duty cycle of the pwm based on a BLE characteristic for 10 sec.
Default sleep mode is set to ARCH_EXT_SLEEP_ON.
Software starts with LED turned off. The button interrupt disable the sleep mode, set the led's duty cycle and enable a callback on timer 0.
The callback increments a counter while the 10 seconds aren't reached and do the following when the 10seconds mark is reached :
- turn off the led
- put the system into deep sleep without OTP copy
- turn off timer 0
The code is working perfectly when flashed through JTAG in the sysRam, however when burning the OTP, the behavior is strange :
- BLE is working fine, characteristic can be written by a remote device and the values are retained over time.
- The Leds are flashing every second or so when the BLE is advertising.
- The leds are flickering very fast when connection and service discovery is done.
- The leds are turned on when connection is finished.
- Disconnecting the remote device restart the flashing while the advertising is started again.
- The button does not light the led.
- The Leds colors aren't related to the values stored in the BLE characteristic.
OTP burn is done via SmartSnippets Toolbox and the header is the one proposed by the toolbox without modification exept for Application flags 1 and 2 which are set to yes.
I have been able to reproduce this exact behavior while flashing in sysRam by "forgetting" to set CTRL_SYS_REG[DEBUGGER_ENABLE] to 0 and disconnecting the jtag through the flashing software.
Note that it only reproduce the behavior if the jtag is disconnected via a software mean (close debug option when flashing). If i unplug the jtag while it's connection is up, everything works fine.