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

Riscv 32 mcu #36118

Merged
merged 3 commits into from
Jul 16, 2020
Merged

Riscv 32 mcu #36118

merged 3 commits into from
Jul 16, 2020

Conversation

zhoupeng
Copy link
Contributor

Update for this pull request(reviewed by @nkreeger before):
#33680 (Will close)
#36095 (by @jpienaar before)

related issues:
#32041
#33677

If possible, pls review as soon as possible, the tensorflow repo is very easy to get conflict because update so quickly. Thanks,

About the three patches for review:

  1. lite:micro:tools:make: Move the default target(all) up before any others.

The default Makefile target all is compiled if there's no command-line arguments.

  1. lite:micro:riscv32_mcu:Fix build failure of undefined references.

    Fix the ld error:
    undefined references to __wrap_puts for build commands like make -f tensorflow/lite/micro/tools/make/Makefile TARGET=riscv32_mcu hello_world_bin
    The related issue is tensorflow#32041

    Refactoring, suggested by Nick Kreeger(nick.kreeger@gmail.com):
    The targets/mcu_riscv_makefile.inc should only include the bare-bones parts for building for this platform.
    So move platform specific items from targets/mcu_riscv_makefile.inc to the actual example folder.
    Create a riscv32_mcu folder in each example directory. In those directories, create a new Makefile.inc that adds these rules moved out.

    The bug's original reasons:
    The Makefile variables XXX_TEST_SRCS/XXX_SRCS in targets/mcu_riscv_makefile.inc are overridden by the the examples's respective makefile.inc (eg. hello_world/Makefile.inc), which leads to the architecture special __wrap__funs are not included correctly.

  2. lite:micro:riscv32_mcu: Fix hidden symbol __dso_handle' isn't defined. For arduino sketch in riscv_mcu examples, this patch fix by declare the global variable void* __dso_handle;`.

…ers.

The default Makefile target `all` is compiled if there's no command-line arguments.
Fix the ld error:
undefined references to `__wrap_puts` for build commands like `make -f tensorflow/lite/micro/tools/make/Makefile TARGET=riscv32_mcu hello_world_bin`
The related issue is tensorflow#32041

Refactoring, suggested by Nick Kreeger(nick.kreeger@gmail.com):
The targets/mcu_riscv_makefile.inc should only include the bare-bones parts for building for this platform.
So move platform specific items from targets/mcu_riscv_makefile.inc to the actual example folder.
Create a riscv32_mcu folder in each example directory. In those directories, create a new Makefile.inc that adds these rules moved out.

The bug's original reasons:
The Makefile variables XXX_TEST_SRCS/XXX_SRCS in targets/mcu_riscv_makefile.inc are overridden by the the examples's respective makefile.inc (eg. hello_world/Makefile.inc), which leads to the
architecture special __wrap__funs are not included correctly.
For arduino sketch in riscv_mcu examples, this patch fix by declare the global variable `void* __dso_handle;`.
@tensorflow-bot tensorflow-bot bot added the size:M CL Change Size: Medium label Jan 22, 2020
@zhoupeng zhoupeng mentioned this pull request Jan 22, 2020
@gbaned gbaned self-assigned this Jan 22, 2020
@gbaned gbaned added comp:lite TF Lite related issues comp:micro Related to TensorFlow Lite Microcontrollers labels Jan 22, 2020
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Jan 22, 2020
@gbaned gbaned added the awaiting review Pull request awaiting review label Feb 4, 2020
@gbaned gbaned requested a review from njeffrie March 19, 2020 12:39
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Jul 14, 2020
Copy link
Contributor

@petewarden petewarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the slow response, this looks good, thanks!

@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jul 14, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jul 14, 2020
@gbaned gbaned added ready to pull PR ready for merge process and removed awaiting review Pull request awaiting review ready to pull PR ready for merge process labels Jul 15, 2020
@tensorflow-copybara tensorflow-copybara merged commit 8369f62 into tensorflow:master Jul 16, 2020
PR Queue automation moved this from Approved by Reviewer to Merged Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:lite TF Lite related issues comp:micro Related to TensorFlow Lite Microcontrollers ready to pull PR ready for merge process size:M CL Change Size: Medium
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants