Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 9626

SDK • Re: RP235X Address Translation query

$
0
0
You can use the `flash_op()` bootrom API to read/write/erase flash using untranslated addresses (or it can do translated addresses,
Can you give me a pointer where that's described and examples on how to use it ?
It is in the bootrom section of the RP2350 datasheet (in the list of bootrom functions) - it is also in bootrom.h in the SDK as rom_flash_op and thus should be in the SDK docs. The datasheet docs are not super helpful it seems so i will update them for the next release
Would I need to edit the Bluetooth stack to prevent that crashing when it reads from and writes to the last two sectors of Flash ?
Nope, this code still works - it accesses the memory via ROM flash functions (the older versions like `flash_program` and `flash_erase`) which work with untranslated addresses.

TLDR it is only the memory mapped stuff that is affected by address translation
see CFLASH_ASPACE_)
Where's that at ?
Its in bootrom_constants.h; i assumed you could/would just search for it
Of course you may want to read from the XIP directly.
I may but I have no idea if I'd want to or not. Would that be the best way ? How would I decide ?
This is what your sample code is trying to do (and probably what you want)
You can either remap one of the other 4M regions to point at it - the bootrom will have made region starting at 0x10400000 sized 0 if the image isn't >4M big.
Can you give me a pointer where that's described and some example on how to do that ?
The registers are described in the datasheet - the "what the bootrom would have done" i'll make clearer in the updated docs. Not sure that there is an example
Or you can use the #define XIP_NOCACHE_NOALLOC_NOTRANSLATE_BASE _u(0x1c000000) to read untranslated memory without use of the windows from secure code (though it won't be cached)
Where would I put that, and how do I use it ? Is there an example ?

Code:

#define BOT_ADDRESS     0x10200000 // Top 2 MB of 4 MB Flash#define TOP_ADDRESS     0x103FFFFC
If you or someone could update that so it does read the locations specified without hanging that's probably enough to move on.

Code:

// use untranslated window starting at 0x1C000000#define BOT_ADDRESS     0x1C200000 // Top 2 MB of 4 MB Flash#define TOP_ADDRESS     0x1C3FFFFC
How's integrating file system support with the Pico SDK coming along ? I presume that will work with RP2040, RP235X partitioned and non-partitioned, will do what I am after ?
it will

Statistics: Posted by kilograham — Fri May 02, 2025 4:53 pm



Viewing all articles
Browse latest Browse all 9626

Trending Articles