SUOTA app non responsive while updating and stuck at 0%

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8 posts / 0 new
Last post
mahmed106
Offline
Last seen: 1 month 3 weeks ago
Joined: 2019-05-03 17:28
SUOTA app non responsive while updating and stuck at 0%

HI Dialog

I m working on a custom board based on DA14681. I m working on that board for over an year and it worked fine. But now when i perform a SUOTA update, at 1st it used to connect and suddenly disconnects and DA14681 restarts.

This was happening with my Firmware that was in this month. Binaries of old firmares were working fine that were 5 6 months old firmwares.

So then i disabled the watchdog and now when SUOTA update is going on, it didnt disconnect but it freezes at 0% even for 45 minutes.

I m not able to find what is the problem and what have i done in the code that this is happening. cz last 6 monhts old binries are find but last one month are not.

Please help me.

Device: 
mahmed106
Offline
Last seen: 1 month 3 weeks ago
Joined: 2019-05-03 17:28
I have checked with the

I have checked with the debugger and it stucks here

 

Attachment: 
PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi mahmed106,

Hi mahmed106,

Let me check it and I’ll get back to you. Can I ask what is the QSPI flash that you are using in your design?

Thanks, PM_Dialog

mahmed106
Offline
Last seen: 1 month 3 weeks ago
Joined: 2019-05-03 17:28
GD25LQ80CEIG

GD25LQ80CEIG

Suota works when timer 0 has 1Khz time but fails at 20Khz

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi mahmed106,

Hi mahmed106,

Could you please share how the timer is configured? Can you replicate this in an non-SUOTA project?  If you can provide further inputs in order to replicate it in my side, it would be very helpful.

Thanks, PM_Dialog

mahmed106
Offline
Last seen: 1 month 3 weeks ago
Joined: 2019-05-03 17:28
void _timer0_init(void)

void _timer0_init(void)
{
        timer0_config cfg = {
                /*
                 * Select the clock source.
                 *
                 * This can be either the external crystal XTAL32K (low power clock)
                 * or the crystal XTAL16MHz (fast clock).
                 *
                 * \note: In case the slow clock is selected (XTAL32K), and upon a HW reset (cold boot),
                 *        it will take approximately 8 seconds for the crystal to settle (worst case).
                 *        Thus, to avoid dissimilarities in PWM pulses, you should not enable any timer
                 *        functionality for that period of time.
                 */
                .clk_src = HW_TIMER0_CLK_SRC_FAST,

                /*
                 * Select the clock divider.
                 *
                 * In this example we divide the selected clock source, that is XTAL16MHz, with 8.
                 * Thus, the actual clock source of TIMER0 is 16/8 = 2MHz (0.5us each clock tick)
                 */
                .fast_clk_div = HW_TIMER0_FAST_CLK_DIV_8,

                /* For PWM functionality the ON-counter clock divider should be disabled */
                .on_clock_div = false,

                /*
                 * T0 counter value is decremented on each clock cycle. At the beginning it's loaded from
                 * M-register and then, once reached zero, loaded from N-register (and then M and N again).
                 *
                 * PWM0 is high when counting down M-register and low when counting down N-register.
                 *
                 * In this example, we want to generate a 4kHz pulse (250us period). This means that TIMER0
                 * should measure 250us / 0.5us = 500 clock ticks.
                 */

                 /*
                  * Duty cycle ON, expressed in clock ticks.
                  *
                  * In this example we want to generate a pulse with 50% duty cycle, so this
                  * value should be set to 500 / 2 = 250 clock ticks
                  *
                  */
                 .t0_reload_m = 19,//1KHz 10% -> 199, 249, // Minus 1 clock tick since we start counting from 0

                 /*
                  * Duty cycle OFF, expressed in clock ticks.
                  *
                  * In our example, this value should be set to (500 - 250) = 250 clock ticks
                  *
                  */
                 .t0_reload_n = 79,//1KHz 10% -> 1789,249, // Minus 1 clock tick since we start counting from 0

                 /*
                  * This value declares the time (expressed in clock ticks) an interrupt will be issued.
                  * In a typical application this value equals to the sum of M-register and N-register.
                  *
                  * \note: An interrupt will be issued when ON-counter reaches zero and T0-counter reaches
                  *        zero while decrementing the value loaded in N-register. (when a full PWM cycle
                  *        is complete). For instance, and given the current configurations, a value set to
                  *        [500] will result in issuing an interrupt every 2 PWM cycles (500us)
                  */
                 .on_reload = 98 //1KHz -> 1998,//498, // 249 + 249 = 498

                 /* PWM table 21Khz
                  * Total 92 for 21Khz and 1998 for 1Khz
                  * HighValue = 92 x (PWM_Percentage/100)
                  * LowValue  = 92 - High Value
                  *   PWM %   High     Low
                        5       5       87
                        10      9       83
                        15      14      78
                        20      18      74
                        25      23      69
                        30      28      64
                        35      32      60
                        40      37      55
                        45      41      51
                        50      46      46
                        55      51      41
                        60      55      37
                        65      60      32
                        70      64      28
                        75      69      23
                        80      74      18
                        85      78      14
                        90      83      9
                        95      87      5
                        100     92      0
                  */

        };

        // Initialize TIMER_0
        hw_timer0_init(&cfg);

 

In a non suota project i can do suota update and that doesnt make much sense cz in a suota project , issue occurs while souta updating

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi mahmed106,

Hi mahmed106,

Thanks for the update - I'll try to replicate it. In the meanwhile, would it be possible to use a BLE sniffer tool and share a capture, so that I can understand what is happening over the air?  

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi mahmed106,

Hi mahmed106,

Apologies for the delay -  would it be possible to share the project with me? Additionally , can you also share a sniffer log? 

Thanks, PM_Dialog