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

Loading flash at address 0x0ABCD000 causes example to hang #2

Open
mundaym opened this issue Aug 9, 2021 · 1 comment
Open

Loading flash at address 0x0ABCD000 causes example to hang #2

mundaym opened this issue Aug 9, 2021 · 1 comment

Comments

@mundaym
Copy link
Contributor

mundaym commented Aug 9, 2021

Applying this patch causes the example to hang:

diff --git a/kernel.c b/kernel.c
index be748fd..07da912 100644
--- a/kernel.c
+++ b/kernel.c
@@ -18,7 +18,7 @@ int start() {
     // (0 - 0x2000) are reserved by spike and the third page contains the
     // host-target interface symbols defined in the kernel (0x2000, 0x2008).
     uint32_t sram_addr = 0x12340000;
-    uint32_t flash_addr = 0x81234000;
+    uint32_t flash_addr = 0x0ABCD000;
 
     const void* elf_data = cm; // App to load.
 

It may just be that this causes two memory regions to overlap but by my calculations there is enough space.

@luismarques
Copy link
Collaborator

The flash address must have the MSBit set (i.e. (flash_addr & SENTINEL) != 0). I'll make that clearer in the documentation and code comments, and add an assertion. It's properly documented in tock.c, but it's not obvious if you don't look there or aren't familiar with the Tock loader. Thanks!

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

No branches or pull requests

2 participants