Re: RP2040 reset idea

Liste des GroupesRevenir à cs raspberry-pi 
Sujet : Re: RP2040 reset idea
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : comp.sys.raspberry-pi sci.electronics.design
Date : 22. Sep 2024, 09:37:34
Autres entêtes
Organisation : A little, after lunch
Message-ID : <vcol0e$24ol2$7@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 22/09/2024 04:08, Dave Platt wrote:
In article <vclv4m$1he37$2@dont-email.me>,
The Natural Philosopher  <tnp@invalid.invalid> wrote:
It gets nastier if you want to preserve config info across reboots.
It is possible to read and write areas of flash from the code, but its
no picnic.
 True.  From what I read in the SDK, it appears that the second core
has to be halted temporarily (pushed into a loop running only in SRAM),
and the core doing the erase/flash also has to be running out of SRAM.
Neither can be doing XIP during the flashing, as things will go FOOM
if they are.
 
And it gets wiped when new code is uploaded
 That may be true of the drag-and-drop-a-UF2-file method.
 It's not necessarily true if you use the "picotool" app to
speak directly to the ROM bootloader code.
 A little RP2040 (RPi Pico) app I've been working on, uses the
last 32k or so of flash as a bank of "saved parameter" regions,
with version/revision numbers.  My app fits down in the bottom
200k of flash, so there's no collision between the two.
 I've reflashed the proto with new versions of the app dozens
of times, and the saved-parameter data has survived each
time.  Apparently, picotool and the bootloader are smart enough
to do a selective erase of only the amount of area needed for
the new version of the app code.
That I didnt know.
And is very useful information.

 Oh... possible hint for Linux users.  If you're planning to use
the bootloader mass-storage "copy a UF2 image to the device to
re-flash it", you may need to take steps to ensure that the
blocks in the image are actually written to the device in the
same order they're present in the image file.  This isn't
necessarily guaranteed to Linux due to the presence of the
general-purpose block cache and I/O scheduler... the file
blocks might be "pushed" over USB in an arbitrary order.
I've had inconsistent results just doing the simple "mount,
drag-and-drop" process using the desktop file manager.
 Possible workaround 1: manually mount the device on a filesystem,
using the "-o sync" option, then drag-and-drop.
 Possible workaround 2: mount, then
    dd if=foo.uf2 of=/mnt/foo.uf2 oconv=direct
to bypass the cache.
 
Not had any issues simply drag and dropping to an auto mounted image
UF2 images are over 600k.
--
Climate Change: Socialism wearing a lab coat.

Date Sujet#  Auteur
17 Sep 24 * RP2040 reset idea36john larkin
17 Sep 24 +* Re: RP2040 reset idea2Sylvia Else
17 Sep 24 i`- Re: RP2040 reset idea1john larkin
17 Sep 24 +* Re: RP2040 reset idea29The Natural Philosopher
17 Sep 24 i+- Re: RP2040 reset idea1john larkin
17 Sep 24 i`* Re: RP2040 reset idea27john larkin
17 Sep 24 i `* Re: RP2040 reset idea26The Natural Philosopher
18 Sep 24 i  `* Re: RP2040 reset idea25john larkin
18 Sep 24 i   +* Re: RP2040 reset idea3john larkin
19 Sep 24 i   i`* Re: RP2040 reset idea2Lawrence D'Oliveiro
19 Sep 24 i   i `- Re: RP2040 reset idea1John R Walliker
20 Sep 24 i   `* Re: RP2040 reset idea21Lasse Langwadt
20 Sep 24 i    `* Re: RP2040 reset idea20The Natural Philosopher
20 Sep 24 i     `* Re: RP2040 reset idea19Theo
20 Sep 24 i      `* Re: RP2040 reset idea18john larkin
21 Sep 24 i       `* Re: RP2040 reset idea17The Natural Philosopher
21 Sep 24 i        +* Re: RP2040 reset idea15john larkin
21 Sep 24 i        i`* Re: RP2040 reset idea14The Natural Philosopher
21 Sep 24 i        i `* Re: RP2040 reset idea13john larkin
21 Sep 24 i        i  +* Re: RP2040 reset idea10Phil Hobbs
21 Sep 24 i        i  i`* Re: RP2040 reset idea9john larkin
21 Sep 24 i        i  i +* Re: RP2040 reset idea6Phil Hobbs
22 Sep 24 i        i  i i`* Re: RP2040 reset idea5john larkin
22 Sep 24 i        i  i i `* Re: RP2040 reset idea4The Natural Philosopher
22 Sep 24 i        i  i i  +- Re: RP2040 reset idea1john larkin
23 Sep 24 i        i  i i  `* Re: RP2040 reset idea2druck
24 Sep 24 i        i  i i   `- Re: RP2040 reset idea1Bob Martin
22 Sep 24 i        i  i `* Re: RP2040 reset idea2The Natural Philosopher
22 Sep 24 i        i  i  `- Re: RP2040 reset idea1john larkin
22 Sep 24 i        i  `* Re: RP2040 reset idea2The Natural Philosopher
22 Sep 24 i        i   `- Re: RP2040 reset idea1john larkin
22 Sep 24 i        `- Re: RP2040 reset idea1The Natural Philosopher
17 Sep 24 +* Re: RP2040 reset idea2john larkin
17 Sep 24 i`- Re: RP2040 reset idea1Arie de Muijnck
17 Sep 24 `* Re: RP2040 reset idea2Theo
18 Sep 24  `- Re: RP2040 reset idea1john larkin

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal