How to write device id manually

So i successfully loaded xenon firmware on stock pca10059
but the problem is that it doesn’t find device id.
i dont want to connect it to particle cloud i wanted to connect it to another server. so what the address and how do i write to pca10059 my custom particle id.
need help for the same for stm32 electron
thank you.
i already read how to read particle id from device but there jo tutorial if the flash is fully erased. and i want to restore it.
since i can have keys of server so its not the key issue.
so the final issue is how do i write device id to nrf52840.
using particle-cli or something else.
i do have access using swd and jlink.
please help

It’s not possible to use a non-Particle nRF52 device in a mesh network. Even if you’re not connecting to the Particle cloud, a valid device ID is necessary to join the mesh network.

It’s not just a matter of programming it into the device - the device ID must be valid and in our database. We generate them during manufacture, and it’s part of the cost of the device.

This also is true for STM32 devices. For example, if you purchase a P1 (WM-N-BM-14) directly from USI or a use a generic STM32 processor, it will not be able to connect to the Particle cloud as its device ID (masked into the MCU) won’t be in our database.

Wi-Fi and cellular devices can use MANUAL mode and connect only to the Wi-Fi/cellular and not the Particle cloud and could work without a valid Particle device ID, but this is not possible for mesh-only nodes.

i don’t want to connect it to particle cloud i already have a xenon so i can mimic the device id but i dont want to connect it to particle cloud i just want to start booting firmware.
so i have a valid device id. and we already have 100+ particles so we can write any valid device id.
we have our particle cloud in our own server. we already connected particle electron to that cloud now we only need device id to be written to get non particle stm32 to connect on our server

i just need a command which can right device id to stm32 i don’t want to connect it to particle cloud, we are already paying particle cloud for 100+ devices and paying for particle cloud but it’s just an R&D purpose. we can’t rely on our own. coz your cloud is production ready we will never move to our own cloud because its required too much time to maintain.but its just a R&D purpose we just want to understand spark protocol because its very cool protocol i have ever seen.
our company is your very old client. we already have working particle device to our own server. and we have already flashed firmware to stm32 nucleo board. it has server keys using particle keys server. but it doesn’t have particle id. and for the fact we are using quectel gsm for datatransfer we have done post and get request using it also the coap. its very cheap than ublox.
please help us to write device id to stm32 using cli thank you.

As Rick already said, you cannot.

This means it’s a physical property of the silicon not a value stored in flash.

so how do i do it ?
is device id already built in to stm32 is that available in generic stm32 ???
or is there any ic ? so we can get it working