Closed twilfredo closed 1 year ago
There is a mismatch between the address ranges the app was compiled for and the address ranges supported by the kernel you are running. The reason this works with libtock-c is because libtock-c apps support PIC (note that all 3 boards you listed are ARM-based), and can therefore be placed at any address.
The address ranges that libtock-rs
uses by default are defined in libtock_build_scripts::PLATFORMS
. Check the address range for the value of LIBTOCK_PLATFORM
you used against the kernel image you're using; I suspect a mismatch there.
Unfortunately the address ranges for apps can change with kernel version (as the kernel itself grows and shrinks), so you may end up needing to manually pass the address ranges via environment variables. Check the comments in the file I linked above for instructions.
Thanks! that was it, sent a PR that fixes this for the nrf52840 based boards.
I can get a single app to work. But not more than one at a time, even if they are manually compiled for the next available flash address and loaded (with tockloader) they will not execute. See below, only blink is running.
[INFO ] Using settings from KNOWN_BOARDS["nrf52dk"]
[STATUS ] Installing app on the board...
[INFO ] Found sort order:
[INFO ] App "blink" at Flash=0x40080
[INFO ] App "console" at Flash=0x42080
[INFO ] App Layout:
[INFO ] 0x40000┬──────────────────────────────────────────────────┐
[INFO ] │App: blink [Installed]│
[INFO ] │ Length: 8192 (0x2000) │
[INFO ] 0x42000┼──────────────────────────────────────────────────┤
[INFO ] │App: console [From TAB]│
[INFO ] │ Length: 8192 (0x2000) │
[INFO ] 0x44000┴──────────────────────────────────────────────────┘
[INFO ] Finished in 3.787 seconds
I did see https://github.com/tock/libtock-rs/issues/28 is there any progress on this? What still needs to be done?
Woops, Turns out I had to change the RAM address too to, suppose there was an overlap but silently failed...should this not be caught somewhere? I have multiple apps working now.
[INFO ] Using settings from KNOWN_BOARDS["nrf52dk"]
[STATUS ] Installing app on the board...
[INFO ] Found sort order:
[INFO ] App "blink" at Flash=0x40080
[INFO ] App "console" at Flash=0x42080
[INFO ] App "buttons" at Flash=0x44080
[INFO ] App Layout:
[INFO ] 0x40000┬──────────────────────────────────────────────────┐
[INFO ] │App: blink [Installed]│
[INFO ] │ Length: 8192 (0x2000) │
[INFO ] 0x42000┼──────────────────────────────────────────────────┤
[INFO ] │App: console [Installed]│
[INFO ] │ Length: 8192 (0x2000) │
[INFO ] 0x44000┼──────────────────────────────────────────────────┤
[INFO ] │App: buttons [From TAB]│
[INFO ] │ Length: 16384 (0x4000) │
[INFO ] 0x48000┴──────────────────────────────────────────────────┘
[INFO ] Finished in 5.260 seconds
Serial
Particle Boron: Initialization complete. Entering main loop
button count: Hello world!
1
Particle Boron: Initialization complete. Entering main loop
button count: Hello world!
1
tock$ button 0: Pressed
button 0: Released
button 0: Pressed
button 0: Released
Issue
When loading the example apps (blink, console etc...) from libtock-rs with tockloader. I see the following error. The particular error below is for the gpio example from libtock-rs loading into the
nano33ble
, so built withnrf52840
platform withmake nrf52840 EXAMPLE=gpio
. Thentockloader install
. The nanoble33 was in bootloader mode prior to running the below command, I tried without this aswell...same issue.I have tried on 3 different nRF boards, nrf52DK/Particle Boron/Nano33BLE. What's likely the culprit here?
Note that libtock-c apps seems to work as intended, I have been manually loading them with
tockloader install *.tab
for thenano33ble
, and the app being loaded with the process console/tockloader.