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

readFirmware() can fail unexpectedly on the ARM9 #251

Open
AntonioND opened this issue Jan 2, 2025 · 0 comments
Open

readFirmware() can fail unexpectedly on the ARM9 #251

AntonioND opened this issue Jan 2, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@AntonioND
Copy link
Member

readFirmware() on the ARM9 works by asking the ARM7 to read the firmware and save the result to a pointer passed by the ARM9. If this pointer is in DTCM (for example, if there is an array in the stack) this will fail because the ARM7 can't see DTCM.

There are two options:

  1. We can document this limitation and add an sassert() to the code:

https://github.com/blocksds/libnds/blob/3e300238523fa5ca8560fdcb76dabce32d10170a/source/arm9/storage/firmware.c#L11

  1. We could also use malloc() to obtain temporary storage that the ARM7 can see, then copy the data to the final destination in DTCM.
@AntonioND AntonioND added the bug Something isn't working label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant