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

SDK • Re: Acccessing Flash from 'Run from RAM' code

$
0
0
The Unique ID on RP2350 does not come from flash - it is the Unique ID of the actual RP2350 chip
Thanks. It would IMO be worth mentioning that in 4.2.12.1 of the Pico SDK datasheet, and perhaps elsewhere, as that describes RP2040 but is completely silent on RP235X.

4.2.12.3.2 explicitly says in two places "get the unique 64-bit device identifier which was retrieved from the external NOR flash device at boot" which led to thinking it was the same on RP235X.
The bootrom will only set up flash on RP2350 when performing a Flash Boot. When you drag & drop a default no_flash UF2, it will load that into SRAM and perform a RAM Image Boot (see 5.2.5 in the datasheet), so will not set up flash.
That makes sense and I guess I had misinterpreted what I had read. I'll go and re-read, see if I can spot anything which may have misled me, or confirm it simply was my misinterpretation or misunderstanding.
To set up flash on RP2350 you can just call the four ROM functions in that example, and the bootrom should set it all up correctly.
Excellent - I'll let you know how I get on.

This is my universal 'Identify Chip' code, a single 'main.c' which should compile for, and run on, every chip type, report exactly what it is. That was easy enough for the RP2040 but now has to embrace all the RP235X variants. That of course means it has to leap the hurdles where things are different on each, or where the Pico SDK functions behave differently.

It's a worse case test for what is different for each, helps build an understanding of that. Most won't encounter such challenges in their code but it's always good to know the answer and solution when they do. Thanks again for the guidance.

Statistics: Posted by hippy — Mon Nov 04, 2024 3:33 pm



Viewing all articles
Browse latest Browse all 4863

Trending Articles