AnyCloud_OTA_Using_MQTT

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

cross mob
zhenning_zhu
Level 2
Level 2
10 sign-ins 10 replies posted 5 replies posted

Hi,I use Project Creator 1.1 to create anycloud_ota_using_mqtt, but remote HEAD refers to nonexistent ref, unable to checkout.

批注 2020-09-19 142331.jpg

0 Likes
1 Solution
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Hi,

You might be referencing to the manifest files that are not the latest. This could lead you to the error "remote HEAD refers to nonexistent ref".

The code example AnyCloud_OTA_Using_MQTT are presenting nicely at github.com, see below:

GitHub - cypresssemiconductorco/mtb-example-anycloud-ota-mqtt: This code example demonstrates Over-t...

Try to download from github.com directly and import it to the workspace of MTB, using Import Wizard.

And then remember to run the command "make getlibs" from the root of the project directory, to get all the libraries loaded. This step is always required by MTB projects when they are firstly imported, which is automatically and silently executed when using Project Creator to create the MTB projects. And it is the root cause that often leads to the error "terminated with exit code 2".

Please refer to 4.4 make getlibs in ModusToolbox User Guide, for detailed instructions.

-------------------------------------------------------------

///Add some new findings///

This code example also requires Python to be installed on your system and can be called system-wide. So correctly install Python 2 / Python 3 first, or you could be dealing with errors.

And then you could still be facing the following errors:

Create  unsigned.hex

imgtool create signed .hex.

imgtool.py create -R 0 -e little --pad-header --align 8 -H 0x400 -M 2000 -v 1.0.0 -L 0x00012000 -S 0x000EE000   ./build/CY8CPROTO-062-4343W/Debug/mtb-example-anycloud-ota-mqtt.unsigned.hex ./build/CY8CPROTO-062-4343W/Debug/mtb-example-anycloud-ota-mqtt.hex

Traceback (most recent call last):

  File "./libs/mcuboot/scripts/imgtool.py", line 17, in <module>

    from imgtool import main

  File "C:\Test\mtb-example-anycloud-ota-mqtt-master\libs\mcuboot\scripts\imgtool\main.py", line 23, in <module>

    from imgtool import image, imgtool_version

  File "C:\Test\mtb-example-anycloud-ota-mqtt-master\libs\mcuboot\scripts\imgtool\image.py", line 25, in <module>

    from intelhex import IntelHex

ModuleNotFoundError: No module named 'intelhex'

make[1]: *** [libs/psoc6make/make/core/build.mk:508: CY_BUILD_app_postbuild] Error 1

make: *** [libs/psoc6make/make/core/main.mk:353: secondstage] Error 2

"C:/Users/chlw/ModusToolbox/tools_2.1/modus-shell/bin/make CY_MAKE_IDE=eclipse CY_IDE_TOOLS_DIR=C:/Users/chlw/ModusToolbox/tools_2.1 -j8 all" terminated with exit code 2. Build might be incomplete.

From the log you can see that "ModuleNotFoundError" can also lead you to the error "terminated with exit code 2". To solve this, you have to pre-install all the python modules, following Python rules.

For example, the log above shows that "No module named 'intelhex'", which tells us the Python module intelhex cannot be found. Then we can execute the following command to install the module intelhex:

pip install intelhex

All the prerequisite modules I can find should be “cryptography, intelhex, click, cbor”. So you can run the following command to install them once for all:

pip install cryptography intelhex click cbor

Best regards

View solution in original post

0 Likes
3 Replies
zhenning_zhu
Level 2
Level 2
10 sign-ins 10 replies posted 5 replies posted

Hi ,

I create this App by offline, but build error as follow:

make[1]: *** [libs/psoc6make/make/core/build.mk:508: CY_BUILD_app_postbuild] Error 1

make: *** [libs/psoc6make/make/core/main.mk:350: secondstage] Error 2

"C:/Users/shzzn/ModusToolbox/tools_2.1/modus-shell/bin/make CY_MAKE_IDE=eclipse CY_IDE_TOOLS_DIR=C:/Users/shzzn/ModusToolbox/tools_2.1 -j4 all" terminated with exit code 2. Build might be incomplete.

14:11:57 Build Failed. 2 errors, 7 warnings. (took 11m:10s.724ms)

0 Likes
Roy_Liu
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 10 questions asked

Hi

Search the "terminated with exit code 2. Build might be incomplete" and check if the existed discussion can be helpful?

Roy Liu
0 Likes
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Hi,

You might be referencing to the manifest files that are not the latest. This could lead you to the error "remote HEAD refers to nonexistent ref".

The code example AnyCloud_OTA_Using_MQTT are presenting nicely at github.com, see below:

GitHub - cypresssemiconductorco/mtb-example-anycloud-ota-mqtt: This code example demonstrates Over-t...

Try to download from github.com directly and import it to the workspace of MTB, using Import Wizard.

And then remember to run the command "make getlibs" from the root of the project directory, to get all the libraries loaded. This step is always required by MTB projects when they are firstly imported, which is automatically and silently executed when using Project Creator to create the MTB projects. And it is the root cause that often leads to the error "terminated with exit code 2".

Please refer to 4.4 make getlibs in ModusToolbox User Guide, for detailed instructions.

-------------------------------------------------------------

///Add some new findings///

This code example also requires Python to be installed on your system and can be called system-wide. So correctly install Python 2 / Python 3 first, or you could be dealing with errors.

And then you could still be facing the following errors:

Create  unsigned.hex

imgtool create signed .hex.

imgtool.py create -R 0 -e little --pad-header --align 8 -H 0x400 -M 2000 -v 1.0.0 -L 0x00012000 -S 0x000EE000   ./build/CY8CPROTO-062-4343W/Debug/mtb-example-anycloud-ota-mqtt.unsigned.hex ./build/CY8CPROTO-062-4343W/Debug/mtb-example-anycloud-ota-mqtt.hex

Traceback (most recent call last):

  File "./libs/mcuboot/scripts/imgtool.py", line 17, in <module>

    from imgtool import main

  File "C:\Test\mtb-example-anycloud-ota-mqtt-master\libs\mcuboot\scripts\imgtool\main.py", line 23, in <module>

    from imgtool import image, imgtool_version

  File "C:\Test\mtb-example-anycloud-ota-mqtt-master\libs\mcuboot\scripts\imgtool\image.py", line 25, in <module>

    from intelhex import IntelHex

ModuleNotFoundError: No module named 'intelhex'

make[1]: *** [libs/psoc6make/make/core/build.mk:508: CY_BUILD_app_postbuild] Error 1

make: *** [libs/psoc6make/make/core/main.mk:353: secondstage] Error 2

"C:/Users/chlw/ModusToolbox/tools_2.1/modus-shell/bin/make CY_MAKE_IDE=eclipse CY_IDE_TOOLS_DIR=C:/Users/chlw/ModusToolbox/tools_2.1 -j8 all" terminated with exit code 2. Build might be incomplete.

From the log you can see that "ModuleNotFoundError" can also lead you to the error "terminated with exit code 2". To solve this, you have to pre-install all the python modules, following Python rules.

For example, the log above shows that "No module named 'intelhex'", which tells us the Python module intelhex cannot be found. Then we can execute the following command to install the module intelhex:

pip install intelhex

All the prerequisite modules I can find should be “cryptography, intelhex, click, cbor”. So you can run the following command to install them once for all:

pip install cryptography intelhex click cbor

Best regards

0 Likes