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

[microTVM] Update Zephyr 2.5 #7786

Merged
merged 22 commits into from
Apr 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update to zephyr 2.5
  • Loading branch information
areusch committed Mar 31, 2021
commit 0e5b51bc2a83345a243d9f1e5b9ef99243af1f97
10 changes: 5 additions & 5 deletions apps/microtvm/reference-vm/zephyr/base-box/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ pip3 install --user -U west
echo 'export PATH=$HOME/.local/bin:"$PATH"' >> ~/.profile
source ~/.profile
echo PATH=$PATH
west init --mr v2.4.0 ~/zephyr
west init --mr v2.5.0 ~/zephyr
cd ~/zephyr
west update
west zephyr-export

cd ~
echo "Downloading zephyr SDK..."
wget --no-verbose https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.11.3/zephyr-sdk-0.11.3-setup.run
chmod +x zephyr-sdk-0.11.3-setup.run
./zephyr-sdk-0.11.3-setup.run -- -d ~/zephyr-sdk -y
rm -rf zephyr-sdk-0.11.3-setup.run
wget --no-verbose https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.12.3/zephyr-sdk-0.12.3-x86_64-linux-setup.run
chmod +x zephyr-sdk-0.12.3-x86_64-linux-setup.run
./zephyr-sdk-0.12.3-x86_64-linux-setup.run -- -d ~/zephyr-sdk -y
rm -rf zephyr-sdk-0.12.3-x86_64-linux-setup.run

# GDB for Zephyr SDK depends on python3.8
sudo add-apt-repository ppa:deadsnakes/ppa
Expand Down
8 changes: 4 additions & 4 deletions apps/microtvm/zephyr/demo_runtime/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,18 @@ tvm_crt_error_t TVMPlatformGenerateRandom(uint8_t* buffer, size_t num_bytes) {
return kTvmErrorNoError;
}

// Memory pool for use by TVMPlatformMemoryAllocate.
K_MEM_POOL_DEFINE(tvm_memory_pool, 64, 1024, 216, 4);
// Heap for use by TVMPlatformMemoryAllocate.
K_HEAP_DEFINE(tvm_heap, 216 * 1024);

// Called by TVM to allocate memory.
tvm_crt_error_t TVMPlatformMemoryAllocate(size_t num_bytes, DLDevice dev, void** out_ptr) {
*out_ptr = k_mem_pool_malloc(&tvm_memory_pool, num_bytes);
*out_ptr = k_heap_aligned_alloc(&tvm_heap, sizeof(int), num_bytes, K_NO_WAIT);
return (*out_ptr == NULL) ? kTvmErrorPlatformNoMemory : kTvmErrorNoError;
}

// Called by TVM to deallocate memory.
tvm_crt_error_t TVMPlatformMemoryFree(void* ptr, DLDevice dev) {
k_free(ptr);
k_heap_free(&tvm_heap, ptr);
return kTvmErrorNoError;
}

Expand Down