-
Notifications
You must be signed in to change notification settings - Fork 43
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
hello_timer wrong printf output #35
Comments
Hmm... so the emulator doesn't print the numbers correctly? I suspect it may have to do with the integer divider that we still haven't implemented. Can you check if there are any writes to SIO addresses at 0xd0000060 or 0xd0000068 ? |
correct, a lot of missing sio warnings, I didn't see anything to 68 but 60 there are, a lot. |
Thanks for attaching the logs! These are SIO reads (and not writes) but I can see some reads come from the integer divider area:
70 is DIV_QUOTIENT, I guess One workaround may be to disable the hardware divider. There's probably a way to tell them compiler not to use the hardware divider, I'll try to google that / look into the SDK sources |
I think this is the code is the build system which enables the hardware divider: So maybe adding
to the project's CMakeLists.txt will do the trick? |
Also adds an helper console log when a pin is set/reset close wokwi#35
As it seemed not so complicated (for sure i introduced bugs, no doubt on this) I implemented the hardware divider and , as usual, You were right: the printf output is now correct |
You implemented the hardware divider? Cool! I'll check the pull request soon. |
running hello_timer.hex from pico examples result in this output:
while on a real pico it prints:
Investigating with gdbdiff it looks like at some point the silicone runs code from bootrom and the emulator gets mad.
As far as I've seen it seems it does not properly handle the 16bit instructions when the memory address is in the bootrom memory.
on the silicone set a breakpoint at 0x10000416 (line 45 of hello_timer.c) then after roughly 70ish si it goes to bootrom memory area.
I tried this test, it actually use LSLS instruction instead of BL because not able to read/write properly at bootrom addresses:
The text was updated successfully, but these errors were encountered: