You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/03/30 17:32:14 UTC
[GitHub] [tvm] gromero opened a new pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
gromero opened a new pull request #7772:
URL: https://github.com/apache/tvm/pull/7772
Hi,
Could the following changes be reviewed please?
They aim to make microTVM (HEAD) work again for STM32F746.
Commit c39a6e25d "Clean up uTVM demo runtime, add ONNX model test and
tutorial (#7557)" changed the location of the Zephyr code example to
apps/ so this commit updates the tutorial examples under tutorials/micro
to reflect the new location where src/main.c resides.
Since commit c39a6e25d also split Zephyr configuration per boards,
under project's boards/, this commits also adds a proper config for the
STM32F746 Discovery board and fixes a nit in the comment in
boards/nucleo_f746zg.conf. It also removes CONFIG_MAIN_STACK_SIZE=50 for
disco and nucleo boards since the MCUs for both boads are Cortex-m7
based, not Contex-m33.
For the new boards/stm32f746g_disco.conf board config file
CONFIG_TEST_RANDOM_GENERATOR=y is set
otherwise when CONFIG_ENTROPY_GENERATOR=y linkage will fail with:
rand32.h:33: undefined reference to `z_impl_sys_rand32_get'
Finally this commit sets the UART ring buffer size back to 512 bytes,
only for disco and nucleo boards, otherwise the new value introduced
by commit c39a6e25d makes noinit section not fitting the SRAM region
on these devices, so linkage fails with:
ld: zephyr_prebuilt.elf section `noinit' will not fit in region `SRAM'
ld: section .intList VMA [0000000020050000,00000000200500e7] overlaps section noinit VMA [000000002004f5d8,0000000020050317]
ld: region `SRAM' overflowed by 792 bytes
Signed-off-by: Gustavo Romero <gu...@linaro.org>
Thanks and best regards,
Gustavo
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on a change in pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
gromero commented on a change in pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#discussion_r604420228
##########
File path: tutorials/micro/micro_tflite.py
##########
@@ -224,7 +224,7 @@
# from tvm.micro.contrib import zephyr
#
# repo_root = subprocess.check_output(["git", "rev-parse", "--show-toplevel"], encoding='utf-8').strip()
-# project_dir = f"{repo_root}/tests/micro/qemu/zephyr-runtime"
+# project_dir = f"{repo_root}/apps/microtvm/zephyr/demo_runtime"
Review comment:
@mehrdadh Sure, done for v2. I also included the new .conf file for disco board into tests/lint/check_file_type.py (I forgot it the first time and CI warned about it. BTW, I pushed with `-f` v2 so we don't get the additional lines in the commit message when the commits are squashed. I think that's really confusing on TVM project and I'll bring it up on our next community meeting.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
gromero commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-811236961
@areusch @mehrdadh are you talking about the current CI error (https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/PR-7772/3/pipeline) ?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on a change in pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
gromero commented on a change in pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#discussion_r607809432
##########
File path: apps/microtvm/zephyr/demo_runtime/boards/nucleo_f746zg.conf
##########
@@ -15,16 +15,14 @@
# specific language governing permissions and limitations
# under the License.
#
-# This file is specific to the nRF5340 DK board.
+# This file is specific to the STM32F746 Nucleo board.
# For intrinsics used by generated optimized operators.
CONFIG_CMSIS_DSP=y
-# Required for Cortex-M33 devices.
-CONFIG_MAIN_STACK_SIZE=50
-
# For random number generation.
CONFIG_ENTROPY_GENERATOR=y
+CONFIG_TEST_RANDOM_GENERATOR=y
Review comment:
Not really, I'm using Zephyr 2.4.0, the HEAD is at:
```
commit 7a3b253ced7333f5c0269387a7f3ed1dee69739d (tag: zephyr-v2.4.0, tag: v2.4.0)
Author: Maureen Helm <ma...@nxp.com>
Date: Sat Sep 26 11:40:18 2020 -0500
release: Zephyr 2.4.0
Set version to 2.4.0.
Signed-off-by: Maureen Helm <ma...@nxp.com>
```
Maybe it's a difference regarding nucleo vs disco board on Zephyr. I know it's a bit unexpected because these boards are quite alike, but in the past I found some remarkable differences regarding the symbol addresses in `zephyr.elf`, for instance, so I would be not surprised if the kconfig files used are different and the one for disco board needs that config. On my last PR version I removed it for the nucleo boards and left it only for the disco boards.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] mehrdadh commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-813741570
LGTM!
Thanks @gromero!
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
gromero commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-810449310
@mdw-octoml @mehrdadh @areusch Hi folks. I'm wondering if I could get a review for that change from you :)
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] areusch commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-811163207
hm, I wonder if the test failure is due to `CONFIG_MAIN_STACK_SIZE`?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] areusch merged pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
areusch merged pull request #7772:
URL: https://github.com/apache/tvm/pull/7772
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] mehrdadh commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-811232815
@areusch yeah you are right. Yesterday I tested without this flag and large memory size which gives error. You can either set the CONFIG_MAIN_STACK_SIZE flag or limit memory in "main.c". Not sure which one makes more sense here.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] areusch commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-811625510
@gromero I think this hit #7590. can you push an empty commit to retrigger?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
gromero commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-810567325
> Thanks @gromero ! Sorry for breaking this.
@mdw-octoml Hi Matt! No worries. Thanks for the quick reviews @mdw-octoml and @mehrdadh
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] mdw-octoml commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
mdw-octoml commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-810521591
Thanks @gromero ! Sorry for breaking this.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero edited a comment on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
gromero edited a comment on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-810572979
> Can you clarify which version of zephyr are you using? And are you testing on reference VM?
@mehrdadh I'm building against Zephyr 2.4.0. I'm not testing on the reference VM, rather I'm testing on the physical discovery board and running `micro_tflite.py` script set for that board.
I think we need to improve the CI somehow because commit `c39a6e2` from Matt in fact fixed, by its turn, other issues that passed unnoticed, like the one regarding the change from `context` to `device`. I'm in the TVM #micro channel in tlcpack Slack, so maybe we can chat more about it there.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] mehrdadh commented on a change in pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on a change in pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#discussion_r604337838
##########
File path: apps/microtvm/zephyr/demo_runtime/boards/nucleo_f746zg.conf
##########
@@ -15,16 +15,14 @@
# specific language governing permissions and limitations
# under the License.
#
-# This file is specific to the nRF5340 DK board.
+# This file is specific to the STM32F746 Nucleo board.
# For intrinsics used by generated optimized operators.
CONFIG_CMSIS_DSP=y
-# Required for Cortex-M33 devices.
-CONFIG_MAIN_STACK_SIZE=50
-
# For random number generation.
CONFIG_ENTROPY_GENERATOR=y
+CONFIG_TEST_RANDOM_GENERATOR=y
Review comment:
I have tested this on Nucleo board on reference VM with zephyr 2.4 without this flag. Maybe you're using a different zephyr version?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] mehrdadh commented on a change in pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on a change in pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#discussion_r604308426
##########
File path: tutorials/micro/micro_tflite.py
##########
@@ -224,7 +224,7 @@
# from tvm.micro.contrib import zephyr
#
# repo_root = subprocess.check_output(["git", "rev-parse", "--show-toplevel"], encoding='utf-8').strip()
-# project_dir = f"{repo_root}/tests/micro/qemu/zephyr-runtime"
+# project_dir = f"{repo_root}/apps/microtvm/zephyr/demo_runtime"
Review comment:
nit: could you please use os.path.join(repo_root, "apps", "microtvm", ...) instead?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
gromero commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-813714470
@mehrdadh @mdw-octoml @areusch Hi folks, Finally the CI is happy with my changes plus it didn't give up testing it and completed fine :) Could I get reviews for that new version, please?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] areusch commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-811250622
@gromero yeah
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
gromero commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-814473913
Thanks @areusch !
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on pull request #7772: [µTMV] apps: Fix Zephyr code example for STM32F746 boards
Posted by GitBox <gi...@apache.org>.
gromero commented on pull request #7772:
URL: https://github.com/apache/tvm/pull/7772#issuecomment-810572979
> Can you clarify which version of zephyr are you using? And are you testing on reference VM?
@mehrdadh I'm building against Zephyr 2.4.0. I'm not testing on the reference VM, rather I'm testing on the physical discovery board and running `micro_tflite.py` script set for the disco board.
I think we need to improve the CI somehow because commit `c39a6e2` from Matt in fact fixed, by its turn, other issues that passed unnoticed, like the one regarding the change from `context` to `device`. I'm in the TVM #micro channel in tlcpack Slack, so maybe we can chat more about it there.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org