Argon reporting wrong __system_product_version when Asset OTA is used

Good morning,

I have an Argon on Device OS 5.8.2 with a particular firmware that reports the wrong __system_product_version.

With this particular FW it reports 63:

0000005064 [app] INFO: PRODUCT VERSION: 63
0000005064 [app] INFO: PRODUCT ID: 18

With a brand new FW, almost blank, it correctly reports 123:

0000003701 [app] INFO: PRODUCT VERSION: 123
0000003701 [app] INFO: PRODUCT ID: 12

This is what I set in both FW. In the global space:

extern uint16_t __system_product_version;
extern uint16_t __system_product_id;
PRODUCT_VERSION(123);

In setup() or loop() (i've tried both):

Log.info("PRODUCT VERSION: %u", __system_product_version);
Log.info("PRODUCT ID: %u", __system_product_id);

What is it in this particular FW that is impacting the reading of the product version?
If I remove the extern declarations, the situation does not improve.

Thanks!

Test FW:

#include "Particle.h"

SYSTEM_MODE(AUTOMATIC);
SYSTEM_THREAD(ENABLED);
SerialLogHandler logHandler(LOG_LEVEL_INFO);

extern uint16_t __system_product_version;
extern uint16_t __system_product_id;

PRODUCT_VERSION(123);

void setup()
{
  waitFor(Serial.isConnected, 5000);
  delay(1000);
  Log.info("PRODUCT VERSION: %u", __system_product_version);
  Log.info("PRODUCT ID: %u", __system_product_id);
}

void loop()
{
}


EDIT: The issue seems to be how the device sees that value, since on the console I can see it correctly reports 123:

While logs on device show:

0000004748 [app] INFO: PRODUCT VERSION: 63
0000004748 [app] INFO: PRODUCT ID: 18

The device reports 63 no matter what I set with PRODUCT_VERSION.

Shot in the dark: could it be that I have added this Argon to a product in the past and it is still lingering there?

It's not clear what's happening, but __system_product_id should be 12 for the Argon. 18 isn't even a valid value, so that's wrong as well, and you don't even set that.

That's interesting.

I tried device restore and did not change anything.

I also suspected Asset OTA, so I removed all references of asset OTA in this particular FW and... it reported correctly:

0000003991 [app] INFO: PRODUCT VERSION: 123
0000003992 [app] INFO: PRODUCT ID: 12

Seems there is a collision between these variables and the Asset OTA feature.
Could it be?

I was pointed to use this as a workaround:

    product_details_t info;
    info.size = sizeof(info);
    spark_protocol_get_product_details(spark_protocol_instance(), &info);
    LOG(INFO, "product id: %lu, version: %lu", (unsigned)info.product_id, (unsigned)info.product_version);

It avoids the issue with Asset OTA and reports correctly both values.
Thanks!

potential source from random repo:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.