Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial update of README for Mbed CE #2

Merged
merged 1 commit into from
Dec 29, 2024
Merged

Conversation

multiplemonomials
Copy link

This updates the README to reflect the new way that mcuboot and the mcuboot demo app work in Mbed CE.

Still to do:

  • Explain how to enable encryption
  • Explain how to add a new target to the JSON files

@zhiyong-ft
Copy link

Looks about right, spotted a few typo some of which are probably from me, will go over again tomorrow then add instructions about encrypted images in another PR

@lefebvresam lefebvresam merged commit 852d70e into master Dec 29, 2024
2 checks passed
@zhiyong-ft
Copy link

@multiplemonomials is there a stable version of mbed-os/ce that we should use? I am trying to build a version for production usage. I tried to pull in the latest master, got many errors when trying to build.

@multiplemonomials
Copy link
Author

Uh oh, what are the errors? btw, make sure to delete cache and reconfigure after updating the mbed-os submodule

@zhiyong-ft
Copy link

I deleted the entire folder under .\build\DISCO_F769NI\, got 100s if errors like the following, seems mostly if not all are multiple definition of xxx:

[build] D:/Temp/mbed-mcuboot-bootloader/mbed-os/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c:54: multiple definition of `bitcopy'; mbed-os/CMakeFiles/mbed-baremetal.dir/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c:54: first defined here
[build] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c.obj: in function `bitcopy0':
[build] D:/Temp/mbed-mcuboot-bootloader/mbed-os/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c:72: multiple definition of `bitcopy0'; mbed-os/CMakeFiles/mbed-baremetal.dir/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c:72: first defined here
[build] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c.obj: in function `ip6tos':
[build] D:/Temp/mbed-mcuboot-bootloader/mbed-os/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c:30: multiple definition of `ip6tos'; mbed-os/CMakeFiles/mbed-baremetal.dir/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c:30: first defined here
[build] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c.obj: in function `ip6_prefix_tos':
[build] D:/Temp/mbed-mcuboot-bootloader/mbed-os/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c:104: multiple definition of `ip6_prefix_tos'; mbed-os/CMakeFiles/mbed-baremetal.dir/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c:104: first defined here
[build] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/rtx_thread.c.obj: in function `osThreadFlagsSet':
[build] D:/Temp/mbed-mcuboot-bootloader/mbed-os/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/rtx_thread.c:1882: multiple definition of `osThreadFlagsSet'; mbed-os/CMakeFiles/mbed-baremetal.dir/rtos/source/ThisThread.cpp.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/platform/include/platform/internal/mbed_atomic_impl.h:590: first defined here
[build] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/cmsis/device/rtos/TOOLCHAIN_GCC_ARM/mbed_boot_gcc_arm.c.obj: in function `software_init_hook':
[build] D:/Temp/mbed-mcuboot-bootloader/mbed-os/cmsis/device/rtos/TOOLCHAIN_GCC_ARM/mbed_boot_gcc_arm.c:55: multiple definition of `software_init_hook'; mbed-os/CMakeFiles/mbed-baremetal.dir/platform/source/mbed_sdk_boot.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/platform/source/mbed_sdk_boot.c:168: first defined here
[build] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/cmsis/device/rtos/TOOLCHAIN_GCC_ARM/mbed_boot_gcc_arm.c.obj: in function `__wrap_main':
[build] D:/Temp/mbed-mcuboot-bootloader/mbed-os/cmsis/device/rtos/TOOLCHAIN_GCC_ARM/mbed_boot_gcc_arm.c:92: multiple definition of `__wrap_main'; mbed-os/CMakeFiles/mbed-baremetal.dir/platform/source/mbed_sdk_boot.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/platform/source/mbed_sdk_boot.c:188: first defined here
[build] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/cmsis/device/rtos/source/mbed_boot.c.obj: in function `mbed_init':
[build] D:/Temp/mbed-mcuboot-bootloader/mbed-os/cmsis/device/rtos/source/mbed_boot.c:75: multiple definition of `mbed_init'; mbed-os/CMakeFiles/mbed-baremetal.dir/platform/source/mbed_sdk_boot.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/platform/source/mbed_sdk_boot.c:77: first defined here
[build] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/cmsis/device/rtos/source/mbed_boot.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/cmsis/device/rtos/source/mbed_boot.c:72: multiple definition of `mbed_stack_isr_size'; mbed-os/CMakeFiles/mbed-baremetal.dir/platform/source/mbed_sdk_boot.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/platform/source/mbed_sdk_boot.c:34: first defined here
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --build d:/Temp/mbed-mcuboot-bootloader/build/DISCO_F769NI-Debug --config Debug --target all -- exited with code: 1
[build] c:/progra~2/gnuarm~1/102021~1.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: mbed-os/CMakeFiles/mbed-os.dir/cmsis/device/rtos/source/mbed_boot.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/cmsis/device/rtos/source/mbed_boot.c:71: multiple definition of `mbed_stack_isr_start'; mbed-os/CMakeFiles/mbed-baremetal.dir/platform/source/mbed_sdk_boot.c.obj:D:/Temp/mbed-mcuboot-bootloader/mbed-os/platform/source/mbed_sdk_boot.c:33: first defined here

In the problems tab in VS Code, there is this entry that might be relevant:

[{
	"resource": "/D:/Temp/mbed-mcuboot-bootloader/mbed-os/tools/cmake/app.cmake",
	"owner": "cmake-configure-diags",
	"severity": 4,
	"message": "CMake Warning (dev) at mbed-os/tools/cmake/app.cmake:37 (enable_language):project() should be called prior to this enable_language() call.",
	"source": "CMake (enable_language)",
	"startLineNumber": 37,
	"startColumn": 1,
	"endLineNumber": 37,
	"endColumn": 10000,
	"relatedInformation": [
		{
			"startLineNumber": 6,
			"startColumn": 1,
			"endLineNumber": 6,
			"endColumn": 1000,
			"message": "In call to 'include' here",
			"resource": "/D:/Temp/mbed-mcuboot-bootloader/CMakeLists.txt"
		}
	]
}]

This is from mbed-os commit: 722c2f119647e14f1f44d6e1e54041b4442e63b4. I am still learning the ropes of CMake, so it is possible I messed up something outside of mbed-os.

@multiplemonomials
Copy link
Author

I bet you have the wrong version of mcuboot checked out. It will end up linking mcuboot to mbed-os and will cause errors like this. (mbed-os is an OBJECT library and must only be linked to the final executable)

@zhiyong-ft
Copy link

I think you are right. Somehow I have MCUboot commit: 7cc60059845d4252773f538aa50e0906c34f7bd5. Once I checked out the latest version from your repo: de8c4b0b57d2c1b7b81e9bde412198e161890633, compilation is no longer a problem. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants