Skip to content

Conversation

@mdw-octoml
Copy link
Contributor

This PR makes a few changes to make the structure of the uTVM code more user-friendly:

  • Migrates the Zephyr runtime code from tests/micro/qemu/zephyr-runtime to apps/microtvm/zephyr/demo_runtime
    (to indicate that this runtime is more generally useful, but still intended as a "demo")
  • Makes board-specific prj.conf files for the demo_runtime, to allow different options to be configured for qemu_x86 and nrf5340 (for example).
  • Adds a test to test_zephyr.py which converts and tests an ONNX MNIST model
  • Adds a tutorial using the same ONNX MNIST model
  • Adds some more README files to explain the purpose of each dir

- Use `west attach` instead of `west debug` in commandline to prevent
  debugger from resetting device.

- Fix warning on use of led_pin in zephyr-runtime/src/main.c.
Need to add board-specific prj.conf files.
Added test_onnx unit test.

Still need to clean up tutorial.
- Use `west attach` instead of `west debug` in commandline to prevent
  debugger from resetting device.

- Fix warning on use of led_pin in zephyr-runtime/src/main.c.
Need to add board-specific prj.conf files.
Added test_onnx unit test.

Still need to clean up tutorial.
Added test_onnx unit test.

Still need to clean up tutorial.
@mdw-octoml
Copy link
Contributor Author

@areusch @mehrdadh

@areusch
Copy link
Contributor

areusch commented Mar 1, 2021

@mdw-octoml I think we had made exceptions for these file paths before. can you update tests/lint/check_file_type.py? I don't know about the jpg files, @tqchen could comment more. they are also 500 bytes, so I don't think it's a big deal to check them in aside from setting precedent of checking-in test data.

@areusch
Copy link
Contributor

areusch commented Mar 26, 2021

@mdw-octoml I commented in a resolved thread expecting it to re-open, but unsure if it did. please take a look at that one referenced in my latest review.

@areusch
Copy link
Contributor

areusch commented Mar 26, 2021

Filed zephyrproject-rtos/zephyr#33745 to track the underlying Zephyr issue

@mdw-octoml
Copy link
Contributor Author

@areusch Okay, I finally got CI to pass on this. Had to remove the tutorial for now (which I will add back later) since I can't yet figure out how to get it to run under CI. Can I haz approval?

@areusch areusch merged commit c39a6e2 into apache:main Mar 29, 2021
@areusch
Copy link
Contributor

areusch commented Mar 29, 2021

thanks @mdw-octoml the PR is now merged!

gromero added a commit to gromero/tvm that referenced this pull request Mar 30, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 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 c39a6e2 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 <gustavo.romero@linaro.org>
gromero added a commit to gromero/tvm that referenced this pull request Mar 30, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 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 c39a6e2 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 <gustavo.romero@linaro.org>
gromero added a commit to gromero/tvm that referenced this pull request Mar 30, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 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 c39a6e2 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 <gustavo.romero@linaro.org>
gromero added a commit to gromero/tvm that referenced this pull request Mar 31, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 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 reduces the UART ring buffer size to ~3K,
otherwise the new value introduced by commit c39a6e2 (4K) makes noinit
section not fit into the SRAM region on the STM32F746-based boards, so
linkage fails with the following error:

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

The size of ~3K was determined experimentally, so whilst it passes all
the microTVM tests using the reference VM it can also produce a firmware
that fits into the STM32F746-based boards, however there is currently a
trade-off between the size of the model to be transfered to the device
and the maximum SRAM available on the target device.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
gromero added a commit to gromero/tvm that referenced this pull request Apr 1, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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 reduces the UART ring buffer size to ~3K,
otherwise the new value introduced by commit c39a6e2 (4K) makes noinit
section not fit into the SRAM region on the STM32F746-based boards, so
linkage fails with the following error:

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

The size of ~3K was determined experimentally, so whilst it passes all
the microTVM tests using the reference VM it can also produce a firmware
that fits into the STM32F746-based boards, however there is currently a
trade-off between the size of the model to be transfered to the device
and the maximum SRAM available on the target device. Also, the size of
'uart_data' temporary buffer is reduced a bit (to 8 bytes) to free some
additional bytes in SRAM, since most MCUs have a 1-byte FIFO, like it
happens with Cortex-M MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
gromero added a commit to gromero/tvm that referenced this pull request Apr 1, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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'

This commit reduces the UART ring buffer size to ~3K, because the new
value introduced by commit c39a6e2 (4K) makes noinit section not fit
into the SRAM region on the STM32F746-based boards, so linkage fails
with the following error:

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

The size of ~3K was determined experimentally, so whilst it passes all
the microTVM tests using the reference VM it can also produce a firmware
that fits into the STM32F746-based boards, however there is currently a
trade-off between the size of the model to be transfered to the device
and the maximum SRAM available on the target device.

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
gromero added a commit to gromero/tvm that referenced this pull request Apr 2, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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'

This commit reduces the UART ring buffer size to ~3K, because the new
value introduced by commit c39a6e2 (4K) makes noinit section not fit
into the SRAM region on the STM32F746-based boards, so linkage fails
with the following error:

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

The size of ~3K was determined experimentally, so whilst it passes all
the microTVM tests using the reference VM it also produces a firmware
that fits into the STM32F746-based boards. Since it's a demo, that value
is ok, however it needs to be evaluated carefully on real cases.

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
gromero added a commit to gromero/tvm that referenced this pull request Apr 5, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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 CONFIG_TEST_RANDOM_GENERATOR=y
is set, otherwise when CONFIG_ENTROPY_GENERATOR=y linking will fail
with the following error:

rand32.h:33: undefined reference to `z_impl_sys_rand32_get'

This commit also reduces the UART ring buffer size to ~3K, because the
new value introduced by commit c39a6e2 (4K) makes noinit section not
fit into the SRAM region on the STM32F746-based boards, so linkage fails
with the following error:

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

The size of ~3K was determined experimentally, so whilst it passes all
the microTVM tests using the reference VM it also produces a firmware
that fits into the STM32F746-based boards. Since it's a demo, that value
is ok, however it needs to be evaluated carefully on real cases.

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M-based MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
gromero added a commit to gromero/tvm that referenced this pull request Apr 5, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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 CONFIG_TEST_RANDOM_GENERATOR=y
is set, otherwise when CONFIG_ENTROPY_GENERATOR=y linking will fail
with the following error:

rand32.h:33: undefined reference to `z_impl_sys_rand32_get'

This commit also reduces the UART ring buffer size to ~3K, because the
new value introduced (4K) makes noinit section not fit into the SRAM
region on the STM32F746-based boards, so linkage fails with the
following error:

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

The size of ~3K was determined experimentally, so whilst it passes all
the microTVM tests using the reference VM it also produces a firmware
that fits into the STM32F746-based boards. Since it's a demo, that value
is ok, however it needs to be evaluated carefully on real cases.

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M-based MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
gromero added a commit to gromero/tvm that referenced this pull request Apr 5, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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 CONFIG_TEST_RANDOM_GENERATOR=y
is set, otherwise when CONFIG_ENTROPY_GENERATOR=y linking will fail
with the following error:

rand32.h:33: undefined reference to `z_impl_sys_rand32_get'

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M-based MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
areusch pushed a commit that referenced this pull request Apr 6, 2021
Commit c39a6e2 "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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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 CONFIG_TEST_RANDOM_GENERATOR=y
is set, otherwise when CONFIG_ENTROPY_GENERATOR=y linking will fail
with the following error:

rand32.h:33: undefined reference to `z_impl_sys_rand32_get'

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M-based MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…7557)

* Some docstring fixes.

* Couple of small fixes:

- Use `west attach` instead of `west debug` in commandline to prevent
  debugger from resetting device.

- Fix warning on use of led_pin in zephyr-runtime/src/main.c.

* Adding Zephyr demo runtime.

* Cleanup of uTVM tests and demo runtime.

* Working on QEMU support.

Need to add board-specific prj.conf files.

* Adding board-specific prj.conf files.

* Some cleanup.

* Lots of hacking to get ONNX model to run on QEMU and nRF5340.

Added test_onnx unit test.

Still need to clean up tutorial.

* Adding data for unit tests.

* Cleanup demo_runtime code.

* Fix up tutorial.

* Couple of small fixes:

- Use `west attach` instead of `west debug` in commandline to prevent
  debugger from resetting device.

- Fix warning on use of led_pin in zephyr-runtime/src/main.c.

* Adding Zephyr demo runtime.

* Cleanup of uTVM tests and demo runtime.

* Working on QEMU support.

Need to add board-specific prj.conf files.

* Adding board-specific prj.conf files.

* Some cleanup.

* Lots of hacking to get ONNX model to run on QEMU and nRF5340.

Added test_onnx unit test.

Still need to clean up tutorial.

* Lots of hacking to get ONNX model to run on QEMU and nRF5340.

Added test_onnx unit test.

Still need to clean up tutorial.

* Adding data for unit tests.

* Cleanup demo_runtime code.

* Fix up tutorial.

* Fix tutorial.

* Fix tutorial and runtime.

* Fix merge conflicts.

* Fix merge conflict.

* Remove redundant files.

* Revert dep.

* Fixup

* Add new files to check_file_type.py.

* Adding missing ONNX file.

* Fixup docs.

* Fix linting rule.

* small fixes

* Add missing file to check_file_type.py.

* clang-format this file.

* Fix formatting.

* Black formatting.

* Lint comments.

* Fix path for test.

* Bump CI.

* Update from_onnx.

* fix path

* Fixing

* Revert dmlc-core to 21cc7de0dc9fd6acb796e1be6181fa8e6b6c8f41

* Fix path again.

* Fix tutorial to not use actual Zephyr.

* Revert submodule version change

* Fix bad merge.

* Trying to fix this mess.

* Fix formatting.

* context -> device

* Removing tutorial since I can't get it to pass CI.

Co-authored-by: Mehrdad Hessar <mehrdad.hessar@gmail.com>
Co-authored-by: Andrew Reusch <areusch@octoml.ai>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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 CONFIG_TEST_RANDOM_GENERATOR=y
is set, otherwise when CONFIG_ENTROPY_GENERATOR=y linking will fail
with the following error:

rand32.h:33: undefined reference to `z_impl_sys_rand32_get'

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M-based MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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 CONFIG_TEST_RANDOM_GENERATOR=y
is set, otherwise when CONFIG_ENTROPY_GENERATOR=y linking will fail
with the following error:

rand32.h:33: undefined reference to `z_impl_sys_rand32_get'

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M-based MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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 CONFIG_TEST_RANDOM_GENERATOR=y
is set, otherwise when CONFIG_ENTROPY_GENERATOR=y linking will fail
with the following error:

rand32.h:33: undefined reference to `z_impl_sys_rand32_get'

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M-based MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
…7557)

* Some docstring fixes.

* Couple of small fixes:

- Use `west attach` instead of `west debug` in commandline to prevent
  debugger from resetting device.

- Fix warning on use of led_pin in zephyr-runtime/src/main.c.

* Adding Zephyr demo runtime.

* Cleanup of uTVM tests and demo runtime.

* Working on QEMU support.

Need to add board-specific prj.conf files.

* Adding board-specific prj.conf files.

* Some cleanup.

* Lots of hacking to get ONNX model to run on QEMU and nRF5340.

Added test_onnx unit test.

Still need to clean up tutorial.

* Adding data for unit tests.

* Cleanup demo_runtime code.

* Fix up tutorial.

* Couple of small fixes:

- Use `west attach` instead of `west debug` in commandline to prevent
  debugger from resetting device.

- Fix warning on use of led_pin in zephyr-runtime/src/main.c.

* Adding Zephyr demo runtime.

* Cleanup of uTVM tests and demo runtime.

* Working on QEMU support.

Need to add board-specific prj.conf files.

* Adding board-specific prj.conf files.

* Some cleanup.

* Lots of hacking to get ONNX model to run on QEMU and nRF5340.

Added test_onnx unit test.

Still need to clean up tutorial.

* Lots of hacking to get ONNX model to run on QEMU and nRF5340.

Added test_onnx unit test.

Still need to clean up tutorial.

* Adding data for unit tests.

* Cleanup demo_runtime code.

* Fix up tutorial.

* Fix tutorial.

* Fix tutorial and runtime.

* Fix merge conflicts.

* Fix merge conflict.

* Remove redundant files.

* Revert dep.

* Fixup

* Add new files to check_file_type.py.

* Adding missing ONNX file.

* Fixup docs.

* Fix linting rule.

* small fixes

* Add missing file to check_file_type.py.

* clang-format this file.

* Fix formatting.

* Black formatting.

* Lint comments.

* Fix path for test.

* Bump CI.

* Update from_onnx.

* fix path

* Fixing

* Revert dmlc-core to 21cc7de0dc9fd6acb796e1be6181fa8e6b6c8f41

* Fix path again.

* Fix tutorial to not use actual Zephyr.

* Revert submodule version change

* Fix bad merge.

* Trying to fix this mess.

* Fix formatting.

* context -> device

* Removing tutorial since I can't get it to pass CI.

Co-authored-by: Mehrdad Hessar <mehrdad.hessar@gmail.com>
Co-authored-by: Andrew Reusch <areusch@octoml.ai>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
Commit c39a6e2 "Clean up uTVM demo runtime, add ONNX model test and
tutorial (apache#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 c39a6e2 also split Zephyr configuration per boards,
under project's boards/, this commit 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 CONFIG_TEST_RANDOM_GENERATOR=y
is set, otherwise when CONFIG_ENTROPY_GENERATOR=y linking will fail
with the following error:

rand32.h:33: undefined reference to `z_impl_sys_rand32_get'

Finally, the size of 'uart_data' temporary buffer is reduced a bit (to
8 bytes) to free some additional bytes in SRAM, since most MCUs have a
1-byte FIFO, like it happens with Cortex-M-based MCUs.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
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