This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to build multiple executable files

Hi, team

I am trying to build a system with one master and multiple slaves using the mesh SDK.
( This is similar to the light_switch example. )

At this, I want to give each slave device an ID independent of the node address.
This ID is linked to the installation location.

#####
 I will supplement it just in case.
 I do not consider managing by node address.
 Attach a sticker with an ID printed on each device.
 This will not affect the order of provisioning.
#####

The source code on the slave side is all the same, I just want to change the ID part.
This number is described in c_preprocessor_definitions.

It feels a little bother to change this value every time, build and write.
The more the number of slaves, the more!

So, when I specify a number (for example 10),
I thought that it would be a great idea to build automatically by changing the value of definition and build 10 executable files.

I checked if I could create such a batch file, but I couldn't find what I expected.
I am convinced that this idea is very useful when building a system with such a master-slave relationship, not limited to mesh.

Are there any such information or ideas within the nordic team?


Best Regards,
Wataru

Parents
  • Plenty of possible solutions. One possible solution would be to store your ID in one of the UICR (User Information Configuration Register). You can do this by using the command line 'nrfjprog' tool. You only have to compile a single image, and configure each board separately...

  • Hi,

    You may also have a look at the DEVICEID and DEVICEADDR registers in FICR. Those values are written in production, and are for instance used for providing a random BLE address for the device. Those are well suited if you do not need to choose the specific values yourself.

    Regards,
    Terje

  • Hi, 

    Thank you for your reply.


    The manufacturing address written to FICR is difficult to manage on the system, so I would like to set an arbitrary address if possible.

    As Mr. RayCreemers replied, it may be the easiest way to write an ID in UICR using the command line tool (nrfjprog).
    I will try to realize this method but, I have a question.
    Can I set the ID value to UICR after source code flashed?

    Actually, I have never used nrfjprog before.
    So I examined how to use.

    When trying to write a value to UICR, is it correct with the following command?

     nrfjprog --memwr 0x10001080 --val "ID value"


    I look forward to your answer.

    Best Regards, 
    Wataru

Reply
  • Hi, 

    Thank you for your reply.


    The manufacturing address written to FICR is difficult to manage on the system, so I would like to set an arbitrary address if possible.

    As Mr. RayCreemers replied, it may be the easiest way to write an ID in UICR using the command line tool (nrfjprog).
    I will try to realize this method but, I have a question.
    Can I set the ID value to UICR after source code flashed?

    Actually, I have never used nrfjprog before.
    So I examined how to use.

    When trying to write a value to UICR, is it correct with the following command?

     nrfjprog --memwr 0x10001080 --val "ID value"


    I look forward to your answer.

    Best Regards, 
    Wataru

Children
Related