multi ota targets from example: AnyCloud_OTA_Using_MQTT

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
YaWu_4722351
Employee
Employee
First question asked First reply posted

Hi,

I am using PrototypingKit (CY8CPROTO-062-4343W) with ModusToolbox. Taking the "AnyCloud_OTA_Using_MQTT" example directly, I build the project. Then two questions come to my way, hope somebody could help to explain what happens here. Thanks very much.

  1. Where exactly the "anycloud/test/ota/image" ota happens?  I found inside: libs\anycloud-ota\source\cy_ota_agent.c, line 649, callback function is called here. But from: source\ota_task.c, line 239, void ota_callback(), couldn't find how the image is upgraded.
  2. How to add a second ota target? From: source\ota_app_config.h, line 77, I found the ota topics. If I want to add a second or third topic, what should I do? From: source\ota_task.c, line 239, void ota_callback(),
    • cb_arg can just be converted to cy_ota_context_ptr, it's a void pointer. I need to dig into: libs\anycloud-ota\source\cy_ota_internal.h, line 184, to find out  cy_ota_context_t. Don't understand why 'cy_ota_context_t' is put inside "internal" header.Why don't put it inside "cy_ota_api.h" ?
    • cb_arg can't interpret out any information about different ota topics, how can I differentiate topics?

In another way to ask:

        

Header 1

/* MQTT topics */

const char * my_topics[ MQTT_TOPIC_FILTER_NUM ] =

{

        "anycloud/test/ota/image",                       // original topic to upgrade fw of prototypingKit

        "anycloud/test/ota/my_another_module" // another topic to upgrade fw of external module by OTA

};

How can distinguish topics based on cb_arg ?

Header 1
void ota_callback(cy_ota_cb_reason_t reason, uint32_t value, void *cb_arg )

Thanks,

Yang

0 Likes
2 Replies
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

Can you elaborate more on your first query? Do you want to understand how the OTA image upgradation happens or the query is related to the MQTT topic which is used to upgrade the firmware of the prototyping kit?

Thanks

0 Likes

Hi,

thanks for your response.

Actually to make the question more simple:

I want to have two OTA targets on the prototypingKit. One is the image for prototypingKit itself. Another one is the image for another subsystem hooked on prototypingKit by UART. I want to have the possibility of upgrade both of them. But from the callback function, I can't tell which system the downloading image is going to upgrade.

Currently I am doing something not nice work-around. Is there any suggestions, or existed solution?

Best Regards,

Yang

0 Likes