Re: how to add unique_id for Raspberry Pi Pico?

2024-04-03 Thread Adam Comley
What is the use case for needing the ID to match pico-sdk's implementation? With the PRNG approach we get some useful properties: 1. Firmware updates can change CONFIG_BOARDCTL_UNIQUEID_SIZE without affecting the most significant bytes of the board ID. If I'm using 6 bytes for a MAC address

Re: how to add unique_id for Raspberry Pi Pico?

2024-04-02 Thread Anders
Thank you Alan, that is even better. Another option is to introduce a separate configuration option, e.g. CONFIG_BOARDCTL_RP2040_HARDWAREID. If that is set, code would be compiled to return a unique id based directly on hardware values, independent of the relative sizes of the

Re: how to add unique_id for Raspberry Pi Pico?

2024-04-01 Thread Alan C. Assis
Should it be: #if CONFIG_BOARDCTL_UNIQUEID_SIZE <= RP2040_FLASH_ID_SIZE ? BR, Alan On Mon, Apr 1, 2024 at 5:45 PM Anders wrote: > Hi, > > The unique id solution for the Raspberry Pi by Adam and his team works > very well. However, I suggest a slight modification of the code. In short, > if

Re: how to add unique_id for Raspberry Pi Pico?

2024-04-01 Thread Anders
Hi, The unique id solution for the Raspberry Pi by Adam and his team works very well. However, I suggest a slight modification of the code. In short, if the number of bytes of the NuttX unique id is configured equal to the actual number of bytes of the id in the Pico flash hardware system (8

Re: how to add unique_id for Raspberry Pi Pico?

2024-03-17 Thread Anders
Hello Adam Excellent! Precisely what I was looking for. I'll check it out. Thanks, Anders On Sunday, 17 March 2024 at 12:54, Adam Comley wrote: > Hi Anders, > > I recently had a need for this feature as well, and put together a PR > based on the pico-sdk implementation. See: > >

Re: how to add unique_id for Raspberry Pi Pico?

2024-03-17 Thread Adam Comley
Hi Anders, I recently had a need for this feature as well, and put together a PR based on the pico-sdk implementation. See: https://github.com/apache/nuttx/pull/11927 Hope this helps. -- Adam

Re: how to add unique_id for Raspberry Pi Pico?

2024-03-17 Thread Anders
Yes I know how it is done with the Pico-SDK, the NuttX is sort of different :-) The fact that the ID is stored in the flash circuits and not in the processor seems to make it a bit tricky. In the file pico-sdk/src/rp2_common/hardware_flash/include/hardware/flash.h it is recommended to extract

Re: how to add unique_id for Raspberry Pi Pico?

2024-03-14 Thread Alan C. Assis
Hi Anders, As I said the RP2040 doesn't have a unique id like others MCUs, then the solution they found was read from its SPI Flash, more info: https://github.com/raspberrypi/pico-sdk/pull/12 You need to look how they did it and use it in NuttX. BR, Alan On Thu, Mar 14, 2024 at 4:09 AM

Re: how to add unique_id for Raspberry Pi Pico?

2024-03-14 Thread Anders
Hello Alan and thanks for the warm welcome. Yes, the id is in the flash part of the board and the code for extracting the unique id is in the Pico bootrom. But how to acces and run bootrom code from a Nuttx application? The code for other boards seem to access an id in a processor register. And

Re: how to add unique_id for Raspberry Pi Pico?

2024-02-25 Thread Alan C. Assis
Hi Anders, Welcome to NuttX !!! Yes, you are right, the rp2040 port doesn't yet have support for uniqueid. If you want to add it, please enter inside nuttx/arch/arm/src/ and "git grep uniqueid" for a reference how it is done in other chips. Example in cxd56xx arch:

how to add unique_id for Raspberry Pi Pico?

2024-02-25 Thread Anders
Having just started to play with nuttx running on Raspberry Pi Pico, I discovered that configuring support for the unique id functions results in a build of nuttx that fails. My understanding is that support for this is not currently added. One can find code for this for other boards in the