• RP2040 reset idea

    From john larkin@JL@gct.com to comp.sys.raspberry-pi,sci.electronics.design on Monday, September 16, 2024 19:58:04
    From Newsgroup: comp.sys.raspberry-pi

    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while
    reconnecting power.

    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    https://www.dropbox.com/scl/fi/bbhdy053xsdzv77g0brc5/B-box_Reset_Button_3.jpg?rlkey=40ozzdvczf4z8625u8i081a9b&raw=1

    Does that look like it will work? The paranoid customer can pave over
    the two holes, and even the end-plate screws, with an official-looking
    sticker.

    Schmitt trigger U3 is unfortunate and likely unnecessary, but it
    insures against a low-probability hazard.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Sylvia Else@sylvia@email.invalid to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 12:16:55
    From Newsgroup: comp.sys.raspberry-pi

    On 17-Sept-24 10:58 am, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while reconnecting power.

    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    https://www.dropbox.com/scl/fi/bbhdy053xsdzv77g0brc5/B-box_Reset_Button_3.jpg?rlkey=40ozzdvczf4z8625u8i081a9b&raw=1

    Does that look like it will work? The paranoid customer can pave over
    the two holes, and even the end-plate screws, with an official-looking sticker.

    Schmitt trigger U3 is unfortunate and likely unnecessary, but it
    insures against a low-probability hazard.


    If the board needs to be powered up, rather than just reset, while the
    button is pressed, then how does your solution work? If not, then why is
    the fact that there are three power supplies relevant?

    Sylvia.
    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Arie de Muijnck@noreply@ademu.nl to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 10:49:58
    From Newsgroup: comp.sys.raspberry-pi

    On 2024-09-17 04:58, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while reconnecting power.

    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    https://www.dropbox.com/scl/fi/bbhdy053xsdzv77g0brc5/B-box_Reset_Button_3.jpg?rlkey=40ozzdvczf4z8625u8i081a9b&raw=1

    Does that look like it will work? The paranoid customer can pave over
    the two holes, and even the end-plate screws, with an official-looking sticker.

    Schmitt trigger U3 is unfortunate and likely unnecessary, but it
    insures against a low-probability hazard.


    I used the same idea, but with less hardware. The switch triggered (RC differentiator) the reset pulse and the MCU senses the state of the switch after the reset pulse trailing edge. I used the bootloader code for that timing. The RP2040 could sense the switch state on the BOOT- pin after a long (5 second?) reset pulse, but that would mean a slow start on each power on.

    I think your idea would work OK, just a bit complex. Just NEVER short a cap with a switch (or relay) without a series resistor.

    Arie

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 11:07:17
    From Newsgroup: comp.sys.raspberry-pi

    On 17/09/2024 03:58, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while reconnecting power.

    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    Thats' what my PICO powered thermostats have. For the onboard button though Resetting is done by pulling the power.

    The point is that if you do power up with the button pressed, you wipe
    the entire FLASH RAM I think.


    https://www.dropbox.com/scl/fi/bbhdy053xsdzv77g0brc5/B-box_Reset_Button_3.jpg?rlkey=40ozzdvczf4z8625u8i081a9b&raw=1

    Does that look like it will work? The paranoid customer can pave over
    the two holes, and even the end-plate screws, with an official-looking sticker.
    At a brief glance, yes, but I donbt see why a simmle disconnect power
    switch in addition to the onboard switch wouldn't be as easy.

    Schmitt trigger U3 is unfortunate and likely unnecessary, but it
    insures against a low-probability hazard.

    Once you start laying out a board, put everything on it you may need,
    Can always leave it out later
    --
    New Socialism consists essentially in being seen to have your heart in
    the right place whilst your head is in the clouds and your hand is in
    someone else's pocket.


    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 07:10:39
    From Newsgroup: comp.sys.raspberry-pi

    On Tue, 17 Sep 2024 12:16:55 +0800, Sylvia Else <sylvia@email.invalid>
    wrote:

    On 17-Sept-24 10:58 am, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while
    reconnecting power.

    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    https://www.dropbox.com/scl/fi/bbhdy053xsdzv77g0brc5/B-box_Reset_Button_3.jpg?rlkey=40ozzdvczf4z8625u8i081a9b&raw=1

    Does that look like it will work? The paranoid customer can pave over
    the two holes, and even the end-plate screws, with an official-looking
    sticker.

    Schmitt trigger U3 is unfortunate and likely unnecessary, but it
    insures against a low-probability hazard.


    If the board needs to be powered up, rather than just reset, while the >button is pressed, then how does your solution work? If not, then why is
    the fact that there are three power supplies relevant?

    Sylvia.

    Asserting BOOT- (or pushing the button on the Pico board) at the end
    of reset should launch it into boot mode. On the Pico board,
    asserrting RESET- is done by cycling the power.

    My user might have to remove all three power sources (PoE, 24 volt
    wart, USB) to force a reset, if we did the boot button like the Pico
    does.



    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 07:15:23
    From Newsgroup: comp.sys.raspberry-pi

    On Tue, 17 Sep 2024 10:49:58 +0200, Arie de Muijnck <noreply@ademu.nl>
    wrote:

    On 2024-09-17 04:58, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while
    reconnecting power.

    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    https://www.dropbox.com/scl/fi/bbhdy053xsdzv77g0brc5/B-box_Reset_Button_3.jpg?rlkey=40ozzdvczf4z8625u8i081a9b&raw=1

    Does that look like it will work? The paranoid customer can pave over
    the two holes, and even the end-plate screws, with an official-looking
    sticker.

    Schmitt trigger U3 is unfortunate and likely unnecessary, but it
    insures against a low-probability hazard.


    I used the same idea, but with less hardware. The switch triggered (RC differentiator) the reset pulse and the MCU senses the state of the switch after the reset pulse trailing edge. I used the bootloader code for that timing. The RP2040 could sense the switch state on the BOOT- pin after a long (5 second?) reset pulse, but that would mean a slow start on each power on.

    My circuit doesn't delay a normal powerup. That's dominated by the
    roughly 200 msec reset generated by the MAX809 after the 3.3 supply
    stabilizes.


    I think your idea would work OK, just a bit complex. Just NEVER short a cap with a switch (or relay) without a series resistor.

    I don't think the 10u cap will weld the contacts of the pushbutton.



    Arie
    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 07:20:54
    From Newsgroup: comp.sys.raspberry-pi

    On Tue, 17 Sep 2024 11:07:17 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 17/09/2024 03:58, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while
    reconnecting power.

    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    Thats' what my PICO powered thermostats have. For the onboard button though >Resetting is done by pulling the power.

    The point is that if you do power up with the button pressed, you wipe
    the entire FLASH RAM I think.

    If BOOT- is low at the end of reset, it powers up in USB memory stick
    mode. I don't think that wipes the files stored in the big serial
    flash.




    https://www.dropbox.com/scl/fi/bbhdy053xsdzv77g0brc5/B-box_Reset_Button_3.jpg?rlkey=40ozzdvczf4z8625u8i081a9b&raw=1

    Does that look like it will work? The paranoid customer can pave over
    the two holes, and even the end-plate screws, with an official-looking
    sticker.
    At a brief glance, yes, but I donbt see why a simmle disconnect power
    switch in addition to the onboard switch wouldn't be as easy.

    There are three potential power sources to disconnect, and I don't
    really want a power switch.


    Schmitt trigger U3 is unfortunate and likely unnecessary, but it
    insures against a low-probability hazard.

    Once you start laying out a board, put everything on it you may need,
    Can always leave it out later

    The schmitt adds way under a tenth of a per cent to the board area and
    the cost, so may as well leave it in.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Arie de Muijnck@noreply@ademu.nl to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 17:39:28
    From Newsgroup: comp.sys.raspberry-pi

    On 2024-09-17 16:15, john larkin wrote:
    On Tue, 17 Sep 2024 10:49:58 +0200, Arie de Muijnck <noreply@ademu.nl>
    wrote:
    ...............
    I think your idea would work OK, just a bit complex. Just NEVER short a cap with a switch (or relay) without a series resistor.

    I don't think the 10u cap will weld the contacts of the pushbutton.


    Probably not weld, but destroy the plating. The peak current is very high.
    A 100R SMD resistor is not that expensive...

    Arie

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Theo@theom+news@chiark.greenend.org.uk to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 16:42:36
    From Newsgroup: comp.sys.raspberry-pi

    In comp.sys.raspberry-pi john larkin <JL@gct.com> wrote:
    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    https://www.dropbox.com/scl/fi/bbhdy053xsdzv77g0brc5/B-box_Reset_Button_3.jpg?rlkey=40ozzdvczf4z8625u8i081a9b&raw=1

    Looks neat. But I wonder if there's a mechanical solution. eg give the customer a loop to put a padlock through to lock the lid, and hide the boot button behind, such that they can't press it without undoing the
    padlock. Could even be something simple like a Kensington lock slot where
    the boot button is deeply recessed in the slot - you have to stick a screwdriver in the slot and can't do so if there's a lock inserted.

    Of course that might cost more than your solution, so you can probably
    ignore me :)

    Theo
    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 09:09:28
    From Newsgroup: comp.sys.raspberry-pi

    On Tue, 17 Sep 2024 11:07:17 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 17/09/2024 03:58, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while
    reconnecting power.

    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    Thats' what my PICO powered thermostats have. For the onboard button though >Resetting is done by pulling the power.

    The point is that if you do power up with the button pressed, you wipe
    the entire FLASH RAM I think.


    My Pi guy verifies that entering boot mode doesn't change the contents
    of flash. Power cycle and things run like before.

    You had me worried!

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 17:21:36
    From Newsgroup: comp.sys.raspberry-pi

    On 17/09/2024 17:09, john larkin wrote:
    On Tue, 17 Sep 2024 11:07:17 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 17/09/2024 03:58, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while
    reconnecting power.

    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    Thats' what my PICO powered thermostats have. For the onboard button though >> Resetting is done by pulling the power.

    The point is that if you do power up with the button pressed, you wipe
    the entire FLASH RAM I think.


    My Pi guy verifies that entering boot mode doesn't change the contents
    of flash. Power cycle and things run like before.

    You had me worried!


    Really?

    I guess whenever I entered that mode it was to download fresh code...
    --
    "What do you think about Gay Marriage?"
    "I don't."
    "Don't what?"
    "Think about Gay Marriage."


    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@jl@650pot.com to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 15:33:14
    From Newsgroup: comp.sys.raspberry-pi

    On Tue, 17 Sep 2024 17:21:36 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 17/09/2024 17:09, john larkin wrote:
    On Tue, 17 Sep 2024 11:07:17 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 17/09/2024 03:58, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board;
    if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while
    reconnecting power.

    Some of my customers also want to lock a box such that it's impossible >>>> to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    Thats' what my PICO powered thermostats have. For the onboard button though >>> Resetting is done by pulling the power.

    The point is that if you do power up with the button pressed, you wipe
    the entire FLASH RAM I think.


    My Pi guy verifies that entering boot mode doesn't change the contents
    of flash. Power cycle and things run like before.

    You had me worried!


    Really?

    I guess whenever I entered that mode it was to download fresh code...

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Why .UL2 one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.
    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to comp.sys.raspberry-pi,sci.electronics.design on Tuesday, September 17, 2024 19:02:10
    From Newsgroup: comp.sys.raspberry-pi

    On 17 Sep 2024 16:42:36 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi john larkin <JL@gct.com> wrote:
    Some of my customers also want to lock a box such that it's impossible
    to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long
    push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    https://www.dropbox.com/scl/fi/bbhdy053xsdzv77g0brc5/B-box_Reset_Button_3.jpg?rlkey=40ozzdvczf4z8625u8i081a9b&raw=1

    Looks neat. But I wonder if there's a mechanical solution. eg give the >customer a loop to put a padlock through to lock the lid, and hide the boot >button behind, such that they can't press it without undoing the
    padlock. Could even be something simple like a Kensington lock slot where >the boot button is deeply recessed in the slot - you have to stick a >screwdriver in the slot and can't do so if there's a lock inserted.

    Of course that might cost more than your solution, so you can probably
    ignore me :)

    Theo

    It's a pretty small box.

    https://www.dropbox.com/scl/fi/phhyn6p5lnwyza9of9qil/B953_Right.jpg?rlkey=xuu5qclmygkruncrat6li1u3j&dl=0

    If we mount two in a 1U rack adapter, it wouldn't be practical to
    remove the covers.


    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@jl@650pot.com to comp.sys.raspberry-pi,sci.electronics.design on Wednesday, September 18, 2024 12:56:44
    From Newsgroup: comp.sys.raspberry-pi

    On Tue, 17 Sep 2024 15:33:14 -0700, john larkin <jl@650pot.com> wrote:

    On Tue, 17 Sep 2024 17:21:36 +0100, The Natural Philosopher ><tnp@invalid.invalid> wrote:

    On 17/09/2024 17:09, john larkin wrote:
    On Tue, 17 Sep 2024 11:07:17 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 17/09/2024 03:58, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board; >>>>> if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while
    reconnecting power.

    Some of my customers also want to lock a box such that it's impossible >>>>> to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long >>>>> push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    Thats' what my PICO powered thermostats have. For the onboard button though
    Resetting is done by pulling the power.

    The point is that if you do power up with the button pressed, you wipe >>>> the entire FLASH RAM I think.


    My Pi guy verifies that entering boot mode doesn't change the contents
    of flash. Power cycle and things run like before.

    You had me worried!


    Really?

    I guess whenever I entered that mode it was to download fresh code...

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Why .UL2 one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.


    Update:

    The Pico only allows one file to be saved to the flash using USB
    memory-stick mode.

    If you copy a bunch of files into the flash, Windows will lie about
    what's there, but there is really only one. If you disconnect the USB
    cable and reconnect, Windows will show the one file.

    The Pi tools support packing a bunch of things into that one file,
    including the executable for Alice, namely CPU0. Alice takes over and
    loads Bob, CPU1, and can access other components of the big file.

    Power cycling, normal or into USB memory stick mode, does not wipe
    that big file.

    There's no simple way to examine the components of the big file, other
    than to ask Alice. Alice knows.

    All that is based on experiment.


    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.sys.raspberry-pi,sci.electronics.design on Thursday, September 19, 2024 02:45:34
    From Newsgroup: comp.sys.raspberry-pi

    On Wed, 18 Sep 2024 12:56:44 -0700, john larkin wrote:

    If you copy a bunch of files into the flash, Windows will lie about
    what's there, but there is really only one. If you disconnect the USB
    cable and reconnect, Windows will show the one file.

    What if you try it from Linux?

    Unlike Windows, Linux is less prone to lie about things.
    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From John R Walliker@jrwalliker@gmail.com to comp.sys.raspberry-pi,sci.electronics.design on Thursday, September 19, 2024 10:02:52
    From Newsgroup: comp.sys.raspberry-pi

    On 19/09/2024 03:45, Lawrence D'Oliveiro wrote:
    On Wed, 18 Sep 2024 12:56:44 -0700, john larkin wrote:

    If you copy a bunch of files into the flash, Windows will lie about
    what's there, but there is really only one. If you disconnect the USB
    cable and reconnect, Windows will show the one file.

    What if you try it from Linux?

    Unlike Windows, Linux is less prone to lie about things.

    I just tried it using an RP2350 connected to a PC running
    Linux Mint Mate edition.
    I can copy files to the 2350 file system using either the GUI
    or command line and they give the appearance of being copied
    successfully. I can read them back.
    However, if I eject the USB drive and restart the RP2350
    processor the files have gone away. So either they are being
    cached in the PC or they are only transiently stored.

    John

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Lasse Langwadt@llc@fonz.dk to comp.sys.raspberry-pi,sci.electronics.design on Friday, September 20, 2024 00:09:43
    From Newsgroup: comp.sys.raspberry-pi

    On 9/18/24 00:33, john larkin wrote:
    On Tue, 17 Sep 2024 17:21:36 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 17/09/2024 17:09, john larkin wrote:
    On Tue, 17 Sep 2024 11:07:17 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 17/09/2024 03:58, john larkin wrote:
    The RP2040 has a cool mode where it can be made to boot up with the
    USB port looking like a memory stick. That's great for software
    installs or upgrades. The Pico board has a BOOT button on the board; >>>>> if the pico is powered up with the button pushed, it goes into that
    boot mode.

    But if I have a product (actually a family of products) in a nice
    aluminum box, a user would have to remove the top cover, remove all
    power sources (there can be three), and hold the button down while
    reconnecting power.

    Some of my customers also want to lock a box such that it's impossible >>>>> to write to any nonvolatile memory while it's in a secure area.

    So here's an idea: a small hole in the box allows a toothpick or a
    paper clip to push a button. A short push is a regular reset. A long >>>>> push is a memory-stick mode boot. We can have a rotary switch LOCK
    hole too.

    Thats' what my PICO powered thermostats have. For the onboard button though
    Resetting is done by pulling the power.

    The point is that if you do power up with the button pressed, you wipe >>>> the entire FLASH RAM I think.


    My Pi guy verifies that entering boot mode doesn't change the contents
    of flash. Power cycle and things run like before.

    You had me worried!


    Really?

    I guess whenever I entered that mode it was to download fresh code...

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Why .UL2 one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi,sci.electronics.design on Friday, September 20, 2024 09:20:24
    From Newsgroup: comp.sys.raspberry-pi

    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Why   .UL2   one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash.

    There are no visible files to delete.
    --
    Those who want slavery should have the grace to name it by its proper
    name. They must face the full meaning of that which they are advocating
    or condoning; the full, exact, specific meaning of collectivism, of its logical implications, of the principles upon which it is based, and of
    the ultimate consequences to which these principles will lead. They must
    face it, then decide whether this is what they want or not.

    Ayn Rand.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Theo@theom+news@chiark.greenend.org.uk to comp.sys.raspberry-pi,sci.electronics.design on Friday, September 20, 2024 11:30:13
    From Newsgroup: comp.sys.raspberry-pi

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Why   .UL2   one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash.

    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo
    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@jl@650pot.com to comp.sys.raspberry-pi,sci.electronics.design on Friday, September 20, 2024 11:00:00
    From Newsgroup: comp.sys.raspberry-pi

    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote: >> On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Whyáá .UL2áá one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash.

    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of >block writes. UF2 picks out specially tagged block writes and uses that to >program the flash. It doesn't actually care what other stuff is written to >the flash as it ignores all of that, so it doesn't care about all the FAT >stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to >the specific tagged blocks. If the OS is happy to cache the medium (as many >do) you could maybe even reformat it as some other filesystem like NTFS and >it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash
    probably doesn't have a file structure, and the USB memory-stick write
    is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into
    that one big file and users can upgrade box code in the field pretty
    easily.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi,sci.electronics.design on Saturday, September 21, 2024 09:12:06
    From Newsgroup: comp.sys.raspberry-pi

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you >>>>> want.

    It boots CPU 0 (the one we call Alice) from a file with the extension >>>>> .UL2

    Why   .UL2   one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU. >>>>> An FPGA bitstream file. A prototype calibration table. A README file >>>>> to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash.

    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to >> program the flash. It doesn't actually care what other stuff is written to >> the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to >> the specific tagged blocks. If the OS is happy to cache the medium (as many >> do) you could maybe even reformat it as some other filesystem like NTFS and >> it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash
    probably doesn't have a file structure, and the USB memory-stick write
    is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into
    that one big file and users can upgrade box code in the field pretty
    easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.
    --
    Microsoft : the best reason to go to Linux that ever existed.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to comp.sys.raspberry-pi,sci.electronics.design on Saturday, September 21, 2024 08:08:42
    From Newsgroup: comp.sys.raspberry-pi

    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you >>>>>> want.

    It boots CPU 0 (the one we call Alice) from a file with the extension >>>>>> .UL2

    Whyáá .UL2áá one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU. >>>>>> An FPGA bitstream file. A prototype calibration table. A README file >>>>>> to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be >>>> an empty drive, erases everything on it and programs the flash.

    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of >>> block writes. UF2 picks out specially tagged block writes and uses that to >>> program the flash. It doesn't actually care what other stuff is written to >>> the flash as it ignores all of that, so it doesn't care about all the FAT >>> stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to >>> the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and >>> it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash
    probably doesn't have a file structure, and the USB memory-stick write
    is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into
    that one big file and users can upgrade box code in the field pretty
    easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration
    table inside the big flash image. At factory test, we'll grab that,
    edit it for this particular unit, and save it to a small SPI eeprom
    chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the
    UF2 file that identifies it, well, as a UF2 file. That confirms that
    the Pico flash doesn't have a file structure, it just stores one giant
    chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that
    stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will
    ever write a bootable image that big. That might work.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi,sci.electronics.design on Saturday, September 21, 2024 19:29:26
    From Newsgroup: comp.sys.raspberry-pi

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you >>>>>>> want.

    It boots CPU 0 (the one we call Alice) from a file with the extension >>>>>>> .UL2

    Why   .UL2   one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU. >>>>>>> An FPGA bitstream file. A prototype calibration table. A README file >>>>>>> to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be >>>>> an empty drive, erases everything on it and programs the flash.

    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of >>>> block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT >>>> stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash
    probably doesn't have a file structure, and the USB memory-stick write
    is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into
    that one big file and users can upgrade box code in the field pretty
    easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration
    table inside the big flash image. At factory test, we'll grab that,
    edit it for this particular unit, and save it to a small SPI eeprom
    chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the
    UF2 file that identifies it, well, as a UF2 file. That confirms that
    the Pico flash doesn't have a file structure, it just stores one giant
    chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that
    stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will
    ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV
    data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above
    that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    Will keep me busy through the dark winter days...:-)
    --
    There’s a mighty big difference between good, sound reasons and reasons
    that sound good.

    Burton Hillis (William Vaughn, American columnist)

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to comp.sys.raspberry-pi,sci.electronics.design on Saturday, September 21, 2024 12:43:58
    From Newsgroup: comp.sys.raspberry-pi

    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you >>>>>>>> want.

    It boots CPU 0 (the one we call Alice) from a file with the extension >>>>>>>> .UL2

    Whyáá .UL2áá one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU. >>>>>>>> An FPGA bitstream file. A prototype calibration table. A README file >>>>>>>> to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be >>>>>> an empty drive, erases everything on it and programs the flash.

    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of >>>>> block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT >>>>> stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash
    probably doesn't have a file structure, and the USB memory-stick write >>>> is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into
    that one big file and users can upgrade box code in the field pretty
    easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration
    table inside the big flash image. At factory test, we'll grab that,
    edit it for this particular unit, and save it to a small SPI eeprom
    chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the
    UF2 file that identifies it, well, as a UF2 file. That confirms that
    the Pico flash doesn't have a file structure, it just stores one giant
    chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that
    stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will
    ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV
    data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above
    that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will
    sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very
    careful.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Phil Hobbs@pcdhSpamMeSenseless@electrooptical.net to sci.electronics.design,comp.sys.raspberry-pi on Saturday, September 21, 2024 19:50:34
    From Newsgroup: comp.sys.raspberry-pi

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you >>>>>>>>> want.

    It boots CPU 0 (the one we call Alice) from a file with the extension >>>>>>>>> .UL2

    Why   .UL2   one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU. >>>>>>>>> An FPGA bitstream file. A prototype calibration table. A README file >>>>>>>>> to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be >>>>>>> an empty drive, erases everything on it and programs the flash.

    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of >>>>>> block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash >>>>> probably doesn't have a file structure, and the USB memory-stick write >>>>> is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into
    that one big file and users can upgrade box code in the field pretty >>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration
    table inside the big flash image. At factory test, we'll grab that,
    edit it for this particular unit, and save it to a small SPI eeprom
    chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the
    UF2 file that identifies it, well, as a UF2 file. That confirms that
    the Pico flash doesn't have a file structure, it just stores one giant
    chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that
    stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will
    ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV
    data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above
    that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very careful.



    It’s good to have a warm relationship with your linker mapfile. ;)

    Cheers

    Phil Hobbs
    --
    Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics
    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to sci.electronics.design,comp.sys.raspberry-pi on Saturday, September 21, 2024 12:56:53
    From Newsgroup: comp.sys.raspberry-pi

    On Sat, 21 Sep 2024 19:50:34 -0000 (UTC), Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you >>>>>>>>>> want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Whyáá .UL2áá one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file >>>>>>>>>> to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash. >>>>>>>>
    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash >>>>>> probably doesn't have a file structure, and the USB memory-stick write >>>>>> is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into >>>>>> that one big file and users can upgrade box code in the field pretty >>>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration
    table inside the big flash image. At factory test, we'll grab that,
    edit it for this particular unit, and save it to a small SPI eeprom
    chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the
    UF2 file that identifies it, well, as a UF2 file. That confirms that
    the Pico flash doesn't have a file structure, it just stores one giant >>>> chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that
    stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will
    ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV
    data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above >>> that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will
    sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very
    careful.



    ItÆs good to have a warm relationship with your linker mapfile. ;)

    Cheers

    Phil Hobbs

    Interrupts might get nasty, demanding swaps into the flash cache when
    the flash is busy writing.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Phil Hobbs@pcdhSpamMeSenseless@electrooptical.net to sci.electronics.design,comp.sys.raspberry-pi on Saturday, September 21, 2024 20:46:52
    From Newsgroup: comp.sys.raspberry-pi

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:50:34 -0000 (UTC), Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Why   .UL2   one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash. >>>>>>>>>
    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash >>>>>>> probably doesn't have a file structure, and the USB memory-stick write >>>>>>> is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into >>>>>>> that one big file and users can upgrade box code in the field pretty >>>>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration >>>>> table inside the big flash image. At factory test, we'll grab that,
    edit it for this particular unit, and save it to a small SPI eeprom
    chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the
    UF2 file that identifies it, well, as a UF2 file. That confirms that >>>>> the Pico flash doesn't have a file structure, it just stores one giant >>>>> chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that
    stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will
    ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV
    data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above >>>> that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will
    sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very
    careful.



    It’s good to have a warm relationship with your linker mapfile. ;)

    Cheers

    Phil Hobbs

    Interrupts might get nasty, demanding swaps into the flash cache when
    the flash is busy writing.



    That’s where the mapfile comes in. Assuming that you can update one flash page while updating another, that is.

    Cheers

    Phil Hobbs
    --
    Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics
    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to sci.electronics.design,comp.sys.raspberry-pi on Saturday, September 21, 2024 16:11:32
    From Newsgroup: comp.sys.raspberry-pi

    On Sat, 21 Sep 2024 20:46:52 -0000 (UTC), Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:50:34 -0000 (UTC), Phil Hobbs
    <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Whyáá .UL2áá one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash. >>>>>>>>>>
    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of >>>>>>>> writing that file wipes anything that was there before. So the flash >>>>>>>> probably doesn't have a file structure, and the USB memory-stick write >>>>>>>> is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into >>>>>>>> that one big file and users can upgrade box code in the field pretty >>>>>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration >>>>>> table inside the big flash image. At factory test, we'll grab that, >>>>>> edit it for this particular unit, and save it to a small SPI eeprom >>>>>> chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the >>>>>> UF2 file that identifies it, well, as a UF2 file. That confirms that >>>>>> the Pico flash doesn't have a file structure, it just stores one giant >>>>>> chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that >>>>>> stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will >>>>>> ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV >>>>> data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above >>>>> that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will
    sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very >>>> careful.



    It?s good to have a warm relationship with your linker mapfile. ;)

    Cheers

    Phil Hobbs

    Interrupts might get nasty, demanding swaps into the flash cache when
    the flash is busy writing.



    ThatÆs where the mapfile comes in. Assuming that you can update one flash >page while updating another, that is.

    Cheers

    Phil Hobbs

    The RP2040 usually executes code out of a small 16 Kbyte sram that
    caches code from the flash, so users don't have obvious control over
    which flash pages are being read. To write to flash, one has to do
    things to ensure that nothing needs to read the flash chip for the
    duration of the write.

    That's a big hassle to save 24 cents of SPI flash chip off to the
    side.

    I guess the flash cache approach might trash IRQ latency. The flash is
    4-lane SPI. I think we can tell the compiler to put the ISRs and some
    bits of time-critical code into the bigger (256 Kbytes) SRAM.

    Our biggish sine lookup table could be plopped into SRAM too, to
    reduce thrashing.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From dplatt@dplatt@coop.radagast.org (Dave Platt) to comp.sys.raspberry-pi,sci.electronics.design on Saturday, September 21, 2024 20:08:48
    From Newsgroup: comp.sys.raspberry-pi

    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.

    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.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi,sci.electronics.design on Sunday, September 22, 2024 09:30:52
    From Newsgroup: comp.sys.raspberry-pi

    On 21/09/2024 20:43, john larkin wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you >>>>>>>>> want.

    It boots CPU 0 (the one we call Alice) from a file with the extension >>>>>>>>> .UL2

    Why   .UL2   one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU. >>>>>>>>> An FPGA bitstream file. A prototype calibration table. A README file >>>>>>>>> to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be >>>>>>> an empty drive, erases everything on it and programs the flash.

    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of >>>>>> block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash >>>>> probably doesn't have a file structure, and the USB memory-stick write >>>>> is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into
    that one big file and users can upgrade box code in the field pretty >>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration
    table inside the big flash image. At factory test, we'll grab that,
    edit it for this particular unit, and save it to a small SPI eeprom
    chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the
    UF2 file that identifies it, well, as a UF2 file. That confirms that
    the Pico flash doesn't have a file structure, it just stores one giant
    chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that
    stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will
    ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV
    data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above
    that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.


    Oh. so you are rolling your own boards?

    Nice. I wish I were younger sometimes...

    Too big for 2MYBTE flash? Wow.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very careful.

    Yes, but in my case that is OK. Its configuration data set up on a 'once
    only' type basis during installation. And then very occasionally thereafter.

    WORM - write once, read many.

    And a single threaded code model. No worse than doing a floppy disk
    write in the foreground (remember those days)...
    --
    In a Time of Universal Deceit, Telling the Truth Is a Revolutionary Act.

    - George Orwell

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From The Natural Philosopher@tnp@invalid.invalid to sci.electronics.design,comp.sys.raspberry-pi on Sunday, September 22, 2024 09:32:10
    From Newsgroup: comp.sys.raspberry-pi

    On 21/09/2024 20:56, john larkin wrote:
    On Sat, 21 Sep 2024 19:50:34 -0000 (UTC), Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Why   .UL2   one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash. >>>>>>>>>
    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash >>>>>>> probably doesn't have a file structure, and the USB memory-stick write >>>>>>> is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into >>>>>>> that one big file and users can upgrade box code in the field pretty >>>>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration >>>>> table inside the big flash image. At factory test, we'll grab that,
    edit it for this particular unit, and save it to a small SPI eeprom
    chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the
    UF2 file that identifies it, well, as a UF2 file. That confirms that >>>>> the Pico flash doesn't have a file structure, it just stores one giant >>>>> chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that
    stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will
    ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV
    data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above >>>> that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will
    sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very
    careful.



    It’s good to have a warm relationship with your linker mapfile. ;)

    Cheers

    Phil Hobbs

    Interrupts might get nasty, demanding swaps into the flash cache when
    the flash is busy writing.

    I think the recommended technique is to disable all those and suspend
    any other threads that might be active or write only single threaded code
    --
    “But what a weak barrier is truth when it stands in the way of an hypothesis!”

    Mary Wollstonecraft

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From The Natural Philosopher@tnp@invalid.invalid to sci.electronics.design,comp.sys.raspberry-pi on Sunday, September 22, 2024 09:33:48
    From Newsgroup: comp.sys.raspberry-pi

    On 22/09/2024 00:11, john larkin wrote:
    On Sat, 21 Sep 2024 20:46:52 -0000 (UTC), Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:50:34 -0000 (UTC), Phil Hobbs
    <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Why   .UL2   one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash. >>>>>>>>>>>
    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of >>>>>>>>> writing that file wipes anything that was there before. So the flash >>>>>>>>> probably doesn't have a file structure, and the USB memory-stick write
    is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into >>>>>>>>> that one big file and users can upgrade box code in the field pretty >>>>>>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration >>>>>>> table inside the big flash image. At factory test, we'll grab that, >>>>>>> edit it for this particular unit, and save it to a small SPI eeprom >>>>>>> chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the >>>>>>> UF2 file that identifies it, well, as a UF2 file. That confirms that >>>>>>> the Pico flash doesn't have a file structure, it just stores one giant >>>>>>> chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that >>>>>>> stores files.

    We did consider saving the real cal table at some fixed physical >>>>>>> address near the end of the flash , on the theory that nobody will >>>>>>> ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV >>>>>> data in a high part of the flash.

    I think that the runtime provides access to a memory location that >>>>>> indicates the end of the uploaded flash image, so in theory flash above >>>>>> that is free to write, with the proviso it has to be done in large >>>>>> blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will >>>>> sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very >>>>> careful.



    It?s good to have a warm relationship with your linker mapfile. ;)

    Cheers

    Phil Hobbs

    Interrupts might get nasty, demanding swaps into the flash cache when
    the flash is busy writing.



    That’s where the mapfile comes in. Assuming that you can update one flash >> page while updating another, that is.

    Cheers

    Phil Hobbs

    The RP2040 usually executes code out of a small 16 Kbyte sram that
    caches code from the flash, so users don't have obvious control over
    which flash pages are being read. To write to flash, one has to do
    things to ensure that nothing needs to read the flash chip for the
    duration of the write.

    That's a big hassle to save 24 cents of SPI flash chip off to the
    side.

    And the price of a circuit board!


    I guess the flash cache approach might trash IRQ latency. The flash is
    4-lane SPI. I think we can tell the compiler to put the ISRs and some
    bits of time-critical code into the bigger (256 Kbytes) SRAM.

    Our biggish sine lookup table could be plopped into SRAM too, to
    reduce thrashing.

    --
    “But what a weak barrier is truth when it stands in the way of an hypothesis!”

    Mary Wollstonecraft

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi,sci.electronics.design on Sunday, September 22, 2024 09:37:34
    From Newsgroup: comp.sys.raspberry-pi

    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.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to sci.electronics.design,comp.sys.raspberry-pi on Sunday, September 22, 2024 08:28:22
    From Newsgroup: comp.sys.raspberry-pi

    On Sun, 22 Sep 2024 09:33:48 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 22/09/2024 00:11, john larkin wrote:
    On Sat, 21 Sep 2024 20:46:52 -0000 (UTC), Phil Hobbs
    <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:50:34 -0000 (UTC), Phil Hobbs
    <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Whyáá .UL2áá one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash. >>>>>>>>>>>>
    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of >>>>>>>>>> writing that file wipes anything that was there before. So the flash >>>>>>>>>> probably doesn't have a file structure, and the USB memory-stick write
    is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into >>>>>>>>>> that one big file and users can upgrade box code in the field pretty >>>>>>>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration >>>>>>>> table inside the big flash image. At factory test, we'll grab that, >>>>>>>> edit it for this particular unit, and save it to a small SPI eeprom >>>>>>>> chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the >>>>>>>> UF2 file that identifies it, well, as a UF2 file. That confirms that >>>>>>>> the Pico flash doesn't have a file structure, it just stores one giant >>>>>>>> chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that >>>>>>>> stores files.

    We did consider saving the real cal table at some fixed physical >>>>>>>> address near the end of the flash , on the theory that nobody will >>>>>>>> ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV >>>>>>> data in a high part of the flash.

    I think that the runtime provides access to a memory location that >>>>>>> indicates the end of the uploaded flash image, so in theory flash above >>>>>>> that is free to write, with the proviso it has to be done in large >>>>>>> blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will >>>>>> sometimes store an FPGA config file that could be too big for the 2 >>>>>> MByte part on the Pico.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't >>>>>> run flash-cached code while the write is going on, unless you are very >>>>>> careful.



    It?s good to have a warm relationship with your linker mapfile. ;)

    Cheers

    Phil Hobbs

    Interrupts might get nasty, demanding swaps into the flash cache when
    the flash is busy writing.



    ThatÆs where the mapfile comes in. Assuming that you can update one flash >>> page while updating another, that is.

    Cheers

    Phil Hobbs

    The RP2040 usually executes code out of a small 16 Kbyte sram that
    caches code from the flash, so users don't have obvious control over
    which flash pages are being read. To write to flash, one has to do
    things to ensure that nothing needs to read the flash chip for the
    duration of the write.

    That's a big hassle to save 24 cents of SPI flash chip off to the
    side.

    And the price of a circuit board!


    The boards in this series are about 17 square inches, usually 6
    layers, and we'll have parts on both sides.

    The CPU and big flash and small flash would fit inside the footprint
    of the Ethernet connector! And cost a lot less!

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to sci.electronics.design,comp.sys.raspberry-pi on Sunday, September 22, 2024 10:46:20
    From Newsgroup: comp.sys.raspberry-pi

    On Sun, 22 Sep 2024 09:32:10 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 21/09/2024 20:56, john larkin wrote:
    On Sat, 21 Sep 2024 19:50:34 -0000 (UTC), Phil Hobbs
    <pcdhSpamMeSenseless@electrooptical.net> wrote:

    john larkin <JL@gct.com> wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you
    want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Whyáá .UL2áá one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file
    to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash. >>>>>>>>>>
    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of >>>>>>>> writing that file wipes anything that was there before. So the flash >>>>>>>> probably doesn't have a file structure, and the USB memory-stick write >>>>>>>> is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into >>>>>>>> that one big file and users can upgrade box code in the field pretty >>>>>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration >>>>>> table inside the big flash image. At factory test, we'll grab that, >>>>>> edit it for this particular unit, and save it to a small SPI eeprom >>>>>> chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the >>>>>> UF2 file that identifies it, well, as a UF2 file. That confirms that >>>>>> the Pico flash doesn't have a file structure, it just stores one giant >>>>>> chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that >>>>>> stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will >>>>>> ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV >>>>> data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above >>>>> that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will
    sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.



    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very >>>> careful.



    ItÆs good to have a warm relationship with your linker mapfile. ;)

    Cheers

    Phil Hobbs

    Interrupts might get nasty, demanding swaps into the flash cache when
    the flash is busy writing.

    I think the recommended technique is to disable all those and suspend
    any other threads that might be active or write only single threaded code

    I think we'll go bare-metal on both CPUs, no RTOS, but we'll still
    have interrupts so can't guarantee that all the code we need is in the
    tiny cache. A separate small eeprom simplifies things.

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From john larkin@JL@gct.com to comp.sys.raspberry-pi,sci.electronics.design on Sunday, September 22, 2024 10:51:35
    From Newsgroup: comp.sys.raspberry-pi

    On Sun, 22 Sep 2024 09:30:52 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 21/09/2024 20:43, john larkin wrote:
    On Sat, 21 Sep 2024 19:29:26 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 21/09/2024 16:08, john larkin wrote:
    On Sat, 21 Sep 2024 09:12:06 +0100, The Natural Philosopher
    <tnp@invalid.invalid> wrote:

    On 20/09/2024 19:00, john larkin wrote:
    On 20 Sep 2024 11:30:13 +0100 (BST), Theo
    <theom+news@chiark.greenend.org.uk> wrote:

    In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 19/09/2024 23:09, Lasse Langwadt wrote:
    On 9/18/24 00:33, john larkin wrote:

    It looks like a USB memory stick. You can delete or add files if you >>>>>>>>>> want.

    It boots CPU 0 (the one we call Alice) from a file with the extension
    .UL2

    Whyáá .UL2áá one wonders.

    We'll put a bunch of files into the flash. Code for Bob, the 2nd CPU.
    An FPGA bitstream file. A prototype calibration table. A README file >>>>>>>>>> to explain everything in plain English.

    sure it's not UF2?

    https://github.com/microsoft/uf2


    Definitely uf2 here.

    And no, you cannot 'delete or add files' to it.
    The action of pretending to download a uf2 file into what appears to be
    an empty drive, erases everything on it and programs the flash. >>>>>>>>
    There are no visible files to delete.

    Neat. So basically you throw some files at it, which causes a series of
    block writes. UF2 picks out specially tagged block writes and uses that to
    program the flash. It doesn't actually care what other stuff is written to
    the flash as it ignores all of that, so it doesn't care about all the FAT
    stuff or whatever junk your OS decides to put on there.

    Means you can write any kind of files to it and it'll only pay attention to
    the specific tagged blocks. If the OS is happy to cache the medium (as many
    do) you could maybe even reformat it as some other filesystem like NTFS and
    it would still handle writing the UF2 file correctly.

    Theo

    My Pi guy says that you can only write one file, and the act of
    writing that file wipes anything that was there before. So the flash >>>>>> probably doesn't have a file structure, and the USB memory-stick write >>>>>> is, well, a sort of cheap trick.

    That's workable, if inelegant. We can pack everything we need into >>>>>> that one big file and users can upgrade box code in the field pretty >>>>>> easily.


    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.
    And it gets wiped when new code is uploaded


    It is an area I will have to tackle for one project tho.

    Yes, writing to flash from the running application is nasty.

    We have to calibrate each box. We'll store the prototype calibration
    table inside the big flash image. At factory test, we'll grab that,
    edit it for this particular unit, and save it to a small SPI eeprom
    chip. That costs 24 cents and one chip select pin.

    My guy says that there are a few magic integers at the start of the
    UF2 file that identifies it, well, as a UF2 file. That confirms that
    the Pico flash doesn't have a file structure, it just stores one giant >>>> chunk of stuff starting at the start.

    It's Windows who lies about it acting like a USB memory stick that
    stores files.

    We did consider saving the real cal table at some fixed physical
    address near the end of the flash , on the theory that nobody will
    ever write a bootable image that big. That might work.

    That seems to be the case.

    I looked into it enough to see that it would be possible to store NV
    data in a high part of the flash.

    I think that the runtime provides access to a memory location that
    indicates the end of the uploaded flash image, so in theory flash above
    that is free to write, with the proviso it has to be done in large
    blocks on specific address boundaries.

    All this is at least Pi Pico specific anyway.

    We're using the RP2040 chip, so will have a huge flash chip. We will
    sometimes store an FPGA config file that could be too big for the 2
    MByte part on the Pico.


    Oh. so you are rolling your own boards?

    I'm a circuit designer! I design boards.

    I was going to plop a Pico on my boards, as a component, but it's big
    and has the small flash and the USB connector is awkward, so we'll
    solder the CPU and flash and such to our board.




    Nice. I wish I were younger sometimes...

    Can't disagree about that.



    Too big for 2MYBTE flash? Wow.

    We will use an FPGA on some products, and store the big uncompressed configuration bitfile on the same flash.





    Will keep me busy through the dark winter days...:-)

    Storing anything in high flash still has the problem that you can't
    run flash-cached code while the write is going on, unless you are very
    careful.

    Yes, but in my case that is OK. Its configuration data set up on a 'once >only' type basis during installation. And then very occasionally thereafter.

    WORM - write once, read many.

    And a single threaded code model. No worse than doing a floppy disk
    write in the foreground (remember those days)...
    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From druck@news@druck.org.uk to sci.electronics.design,comp.sys.raspberry-pi on Monday, September 23, 2024 11:52:07
    From Newsgroup: comp.sys.raspberry-pi

    [Massive snip]

    Come on everyone, please edit down the previous messages to just the bit
    you are responding to.

    I don't have all day to spend scrolling.

    --druck

    --- Synchronet 3.19b-Win32 NewsLink 1.113
  • From Bob Martin@bob.martin@excite.com to comp.sys.raspberry-pi on Tuesday, September 24, 2024 04:40:36
    From Newsgroup: comp.sys.raspberry-pi

    On 23 Sep 2024 at 10:52:07, druck <news@druck.org.uk> wrote:
    [Massive snip]

    Come on everyone, please edit down the previous messages to just the bit
    you are responding to.

    I don't have all day to spend scrolling.

    +1

    --- Synchronet 3.19b-Win32 NewsLink 1.113