-
Notifications
You must be signed in to change notification settings - Fork 99
Dynamic App Loader Helper #387
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
base: master
Are you sure you want to change the base?
Conversation
examples/tests/app_loader/main.c
Outdated
} | ||
|
||
for (uint32_t offset = 0; offset < write_count; offset++) { | ||
memcpy(write_buffer, &app_binary[FLASH_BUFFER_SIZE * offset], FLASH_BUFFER_SIZE); // copy binary to write buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if app_binary
isn't a multiple of FLASH_BUFFER_SIZE
?
42b0c51
to
f653234
Compare
Can you rebase this on master and
|
I believe the repo was already rebased on master last time i pushed it.
Done. I also renamed the functions to start with libtock_ to keep in line with the other the new libtock format.
Done |
ok, given the kernel part is now merged, i will leave this comment here: I am all for removing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have one interactive app meant for trying out DPL, eg button-press-loading. The others should be more friendly for CI (ie not require user input). I think the abort test should be able to run and test abort without requiring a user to get the button timing right.
I also think we should come up with a folder and more general structure for storing the .tbf binaries. We should also make it clear the binaries are cortex-m4 binaries. They should match what tockloader generates.
Okay, I agree with that |
Okay, so I gave it some thought and the way I have it working right now is to move the binaries to a different directory and create a symlink so the The structure looks like this right now:
|
These pushes only address the directory structure changes and not the ci-ease concern that was raised. That will come with a separate commit |
The current directory structure looks like this:
The binaries match the ones generated by tockloader. I pulled from the examples in the repo for For the abort-test, the user can press the button whenever, and it'll still abort. I've tested it multiple times, the NonvolatileStorage driver is just fast. However, I've changed the interface so that the app is listening for a console command instead of a button press. Essentially, the characters '0', '1', or '2' load a different app based on the command. This should eliminate those pesky debounce issues and whatnot. Plus it is easy to expand this anyway regardless of the board button support capabilities, while introducing the undefined behavior when multiple apps are listening however. I have absolutely no idea why the ci-format failed on print statements labeled error only in |
I wonder, should I get rid of the other two apps and just have it run the adc + abort alone? While still requiring console input to make sure it does not just trigger on boot. |
Why does the abort test need to be interactive at all? It is simpler and easier to run if all you have to do is install it and see if it prints success or not. You could add a timer (potentially with some random delay) if you want to not run immediately at boot or randomize when the abort signal happens. |
…ls to match naming conventions
(will break app name parsing, non-obvious to debug)
…ge pushd to cd to account for debian distros
Ok the build failures come from me updating the libtock files, but they are not updated for the tutorial code. i wanted to do it in a separate pr |
updated the tutorial code, passes build now |
return ret; | ||
} | ||
|
||
yield_for(&write_done); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't call yield in libtock
(async only)`.
#define BUTTON1 0 | ||
#define BUTTON2 1 | ||
#define BUTTON3 2 | ||
returncode_t libtock_app_loader_setup(uint32_t app_length, subscribe_upcall cb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The callback needs to be customized to this driver.
returncode_t libtock_app_loader_set_setup_upcall(subscribe_upcall cb, void* userdata); | ||
returncode_t libtock_app_loader_set_write_upcall(subscribe_upcall cb, void* userdata); | ||
returncode_t libtock_app_loader_set_finalize_upcall(subscribe_upcall cb, void* userdata); | ||
returncode_t libtock_app_loader_set_load_upcall(subscribe_upcall cb, void* userdata); | ||
returncode_t libtock_app_loader_set_abort_upcall(subscribe_upcall cb, void* userdata); | ||
returncode_t libtock_app_loader_set_uninstall_upcall(subscribe_upcall cb, void* userdata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function docs should be in the .h file and not in the .c file.
This PR introduces the helper app to validate the kernel's dynamic process loading functionality (tock/tock#3941). The helper app triggers the dynamic process loading with a button press.
This application is located in
/examples/tests/app_loader
and was tested on the nRF52840DK. A previous version of the dynamic process loader was tested with the same application on an Imix board as well.