On 10/15/25 15:04, Stefano Cordibella wrote:
> Dear Stefano,
> I'm writing on this old post because I have the same doubt: I'm not
> clear on why the value 2 should be used after an update to report that
> the update was successful.
> In the documentation at
https://sbabic.github.io/swupdate/swupdate-best-
> practise.html#update-concept <
https://sbabic.github.io/swupdate/
> swupdate-best-practise.html#update-concept>, I also see that the ustate
> variable should be set to 0.
Documentation is correct, ustate is reset to 0 when the transaction is
completed.
SWUpdatwe handles autoimatic the transition 0 (NORMAL) to 1 (INSTALLED).
When the system is booting, you have still the possibility to introduce
another state (if required), or you complete the transaction (as I
usually do, and ustate is set to 0). As Framework, you have free hands.
You decide yourself when the update is successfully tested. Note that
the flag passed to SWUpdate via -c is not the ustate. It declares the
final status of the transaction to be passed to the server. So yes,
SWUpdate will be started with "-c 2" (it means success), and at the same
time the ustate env variable is reset to 0.
Best regards,
Stefano Babic
> Am I misunderstanding something, or does the documentation need to be
> updated?
>
> Best regards,
> Stefano.
>
> On Tuesday, April 16, 2019 at 1:03:37 PM UTC+2 Stefano Babic wrote:
>
> On 16/04/19 00:47, Ben Eck wrote:
> > Hi Stefano,
> >
> > Pardon me for being a little confused, but using a uboot environment
> > variable named 'ustate' instead of the -c flag does in fact seem
> to work
> > for notifying a hawkbit of a successful update.
>
> Yes, the parameter can override the value of the ustate variable. It is
> ok how you set it.
>
> > The status assigned with
> > the suricatta -c flag just seems to override the uboot persistent
> state
> > set by the ustate variable.
>
> Correct.
>
> >
> > Are the update_state_t enumerated in state.h
> > <
https://github.com/sbabic/swupdate/blob/master/include/state.h
> <
https://github.com/sbabic/swupdate/blob/master/include/
> state.h>> supposed to
> > be the same as the statuses given for the -c flag? E.g 1=AGAIN,
> > 2=SUCCESS, 3=FAILED? They seem to be, except that 2=SUCCESS
> doesn't seem
> > to match STATE_TESTING.
>
> It could be a little confusing. Anyway, 1=INSTALLED is set
> automatically
> after a successful update, and putting the state into 2=TESTING (aks
> SUCCESS) means that the new software was started and a feedback is sent
> to Hawkbit.
>
> >
> > Thanks again for your help! Your project has been super helpful in
> > getting our software update system off the ground.
>
> You're welcome.
>
> Best regards,
> Stefano Babic
>
> >
> > Ben Eck
> >
> > Embedded Systems Engineer
> >
> >
> > OneRain
> >
> > The Rainfall Company
> >
> >
> > 1531 Skyway Drive | Unit D | Longmont | Colorado 80504
> >
> > Toll Free 1-800-758-RAIN (7246)
> >
> > Phone
+1-303-774-2033 <tel:(303)%20774-2033>
> >
> > Fax
+1-303-774-2037 <tel:(303)%20774-2037>
> >
> >
E-mail...@onerain.com <mailto:
ben...@onerain.com>
> > <
https://www.linkedin.com/company/onerain <https://
>
www.linkedin.com/company/onerain>>andFacebook
> > <
https://www.facebook.com/onerain.inc/ <
https://www.facebook.com/
> > > Phone
+1-303-774-2033 <tel:(303)%20774-2033>
> > >
> > > Fax
+1-303-774-2037 <tel:(303)%20774-2037>
> > >
www.onerain.com <
http://www.onerain.com> <http://
> > > <
https://www.linkedin.com/company/onerain <https://
>
www.linkedin.com/company/onerain>>andFacebook
> > > <
https://www.facebook.com/onerain.inc/ <https://
> hawkbit%7Csort:date/swupdate/UPkuPbmk5X4/XRQBBwL9CwAJ <https://
>
groups.google.com/forum/#!searchin/swupdate/hawkbit%7Csort:date/
> swupdate/UPkuPbmk5X4/XRQBBwL9CwAJ>
> > >
> > > You have to inform SWUpdate if the new software runs
> > flawlessly. In most
> > > cases, system reboots after an update and the new software
> > should start
> > > SWUPdate with the "-c <state>" parameter. This is forwarded to
> > Hawkbit.
> > >
> > > > So, I have a few questions:
> > > >
> > > > 1) What is the name of the bootloader environment state
> > variable that
> > > > stores the update status? Looking at
config.in <http://
>
config.in>
> > <
http://config.in <
http://config.in>> <
http://config.in <http://
>
config.in>>
> > > <
http://config.in <
http://config.in>>, seems
> > > Phone:
+49-8142-66989-53 <tel:+49%208142%206698953> Fax:
>
+49-8142-66989-80 <tel:+49%208142%206698980> Email:
> <
https://groups.google.com/d/optout>.
> >
> > --
> >
> =====================================================================
> > DENX Software Engineering GmbH, Managing Director: Wolfgang
> Denk
> > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> Germany
> > Phone:
+49-8142-66989-53 <tel:+49%208142%206698953> Fax:
>
+49-8142-66989-80 <tel:+49%208142%206698980> Email:
> <
https://groups.google.com/d/optout>.
>
>
> --
> =====================================================================
> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone:
+49-8142-66989-53 <tel:+49%208142%206698953> Fax:
>
+49-8142-66989-80 <tel:+49%208142%206698980> Email:
sba...@denx.de
> =====================================================================
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swupdate+u...@googlegroups.com
> <mailto:
swupdate+u...@googlegroups.com>.
> To view this discussion visit
https://groups.google.com/d/msgid/
> swupdate/97631b4e-8237-48a6-865d-229f6eb9a9dcn%
40googlegroups.com
> <
https://groups.google.com/d/msgid/
> swupdate/97631b4e-8237-48a6-865d-229f6eb9a9dcn%
40googlegroups.com?
> utm_medium=email&utm_source=footer>.