You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/09/23 19:48:43 UTC

[GitHub] [incubator-nuttx] gustavonihei opened a new pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

gustavonihei opened a new pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604


   ## Summary
   This PR intends to add a new feature to the ESP32 build system for easing the provisioning of prebuilt binaries.
   Depending on the choice of *Application Image Format*, the user must flash the following binaries to the chip's flash:
   
   **Legacy image format (IDFboot)**
   - `bootloader-esp32.bin`
   - `partition-table-esp32.bin`
   
   **MCUboot image format**
   - `mcuboot-esp32.bin`
   
   This PR adds two new optional **Make** targets: `bootloader` and `clean_bootloader`.
   It also brings an implementation for ESP32 chips. Depending on the option selected by the user, this command will execute one the two operations:
   1) Download prebuilt binaries (`ESP32_BOOTLOADER_DOWNLOAD_PREBUILT`, **default**)
   2) Build binaries from source (`ESP32_BOOTLOADER_BUILD_FROM_SOURCE`)
   
   Host dependencies for option building the bootloader from source:
   - CMake version 3.13
   
   ## Impact
   New feature, should have no impact to the standard workflow of the build system.
   
   ## Testing
   `make bootloader` for `esp32-devkitc:nsh` and `esp32-devkitc:mcuboot_confirm` configurations successfully downloads the prebuilt binaries.
   And when selecting `ESP32_BOOTLOADER_BUILD_FROM_SOURCE` successfully builds the binaries from source.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604#discussion_r715772766



##########
File path: tools/Makefile.unix
##########
@@ -459,6 +459,26 @@ endif
 download: $(BIN)
 	$(call DOWNLOAD, $<)
 
+# bootloader
+#
+# Some architectures require the provisioning of a bootloader or other
+# functions required for properly executing the NuttX binary.
+# Make.defs files for those architectures should define a bootloader target
+# with the correct operations for that platform. It will generate an error
+# if the bootloader target is not defined.
+
+bootloader:
+	$(Q) $(MAKE) -C $(ARCH_SRC) bootloader
+
+# clean_bootloader
+#
+# Removes all of the files and directories created by the bootloader target.
+# It will generate an error if the clean_bootloader target is not defined on
+# the architecture-specific Makefile.
+
+clean_bootloader:

Review comment:
       PTAL at this new PR, https://github.com/apache/incubator-nuttx/pull/4608.
   I've implemented this proposal.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604#discussion_r715277909



##########
File path: tools/Makefile.unix
##########
@@ -459,6 +459,26 @@ endif
 download: $(BIN)
 	$(call DOWNLOAD, $<)
 
+# bootloader
+#
+# Some architectures require the provisioning of a bootloader or other
+# functions required for properly executing the NuttX binary.
+# Make.defs files for those architectures should define a bootloader target
+# with the correct operations for that platform. It will generate an error
+# if the bootloader target is not defined.
+
+bootloader:
+	$(Q) $(MAKE) -C $(ARCH_SRC) bootloader
+
+# clean_bootloader
+#
+# Removes all of the files and directories created by the bootloader target.
+# It will generate an error if the clean_bootloader target is not defined on
+# the architecture-specific Makefile.
+
+clean_bootloader:

Review comment:
       should we add clean_bootloader to the dependence of distclean or clean?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604#discussion_r715282816



##########
File path: tools/Makefile.unix
##########
@@ -459,6 +459,26 @@ endif
 download: $(BIN)
 	$(call DOWNLOAD, $<)
 
+# bootloader
+#
+# Some architectures require the provisioning of a bootloader or other
+# functions required for properly executing the NuttX binary.
+# Make.defs files for those architectures should define a bootloader target
+# with the correct operations for that platform. It will generate an error
+# if the bootloader target is not defined.
+
+bootloader:
+	$(Q) $(MAKE) -C $(ARCH_SRC) bootloader
+
+# clean_bootloader
+#
+# Removes all of the files and directories created by the bootloader target.
+# It will generate an error if the clean_bootloader target is not defined on
+# the architecture-specific Makefile.
+
+clean_bootloader:

Review comment:
       For now we can’t because `clean_bootloader` may not be implemented by some archs, which will break `distclean`.
   It would require some yet-to-be-defined generic config to decide whether `distclean` should call `clean_bootloader` or not.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604#discussion_r715267448



##########
File path: tools/esp32/Bootloader.mk
##########
@@ -0,0 +1,123 @@
+############################################################################
+# tools/esp32/Bootloader.mk

Review comment:
       Since this makefile generate the binary for target, not for PC, should we put it to arch/chip folder?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604#discussion_r715282816



##########
File path: tools/Makefile.unix
##########
@@ -459,6 +459,26 @@ endif
 download: $(BIN)
 	$(call DOWNLOAD, $<)
 
+# bootloader
+#
+# Some architectures require the provisioning of a bootloader or other
+# functions required for properly executing the NuttX binary.
+# Make.defs files for those architectures should define a bootloader target
+# with the correct operations for that platform. It will generate an error
+# if the bootloader target is not defined.
+
+bootloader:
+	$(Q) $(MAKE) -C $(ARCH_SRC) bootloader
+
+# clean_bootloader
+#
+# Removes all of the files and directories created by the bootloader target.
+# It will generate an error if the clean_bootloader target is not defined on
+# the architecture-specific Makefile.
+
+clean_bootloader:

Review comment:
       For now we can’t because `clean_bootloader` may not be implemented by some archs, which will break `distclean`.
   It would require some yet-to-be-defined generic config (e.g. `CONFIG_HAVE_BOOTLOADER`) to decide whether `distclean` should call `clean_bootloader` or not.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604#discussion_r715298577



##########
File path: tools/Makefile.unix
##########
@@ -459,6 +459,26 @@ endif
 download: $(BIN)
 	$(call DOWNLOAD, $<)
 
+# bootloader
+#
+# Some architectures require the provisioning of a bootloader or other
+# functions required for properly executing the NuttX binary.
+# Make.defs files for those architectures should define a bootloader target
+# with the correct operations for that platform. It will generate an error
+# if the bootloader target is not defined.
+
+bootloader:
+	$(Q) $(MAKE) -C $(ARCH_SRC) bootloader
+
+# clean_bootloader
+#
+# Removes all of the files and directories created by the bootloader target.
+# It will generate an error if the clean_bootloader target is not defined on
+# the architecture-specific Makefile.
+
+clean_bootloader:

Review comment:
       OK




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604#discussion_r715282816



##########
File path: tools/Makefile.unix
##########
@@ -459,6 +459,26 @@ endif
 download: $(BIN)
 	$(call DOWNLOAD, $<)
 
+# bootloader
+#
+# Some architectures require the provisioning of a bootloader or other
+# functions required for properly executing the NuttX binary.
+# Make.defs files for those architectures should define a bootloader target
+# with the correct operations for that platform. It will generate an error
+# if the bootloader target is not defined.
+
+bootloader:
+	$(Q) $(MAKE) -C $(ARCH_SRC) bootloader
+
+# clean_bootloader
+#
+# Removes all of the files and directories created by the bootloader target.
+# It will generate an error if the clean_bootloader target is not defined on
+# the architecture-specific Makefile.
+
+clean_bootloader:

Review comment:
       For now we can’t because `clean_bootloader` may not be implemented by some archs, which will break `distclean`.
   It would require some yet-to-be-defined generic config (e.g. `CONFIG_HAVE_BOOTLOADER`) to decide whether `distclean` should call `clean_bootloader` or not.
   If you consider this a reasonable approach, I may implement it. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4604: xtensa/esp32: Enable build system to download or build binaries from source

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4604:
URL: https://github.com/apache/incubator-nuttx/pull/4604#discussion_r715271597



##########
File path: tools/esp32/Bootloader.mk
##########
@@ -0,0 +1,123 @@
+############################################################################
+# tools/esp32/Bootloader.mk

Review comment:
       Sure, it makes sense. Moved it to `arch/xtensa/src/esp32/`.
   Thanks.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org