-
Notifications
You must be signed in to change notification settings - Fork 99
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
Unable to modify memory from Peripheral handlers #103
Comments
Heya, Thanks for opening the issue! Unfortunately, without a complete example to run as a test case, it's somewhat hard to reproduce, especially as we don't know your target setup. Either way, from my gut feeling, I think the following is happening:
To move forward, I see 3 ways: In any case, pretty cool project, so far we haven't worked on flash controller emulation! |
Thanks for the quick reply :) I already tested b), but no luck (my Peripheral code stop being executed after I launch qemu.stop()). I am now looking at solution a), but I get a segfault this time (apparently after reaching SVC 0). Also using this target (and Panda target as well), a dummy UART peripheral is not working properly: an interrupt should be triggered from the firmware code by writing in a Cortex-M3 specific address (0xe000ef00). I can see instructions corresponding to the write at this address, but I notice no interruption (but this was working as expected with QemuTarget)... The firmware is suppose to set its own interrupt table using one of these Cortex-M specific address, maybe this could explain the crash. Any gut feeling on this issue? :) For information, I am using the Dockerfile and the version 1.4.7. |
Regarding b: did you also try with The interrupt issue is very likely because on the stock configurable machine, we do not initialize the interrupt controller - which would be in-line with segfaulting for SVC 0, as this should trigger in interrupt? For the time being our solution was to always "hack-in" the irq controller by checking against the cpu model, as we did for instance here for pretender or here for FirmWire. For the time being, can you add an according hack to Panda and try building it? It may fix the interrupt/svc issue. |
Thank you again for the assistance. Using
As for the irq hack, thanks for pointing it out, I didn't know about it. I will see if it is not too difficult to do it for Panda. |
Sorry, I had a typo, it should've been |
Sorry, I copied your typo here, but I used |
Hi,
I am trying to make a dummy flash controller for an ARM cortex-m3 based MCU that I emulate with QEMU. The goal is to retrieve the different parameters (address, value, size) and then modify the corresponding memory region that I allocated using avatar.add_memory_range(). I took inspiration from the example in the repo avatar2/avatar2_example so I made read and write handlers in which I perform the different actions depending on the offset and the values.
My problem is that when I use qemu.write_memory() in my controller read/write handlers, nothing happens. I can read the memory afterwards and I notice no changes. However, when I modify the memory using the same API after I reach a breakpoint, the memory is modified as expected.
Any idea how I could achieve these memory modifications in my controller?
Here is an extract of my code:
Thanks
The text was updated successfully, but these errors were encountered: